Google Cloud Dataplex V1 Client - Class DataplexServiceClient (0.12.0)

Reference documentation and code samples for the Google Cloud Dataplex V1 Client class DataplexServiceClient.

Service Description: Dataplex service provides data lakes as a service. The primary resources offered by this service are Lakes, Zones and Assets which collectively allow a data administrator to organize, manage, secure and catalog data across their organization located across cloud projects in a variety of storage systems including Cloud Storage and BigQuery.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:

$dataplexServiceClient = new DataplexServiceClient();
try {
    $formattedName = $dataplexServiceClient->jobName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]', '[JOB]');
    $dataplexServiceClient->cancelJob($formattedName);
} finally {
    $dataplexServiceClient->close();
}

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.

This service has a new (beta) implementation. See Google\Cloud\Dataplex\V1\Client\DataplexServiceClient to use the new surface.

Namespace

Google \ Cloud \ Dataplex \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
options array

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 string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.

↳ 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.

cancelJob

Cancel jobs running for the task resource.

Parameters
NameDescription
name string

Required. The resource name of the job: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}/job/{job_id}.

optionalArgs 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\Dataplex\V1\CancelJobRequest;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;

/**
 * @param string $formattedName The resource name of the job:
 *                              `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}/job/{job_id}`. Please see
 *                              {@see DataplexServiceClient::jobName()} for help formatting this field.
 */
function cancel_job_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new CancelJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $dataplexServiceClient->cancelJob($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 = DataplexServiceClient::jobName(
        '[PROJECT]',
        '[LOCATION]',
        '[LAKE]',
        '[TASK]',
        '[JOB]'
    );

    cancel_job_sample($formattedName);
}

createAsset

Creates an asset resource.

Parameters
NameDescription
parent string

Required. The resource name of the parent zone: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}.

assetId string

Required. Asset identifier. This ID will be used to generate names such as table names when publishing metadata to Hive Metastore and BigQuery.

  • Must contain only lowercase letters, numbers and hyphens.
  • Must start with a letter.
  • Must end with a number or a letter.
  • Must be between 1-63 characters.
  • Must be unique within the zone.
asset Google\Cloud\Dataplex\V1\Asset

Required. Asset resource.

optionalArgs array

Optional.

↳ validateOnly bool

Optional. Only validate the request, but do not perform mutations. The default is false.

↳ 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Asset;
use Google\Cloud\Dataplex\V1\Asset\ResourceSpec;
use Google\Cloud\Dataplex\V1\Asset\ResourceSpec\Type;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\CreateAssetRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent       The resource name of the parent zone:
 *                                      `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. Please see
 *                                      {@see DataplexServiceClient::zoneName()} for help formatting this field.
 * @param string $assetId               Asset identifier.
 *                                      This ID will be used to generate names such as table names when publishing
 *                                      metadata to Hive Metastore and BigQuery.
 *                                      * Must contain only lowercase letters, numbers and hyphens.
 *                                      * Must start with a letter.
 *                                      * Must end with a number or a letter.
 *                                      * Must be between 1-63 characters.
 *                                      * Must be unique within the zone.
 * @param int    $assetResourceSpecType Immutable. Type of resource.
 */
function create_asset_sample(
    string $formattedParent,
    string $assetId,
    int $assetResourceSpecType
): void {
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $assetResourceSpec = (new ResourceSpec())
        ->setType($assetResourceSpecType);
    $asset = (new Asset())
        ->setResourceSpec($assetResourceSpec);
    $request = (new CreateAssetRequest())
        ->setParent($formattedParent)
        ->setAssetId($assetId)
        ->setAsset($asset);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->createAsset($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Asset $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 = DataplexServiceClient::zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]');
    $assetId = '[ASSET_ID]';
    $assetResourceSpecType = Type::TYPE_UNSPECIFIED;

    create_asset_sample($formattedParent, $assetId, $assetResourceSpecType);
}

createEnvironment

Create an environment resource.

Parameters
NameDescription
parent string

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}.

environmentId string

Required. Environment identifier.

  • Must contain only lowercase letters, numbers and hyphens.
  • Must start with a letter.
  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the lake.
environment Google\Cloud\Dataplex\V1\Environment

Required. Environment resource.

optionalArgs array

Optional.

↳ validateOnly bool

Optional. Only validate the request, but do not perform mutations. The default is false.

↳ 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\CreateEnvironmentRequest;
use Google\Cloud\Dataplex\V1\Environment;
use Google\Cloud\Dataplex\V1\Environment\InfrastructureSpec;
use Google\Cloud\Dataplex\V1\Environment\InfrastructureSpec\OsImageRuntime;
use Google\Rpc\Status;

/**
 * @param string $formattedParent                                  The resource name of the parent lake:
 *                                                                 `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. Please see
 *                                                                 {@see DataplexServiceClient::lakeName()} for help formatting this field.
 * @param string $environmentId                                    Environment identifier.
 *                                                                 * Must contain only lowercase letters, numbers and hyphens.
 *                                                                 * Must start with a letter.
 *                                                                 * Must be between 1-63 characters.
 *                                                                 * Must end with a number or a letter.
 *                                                                 * Must be unique within the lake.
 * @param string $environmentInfrastructureSpecOsImageImageVersion Dataplex Image version.
 */
function create_environment_sample(
    string $formattedParent,
    string $environmentId,
    string $environmentInfrastructureSpecOsImageImageVersion
): void {
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $environmentInfrastructureSpecOsImage = (new OsImageRuntime())
        ->setImageVersion($environmentInfrastructureSpecOsImageImageVersion);
    $environmentInfrastructureSpec = (new InfrastructureSpec())
        ->setOsImage($environmentInfrastructureSpecOsImage);
    $environment = (new Environment())
        ->setInfrastructureSpec($environmentInfrastructureSpec);
    $request = (new CreateEnvironmentRequest())
        ->setParent($formattedParent)
        ->setEnvironmentId($environmentId)
        ->setEnvironment($environment);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->createEnvironment($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Environment $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 = DataplexServiceClient::lakeName('[PROJECT]', '[LOCATION]', '[LAKE]');
    $environmentId = '[ENVIRONMENT_ID]';
    $environmentInfrastructureSpecOsImageImageVersion = '[IMAGE_VERSION]';

    create_environment_sample(
        $formattedParent,
        $environmentId,
        $environmentInfrastructureSpecOsImageImageVersion
    );
}

createLake

Creates a lake resource.

Parameters
NameDescription
parent string

Required. The resource name of the lake location, of the form: projects/{project_number}/locations/{location_id} where location_id refers to a GCP region.

lakeId string

Required. Lake identifier. This ID will be used to generate names such as database and dataset names when publishing metadata to Hive Metastore and BigQuery.

  • Must contain only lowercase letters, numbers and hyphens.
  • Must start with a letter.
  • Must end with a number or a letter.
  • Must be between 1-63 characters.
  • Must be unique within the customer project / location.
lake Google\Cloud\Dataplex\V1\Lake

Required. Lake resource

optionalArgs array

Optional.

↳ validateOnly bool

Optional. Only validate the request, but do not perform mutations. The default is false.

↳ 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\CreateLakeRequest;
use Google\Cloud\Dataplex\V1\Lake;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The resource name of the lake location, of the form:
 *                                projects/{project_number}/locations/{location_id}
 *                                where `location_id` refers to a GCP region. Please see
 *                                {@see DataplexServiceClient::locationName()} for help formatting this field.
 * @param string $lakeId          Lake identifier.
 *                                This ID will be used to generate names such as database and dataset names
 *                                when publishing metadata to Hive Metastore and BigQuery.
 *                                * Must contain only lowercase letters, numbers and hyphens.
 *                                * Must start with a letter.
 *                                * Must end with a number or a letter.
 *                                * Must be between 1-63 characters.
 *                                * Must be unique within the customer project / location.
 */
function create_lake_sample(string $formattedParent, string $lakeId): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $lake = new Lake();
    $request = (new CreateLakeRequest())
        ->setParent($formattedParent)
        ->setLakeId($lakeId)
        ->setLake($lake);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->createLake($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Lake $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 = DataplexServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $lakeId = '[LAKE_ID]';

    create_lake_sample($formattedParent, $lakeId);
}

createTask

Creates a task resource within a lake.

Parameters
NameDescription
parent string

Required. The resource name of the parent lake: projects/{project_number}/locations/{location_id}/lakes/{lake_id}.

taskId string

Required. Task identifier.

task Google\Cloud\Dataplex\V1\Task

Required. Task resource.

optionalArgs array

Optional.

↳ validateOnly bool

Optional. Only validate the request, but do not perform mutations. The default is false.

↳ 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\CreateTaskRequest;
use Google\Cloud\Dataplex\V1\Task;
use Google\Cloud\Dataplex\V1\Task\ExecutionSpec;
use Google\Cloud\Dataplex\V1\Task\TriggerSpec;
use Google\Cloud\Dataplex\V1\Task\TriggerSpec\Type;
use Google\Rpc\Status;

/**
 * @param string $formattedParent                 The resource name of the parent lake:
 *                                                `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. Please see
 *                                                {@see DataplexServiceClient::lakeName()} for help formatting this field.
 * @param string $taskId                          Task identifier.
 * @param int    $taskTriggerSpecType             Immutable. Trigger type of the user-specified Task.
 * @param string $taskExecutionSpecServiceAccount Service account to use to execute a task.
 *                                                If not provided, the default Compute service account for the project is
 *                                                used.
 */
function create_task_sample(
    string $formattedParent,
    string $taskId,
    int $taskTriggerSpecType,
    string $taskExecutionSpecServiceAccount
): void {
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $taskTriggerSpec = (new TriggerSpec())
        ->setType($taskTriggerSpecType);
    $taskExecutionSpec = (new ExecutionSpec())
        ->setServiceAccount($taskExecutionSpecServiceAccount);
    $task = (new Task())
        ->setTriggerSpec($taskTriggerSpec)
        ->setExecutionSpec($taskExecutionSpec);
    $request = (new CreateTaskRequest())
        ->setParent($formattedParent)
        ->setTaskId($taskId)
        ->setTask($task);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->createTask($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Task $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 = DataplexServiceClient::lakeName('[PROJECT]', '[LOCATION]', '[LAKE]');
    $taskId = '[TASK_ID]';
    $taskTriggerSpecType = Type::TYPE_UNSPECIFIED;
    $taskExecutionSpecServiceAccount = '[SERVICE_ACCOUNT]';

    create_task_sample(
        $formattedParent,
        $taskId,
        $taskTriggerSpecType,
        $taskExecutionSpecServiceAccount
    );
}

createZone

Creates a zone resource within a lake.

Parameters
NameDescription
parent string

Required. The resource name of the parent lake: projects/{project_number}/locations/{location_id}/lakes/{lake_id}.

zoneId string

Required. Zone identifier. This ID will be used to generate names such as database and dataset names when publishing metadata to Hive Metastore and BigQuery.

  • Must contain only lowercase letters, numbers and hyphens.
  • Must start with a letter.
  • Must end with a number or a letter.
  • Must be between 1-63 characters.
  • Must be unique across all lakes from all locations in a project.
  • Must not be one of the reserved IDs (i.e. "default", "global-temp")
zone Google\Cloud\Dataplex\V1\Zone

Required. Zone resource.

optionalArgs array

Optional.

↳ validateOnly bool

Optional. Only validate the request, but do not perform mutations. The default is false.

↳ 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\CreateZoneRequest;
use Google\Cloud\Dataplex\V1\Zone;
use Google\Cloud\Dataplex\V1\Zone\ResourceSpec;
use Google\Cloud\Dataplex\V1\Zone\ResourceSpec\LocationType;
use Google\Cloud\Dataplex\V1\Zone\Type;
use Google\Rpc\Status;

/**
 * @param string $formattedParent              The resource name of the parent lake:
 *                                             `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. Please see
 *                                             {@see DataplexServiceClient::lakeName()} for help formatting this field.
 * @param string $zoneId                       Zone identifier.
 *                                             This ID will be used to generate names such as database and dataset names
 *                                             when publishing metadata to Hive Metastore and BigQuery.
 *                                             * Must contain only lowercase letters, numbers and hyphens.
 *                                             * Must start with a letter.
 *                                             * Must end with a number or a letter.
 *                                             * Must be between 1-63 characters.
 *                                             * Must be unique across all lakes from all locations in a project.
 *                                             * Must not be one of the reserved IDs (i.e. "default", "global-temp")
 * @param int    $zoneType                     Immutable. The type of the zone.
 * @param int    $zoneResourceSpecLocationType Immutable. The location type of the resources that are allowed
 *                                             to be attached to the assets within this zone.
 */
function create_zone_sample(
    string $formattedParent,
    string $zoneId,
    int $zoneType,
    int $zoneResourceSpecLocationType
): void {
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $zoneResourceSpec = (new ResourceSpec())
        ->setLocationType($zoneResourceSpecLocationType);
    $zone = (new Zone())
        ->setType($zoneType)
        ->setResourceSpec($zoneResourceSpec);
    $request = (new CreateZoneRequest())
        ->setParent($formattedParent)
        ->setZoneId($zoneId)
        ->setZone($zone);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->createZone($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Zone $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 = DataplexServiceClient::lakeName('[PROJECT]', '[LOCATION]', '[LAKE]');
    $zoneId = '[ZONE_ID]';
    $zoneType = Type::TYPE_UNSPECIFIED;
    $zoneResourceSpecLocationType = LocationType::LOCATION_TYPE_UNSPECIFIED;

    create_zone_sample($formattedParent, $zoneId, $zoneType, $zoneResourceSpecLocationType);
}

deleteAsset

Deletes an asset resource. The referenced storage resource is detached (default) or deleted based on the associated Lifecycle policy.

Parameters
NameDescription
name string

Required. The resource name of the asset: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}.

optionalArgs 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\DeleteAssetRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the asset:
 *                              `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. Please see
 *                              {@see DataplexServiceClient::assetName()} for help formatting this field.
 */
function delete_asset_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new DeleteAssetRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->deleteAsset($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 = DataplexServiceClient::assetName(
        '[PROJECT]',
        '[LOCATION]',
        '[LAKE]',
        '[ZONE]',
        '[ASSET]'
    );

    delete_asset_sample($formattedName);
}

deleteEnvironment

Delete the environment resource. All the child resources must have been deleted before environment deletion can be initiated.

Parameters
NameDescription
name string

Required. The resource name of the environment: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}.

optionalArgs 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\DeleteEnvironmentRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the environment:
 *                              `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. Please see
 *                              {@see DataplexServiceClient::environmentName()} for help formatting this field.
 */
function delete_environment_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new DeleteEnvironmentRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->deleteEnvironment($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 = DataplexServiceClient::environmentName(
        '[PROJECT]',
        '[LOCATION]',
        '[LAKE]',
        '[ENVIRONMENT]'
    );

    delete_environment_sample($formattedName);
}

deleteLake

Deletes a lake resource. All zones within the lake must be deleted before the lake can be deleted.

Parameters
NameDescription
name string

Required. The resource name of the lake: projects/{project_number}/locations/{location_id}/lakes/{lake_id}.

optionalArgs 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\DeleteLakeRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the lake:
 *                              `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. Please see
 *                              {@see DataplexServiceClient::lakeName()} for help formatting this field.
 */
function delete_lake_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new DeleteLakeRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->deleteLake($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 = DataplexServiceClient::lakeName('[PROJECT]', '[LOCATION]', '[LAKE]');

    delete_lake_sample($formattedName);
}

deleteTask

Delete the task resource.

Parameters
NameDescription
name string

Required. The resource name of the task: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}.

optionalArgs 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\DeleteTaskRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the task:
 *                              `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}`. Please see
 *                              {@see DataplexServiceClient::taskName()} for help formatting this field.
 */
function delete_task_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new DeleteTaskRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->deleteTask($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 = DataplexServiceClient::taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]');

    delete_task_sample($formattedName);
}

deleteZone

Deletes a zone resource. All assets within a zone must be deleted before the zone can be deleted.

Parameters
NameDescription
name string

Required. The resource name of the zone: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}.

optionalArgs 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\DeleteZoneRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the zone:
 *                              `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. Please see
 *                              {@see DataplexServiceClient::zoneName()} for help formatting this field.
 */
function delete_zone_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new DeleteZoneRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->deleteZone($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 = DataplexServiceClient::zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]');

    delete_zone_sample($formattedName);
}

getAsset

Retrieves an asset resource.

Parameters
NameDescription
name string

Required. The resource name of the asset: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}.

optionalArgs 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
TypeDescription
Google\Cloud\Dataplex\V1\Asset
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Asset;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\GetAssetRequest;

/**
 * @param string $formattedName The resource name of the asset:
 *                              `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. Please see
 *                              {@see DataplexServiceClient::assetName()} for help formatting this field.
 */
function get_asset_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new GetAssetRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Asset $response */
        $response = $dataplexServiceClient->getAsset($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 = DataplexServiceClient::assetName(
        '[PROJECT]',
        '[LOCATION]',
        '[LAKE]',
        '[ZONE]',
        '[ASSET]'
    );

    get_asset_sample($formattedName);
}

getEnvironment

Get environment resource.

Parameters
NameDescription
name string

Required. The resource name of the environment: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}.

optionalArgs 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
TypeDescription
Google\Cloud\Dataplex\V1\Environment
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\Environment;
use Google\Cloud\Dataplex\V1\GetEnvironmentRequest;

/**
 * @param string $formattedName The resource name of the environment:
 *                              `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. Please see
 *                              {@see DataplexServiceClient::environmentName()} for help formatting this field.
 */
function get_environment_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new GetEnvironmentRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Environment $response */
        $response = $dataplexServiceClient->getEnvironment($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 = DataplexServiceClient::environmentName(
        '[PROJECT]',
        '[LOCATION]',
        '[LAKE]',
        '[ENVIRONMENT]'
    );

    get_environment_sample($formattedName);
}

getJob

Get job resource.

Parameters
NameDescription
name string

Required. The resource name of the job: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}.

optionalArgs 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
TypeDescription
Google\Cloud\Dataplex\V1\Job
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\GetJobRequest;
use Google\Cloud\Dataplex\V1\Job;

/**
 * @param string $formattedName The resource name of the job:
 *                              `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}`. Please see
 *                              {@see DataplexServiceClient::jobName()} for help formatting this field.
 */
function get_job_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new GetJobRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Job $response */
        $response = $dataplexServiceClient->getJob($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 = DataplexServiceClient::jobName(
        '[PROJECT]',
        '[LOCATION]',
        '[LAKE]',
        '[TASK]',
        '[JOB]'
    );

    get_job_sample($formattedName);
}

getLake

Retrieves a lake resource.

Parameters
NameDescription
name string

Required. The resource name of the lake: projects/{project_number}/locations/{location_id}/lakes/{lake_id}.

optionalArgs 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
TypeDescription
Google\Cloud\Dataplex\V1\Lake
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\GetLakeRequest;
use Google\Cloud\Dataplex\V1\Lake;

/**
 * @param string $formattedName The resource name of the lake:
 *                              `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. Please see
 *                              {@see DataplexServiceClient::lakeName()} for help formatting this field.
 */
function get_lake_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new GetLakeRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Lake $response */
        $response = $dataplexServiceClient->getLake($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 = DataplexServiceClient::lakeName('[PROJECT]', '[LOCATION]', '[LAKE]');

    get_lake_sample($formattedName);
}

getTask

Get task resource.

Parameters
NameDescription
name string

Required. The resource name of the task: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}.

optionalArgs 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
TypeDescription
Google\Cloud\Dataplex\V1\Task
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\GetTaskRequest;
use Google\Cloud\Dataplex\V1\Task;

/**
 * @param string $formattedName The resource name of the task:
 *                              `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`. Please see
 *                              {@see DataplexServiceClient::taskName()} for help formatting this field.
 */
function get_task_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new GetTaskRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Task $response */
        $response = $dataplexServiceClient->getTask($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 = DataplexServiceClient::taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]');

    get_task_sample($formattedName);
}

getZone

Retrieves a zone resource.

Parameters
NameDescription
name string

Required. The resource name of the zone: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}.

optionalArgs 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
TypeDescription
Google\Cloud\Dataplex\V1\Zone
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\GetZoneRequest;
use Google\Cloud\Dataplex\V1\Zone;

/**
 * @param string $formattedName The resource name of the zone:
 *                              `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. Please see
 *                              {@see DataplexServiceClient::zoneName()} for help formatting this field.
 */
function get_zone_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new GetZoneRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Zone $response */
        $response = $dataplexServiceClient->getZone($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 = DataplexServiceClient::zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]');

    get_zone_sample($formattedName);
}

listAssetActions

Lists action resources in an asset.

Parameters
NameDescription
parent string

Required. The resource name of the parent asset: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Action;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\ListAssetActionsRequest;

/**
 * @param string $formattedParent The resource name of the parent asset:
 *                                `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. Please see
 *                                {@see DataplexServiceClient::assetName()} for help formatting this field.
 */
function list_asset_actions_sample(string $formattedParent): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new ListAssetActionsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dataplexServiceClient->listAssetActions($request);

        /** @var Action $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 = DataplexServiceClient::assetName(
        '[PROJECT]',
        '[LOCATION]',
        '[LAKE]',
        '[ZONE]',
        '[ASSET]'
    );

    list_asset_actions_sample($formattedParent);
}

listAssets

Lists asset resources in a zone.

Parameters
NameDescription
parent string

Required. The resource name of the parent zone: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

Optional. Filter request.

↳ orderBy string

Optional. Order by fields for the result.

↳ 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Asset;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\ListAssetsRequest;

/**
 * @param string $formattedParent The resource name of the parent zone:
 *                                `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. Please see
 *                                {@see DataplexServiceClient::zoneName()} for help formatting this field.
 */
function list_assets_sample(string $formattedParent): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new ListAssetsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dataplexServiceClient->listAssets($request);

        /** @var Asset $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 = DataplexServiceClient::zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]');

    list_assets_sample($formattedParent);
}

listEnvironments

Lists environments under the given lake.

Parameters
NameDescription
parent string

Required. The resource name of the parent lake: projects/{project_id}/locations/{location_id}/lakes/{lake_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

Optional. Filter request.

↳ orderBy string

Optional. Order by fields for the result.

↳ 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\Environment;
use Google\Cloud\Dataplex\V1\ListEnvironmentsRequest;

/**
 * @param string $formattedParent The resource name of the parent lake:
 *                                `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. Please see
 *                                {@see DataplexServiceClient::lakeName()} for help formatting this field.
 */
function list_environments_sample(string $formattedParent): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new ListEnvironmentsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dataplexServiceClient->listEnvironments($request);

        /** @var Environment $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 = DataplexServiceClient::lakeName('[PROJECT]', '[LOCATION]', '[LAKE]');

    list_environments_sample($formattedParent);
}

listJobs

Lists Jobs under the given task.

Parameters
NameDescription
parent string

Required. The resource name of the parent environment: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\Job;
use Google\Cloud\Dataplex\V1\ListJobsRequest;

/**
 * @param string $formattedParent The resource name of the parent environment:
 *                                `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`. Please see
 *                                {@see DataplexServiceClient::taskName()} for help formatting this field.
 */
function list_jobs_sample(string $formattedParent): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new ListJobsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dataplexServiceClient->listJobs($request);

        /** @var Job $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 = DataplexServiceClient::taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]');

    list_jobs_sample($formattedParent);
}

listLakeActions

Lists action resources in a lake.

Parameters
NameDescription
parent string

Required. The resource name of the parent lake: projects/{project_number}/locations/{location_id}/lakes/{lake_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Action;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\ListLakeActionsRequest;

/**
 * @param string $formattedParent The resource name of the parent lake:
 *                                `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. Please see
 *                                {@see DataplexServiceClient::lakeName()} for help formatting this field.
 */
function list_lake_actions_sample(string $formattedParent): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new ListLakeActionsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dataplexServiceClient->listLakeActions($request);

        /** @var Action $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 = DataplexServiceClient::lakeName('[PROJECT]', '[LOCATION]', '[LAKE]');

    list_lake_actions_sample($formattedParent);
}

listLakes

Lists lake resources in a project and location.

Parameters
NameDescription
parent string

Required. The resource name of the lake location, of the form: projects/{project_number}/locations/{location_id} where location_id refers to a GCP region.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

Optional. Filter request.

↳ orderBy string

Optional. Order by fields for the result.

↳ 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\Lake;
use Google\Cloud\Dataplex\V1\ListLakesRequest;

/**
 * @param string $formattedParent The resource name of the lake location, of the form:
 *                                `projects/{project_number}/locations/{location_id}`
 *                                where `location_id` refers to a GCP region. Please see
 *                                {@see DataplexServiceClient::locationName()} for help formatting this field.
 */
function list_lakes_sample(string $formattedParent): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new ListLakesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dataplexServiceClient->listLakes($request);

        /** @var Lake $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 = DataplexServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_lakes_sample($formattedParent);
}

listSessions

Lists session resources in an environment.

Parameters
NameDescription
parent string

Required. The resource name of the parent environment: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

Optional. Filter request. The following mode filter is supported to return only the sessions belonging to the requester when the mode is USER and return sessions of all the users when the mode is ADMIN. When no filter is sent default to USER mode. NOTE: When the mode is ADMIN, the requester should have dataplex.environments.listAllSessions permission to list all sessions, in absence of the permission, the request fails. mode = ADMIN | USER

↳ 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\ListSessionsRequest;
use Google\Cloud\Dataplex\V1\Session;

/**
 * @param string $formattedParent The resource name of the parent environment:
 *                                `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`. Please see
 *                                {@see DataplexServiceClient::environmentName()} for help formatting this field.
 */
function list_sessions_sample(string $formattedParent): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new ListSessionsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dataplexServiceClient->listSessions($request);

        /** @var Session $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = DataplexServiceClient::environmentName(
        '[PROJECT]',
        '[LOCATION]',
        '[LAKE]',
        '[ENVIRONMENT]'
    );

    list_sessions_sample($formattedParent);
}

listTasks

Lists tasks under the given lake.

Parameters
NameDescription
parent string

Required. The resource name of the parent lake: projects/{project_number}/locations/{location_id}/lakes/{lake_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

Optional. Filter request.

↳ orderBy string

Optional. Order by fields for the result.

↳ 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\ListTasksRequest;
use Google\Cloud\Dataplex\V1\Task;

/**
 * @param string $formattedParent The resource name of the parent lake:
 *                                `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. Please see
 *                                {@see DataplexServiceClient::lakeName()} for help formatting this field.
 */
function list_tasks_sample(string $formattedParent): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new ListTasksRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dataplexServiceClient->listTasks($request);

        /** @var Task $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 = DataplexServiceClient::lakeName('[PROJECT]', '[LOCATION]', '[LAKE]');

    list_tasks_sample($formattedParent);
}

listZoneActions

Lists action resources in a zone.

Parameters
NameDescription
parent string

Required. The resource name of the parent zone: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Action;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\ListZoneActionsRequest;

/**
 * @param string $formattedParent The resource name of the parent zone:
 *                                `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. Please see
 *                                {@see DataplexServiceClient::zoneName()} for help formatting this field.
 */
function list_zone_actions_sample(string $formattedParent): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new ListZoneActionsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dataplexServiceClient->listZoneActions($request);

        /** @var Action $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 = DataplexServiceClient::zoneName('[PROJECT]', '[LOCATION]', '[LAKE]', '[ZONE]');

    list_zone_actions_sample($formattedParent);
}

listZones

Lists zone resources in a lake.

Parameters
NameDescription
parent string

Required. The resource name of the parent lake: projects/{project_number}/locations/{location_id}/lakes/{lake_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

Optional. Filter request.

↳ orderBy string

Optional. Order by fields for the result.

↳ 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\ListZonesRequest;
use Google\Cloud\Dataplex\V1\Zone;

/**
 * @param string $formattedParent The resource name of the parent lake:
 *                                `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. Please see
 *                                {@see DataplexServiceClient::lakeName()} for help formatting this field.
 */
function list_zones_sample(string $formattedParent): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new ListZonesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dataplexServiceClient->listZones($request);

        /** @var Zone $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 = DataplexServiceClient::lakeName('[PROJECT]', '[LOCATION]', '[LAKE]');

    list_zones_sample($formattedParent);
}

runTask

Run an on demand execution of a Task.

Parameters
NameDescription
name string

Required. The resource name of the task: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}.

optionalArgs array

Optional.

↳ labels array

Optional. User-defined labels for the task. If the map is left empty, the task will run with existing labels from task definition. If the map contains an entry with a new key, the same will be added to existing set of labels. If the map contains an entry with an existing label key in task definition, the task will run with new label value for that entry. Clearing an existing label will require label value to be explicitly set to a hyphen "-". The label value cannot be empty.

↳ args array

Optional. Execution spec arguments. If the map is left empty, the task will run with existing execution spec args from task definition. If the map contains an entry with a new key, the same will be added to existing set of args. If the map contains an entry with an existing arg key in task definition, the task will run with new arg value for that entry. Clearing an existing arg will require arg value to be explicitly set to a hyphen "-". The arg value cannot be empty.

↳ 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
TypeDescription
Google\Cloud\Dataplex\V1\RunTaskResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\RunTaskRequest;
use Google\Cloud\Dataplex\V1\RunTaskResponse;

/**
 * @param string $formattedName The resource name of the task:
 *                              `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`. Please see
 *                              {@see DataplexServiceClient::taskName()} for help formatting this field.
 */
function run_task_sample(string $formattedName): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new RunTaskRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var RunTaskResponse $response */
        $response = $dataplexServiceClient->runTask($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 = DataplexServiceClient::taskName('[PROJECT]', '[LOCATION]', '[LAKE]', '[TASK]');

    run_task_sample($formattedName);
}

updateAsset

Updates an asset resource.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. Mask of fields to update.

asset Google\Cloud\Dataplex\V1\Asset

Required. Update description. Only fields specified in update_mask are updated.

optionalArgs array

Optional.

↳ validateOnly bool

Optional. Only validate the request, but do not perform mutations. The default is false.

↳ 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Asset;
use Google\Cloud\Dataplex\V1\Asset\ResourceSpec;
use Google\Cloud\Dataplex\V1\Asset\ResourceSpec\Type;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\UpdateAssetRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param int $assetResourceSpecType Immutable. Type of resource.
 */
function update_asset_sample(int $assetResourceSpecType): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $updateMask = new FieldMask();
    $assetResourceSpec = (new ResourceSpec())
        ->setType($assetResourceSpecType);
    $asset = (new Asset())
        ->setResourceSpec($assetResourceSpec);
    $request = (new UpdateAssetRequest())
        ->setUpdateMask($updateMask)
        ->setAsset($asset);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->updateAsset($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Asset $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
{
    $assetResourceSpecType = Type::TYPE_UNSPECIFIED;

    update_asset_sample($assetResourceSpecType);
}

updateEnvironment

Update the environment resource.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. Mask of fields to update.

environment Google\Cloud\Dataplex\V1\Environment

Required. Update description. Only fields specified in update_mask are updated.

optionalArgs array

Optional.

↳ validateOnly bool

Optional. Only validate the request, but do not perform mutations. The default is false.

↳ 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\Environment;
use Google\Cloud\Dataplex\V1\Environment\InfrastructureSpec;
use Google\Cloud\Dataplex\V1\Environment\InfrastructureSpec\OsImageRuntime;
use Google\Cloud\Dataplex\V1\UpdateEnvironmentRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param string $environmentInfrastructureSpecOsImageImageVersion Dataplex Image version.
 */
function update_environment_sample(string $environmentInfrastructureSpecOsImageImageVersion): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $updateMask = new FieldMask();
    $environmentInfrastructureSpecOsImage = (new OsImageRuntime())
        ->setImageVersion($environmentInfrastructureSpecOsImageImageVersion);
    $environmentInfrastructureSpec = (new InfrastructureSpec())
        ->setOsImage($environmentInfrastructureSpecOsImage);
    $environment = (new Environment())
        ->setInfrastructureSpec($environmentInfrastructureSpec);
    $request = (new UpdateEnvironmentRequest())
        ->setUpdateMask($updateMask)
        ->setEnvironment($environment);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->updateEnvironment($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Environment $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
{
    $environmentInfrastructureSpecOsImageImageVersion = '[IMAGE_VERSION]';

    update_environment_sample($environmentInfrastructureSpecOsImageImageVersion);
}

updateLake

Updates a lake resource.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. Mask of fields to update.

lake Google\Cloud\Dataplex\V1\Lake

Required. Update description. Only fields specified in update_mask are updated.

optionalArgs array

Optional.

↳ validateOnly bool

Optional. Only validate the request, but do not perform mutations. The default is false.

↳ 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\Lake;
use Google\Cloud\Dataplex\V1\UpdateLakeRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * 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_lake_sample(): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $updateMask = new FieldMask();
    $lake = new Lake();
    $request = (new UpdateLakeRequest())
        ->setUpdateMask($updateMask)
        ->setLake($lake);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->updateLake($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Lake $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());
    }
}

updateTask

Update the task resource.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. Mask of fields to update.

task Google\Cloud\Dataplex\V1\Task

Required. Update description. Only fields specified in update_mask are updated.

optionalArgs array

Optional.

↳ validateOnly bool

Optional. Only validate the request, but do not perform mutations. The default is false.

↳ 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\Task;
use Google\Cloud\Dataplex\V1\Task\ExecutionSpec;
use Google\Cloud\Dataplex\V1\Task\TriggerSpec;
use Google\Cloud\Dataplex\V1\Task\TriggerSpec\Type;
use Google\Cloud\Dataplex\V1\UpdateTaskRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param int    $taskTriggerSpecType             Immutable. Trigger type of the user-specified Task.
 * @param string $taskExecutionSpecServiceAccount Service account to use to execute a task.
 *                                                If not provided, the default Compute service account for the project is
 *                                                used.
 */
function update_task_sample(
    int $taskTriggerSpecType,
    string $taskExecutionSpecServiceAccount
): void {
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $updateMask = new FieldMask();
    $taskTriggerSpec = (new TriggerSpec())
        ->setType($taskTriggerSpecType);
    $taskExecutionSpec = (new ExecutionSpec())
        ->setServiceAccount($taskExecutionSpecServiceAccount);
    $task = (new Task())
        ->setTriggerSpec($taskTriggerSpec)
        ->setExecutionSpec($taskExecutionSpec);
    $request = (new UpdateTaskRequest())
        ->setUpdateMask($updateMask)
        ->setTask($task);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->updateTask($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Task $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
{
    $taskTriggerSpecType = Type::TYPE_UNSPECIFIED;
    $taskExecutionSpecServiceAccount = '[SERVICE_ACCOUNT]';

    update_task_sample($taskTriggerSpecType, $taskExecutionSpecServiceAccount);
}

updateZone

Updates a zone resource.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. Mask of fields to update.

zone Google\Cloud\Dataplex\V1\Zone

Required. Update description. Only fields specified in update_mask are updated.

optionalArgs array

Optional.

↳ validateOnly bool

Optional. Only validate the request, but do not perform mutations. The default is false.

↳ 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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Dataplex\V1\UpdateZoneRequest;
use Google\Cloud\Dataplex\V1\Zone;
use Google\Cloud\Dataplex\V1\Zone\ResourceSpec;
use Google\Cloud\Dataplex\V1\Zone\ResourceSpec\LocationType;
use Google\Cloud\Dataplex\V1\Zone\Type;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param int $zoneType                     Immutable. The type of the zone.
 * @param int $zoneResourceSpecLocationType Immutable. The location type of the resources that are allowed
 *                                          to be attached to the assets within this zone.
 */
function update_zone_sample(int $zoneType, int $zoneResourceSpecLocationType): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $updateMask = new FieldMask();
    $zoneResourceSpec = (new ResourceSpec())
        ->setLocationType($zoneResourceSpecLocationType);
    $zone = (new Zone())
        ->setType($zoneType)
        ->setResourceSpec($zoneResourceSpec);
    $request = (new UpdateZoneRequest())
        ->setUpdateMask($updateMask)
        ->setZone($zone);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $dataplexServiceClient->updateZone($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Zone $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
{
    $zoneType = Type::TYPE_UNSPECIFIED;
    $zoneResourceSpecLocationType = LocationType::LOCATION_TYPE_UNSPECIFIED;

    update_zone_sample($zoneType, $zoneResourceSpecLocationType);
}

getIamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters
NameDescription
resource string

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

optionalArgs array

Optional.

↳ options GetPolicyOptions

OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

↳ 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
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;

/**
 * @param string $resource REQUIRED: The resource for which the policy is being requested.
 *                         See the operation documentation for the appropriate value for this field.
 */
function get_iam_policy_sample(string $resource): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = (new GetIamPolicyRequest())
        ->setResource($resource);

    // Call the API and handle any network failures.
    try {
        /** @var Policy $response */
        $response = $dataplexServiceClient->getIamPolicy($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
{
    $resource = '[RESOURCE]';

    get_iam_policy_sample($resource);
}

setIamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

Parameters
NameDescription
resource string

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policy Google\Cloud\Iam\V1\Policy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

optionalArgs array

Optional.

↳ updateMask FieldMask

OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: paths: "bindings, etag"

↳ 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
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;

/**
 * @param string $resource REQUIRED: The resource for which the policy is being specified.
 *                         See the operation documentation for the appropriate value for this field.
 */
function set_iam_policy_sample(string $resource): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $policy = new Policy();
    $request = (new SetIamPolicyRequest())
        ->setResource($resource)
        ->setPolicy($policy);

    // Call the API and handle any network failures.
    try {
        /** @var Policy $response */
        $response = $dataplexServiceClient->setIamPolicy($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
{
    $resource = '[RESOURCE]';

    set_iam_policy_sample($resource);
}

testIamPermissions

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
resource string

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissions string[]

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

optionalArgs 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
TypeDescription
Google\Cloud\Iam\V1\TestIamPermissionsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;

/**
 * @param string $resource           REQUIRED: The resource for which the policy detail is being requested.
 *                                   See the operation documentation for the appropriate value for this field.
 * @param string $permissionsElement The set of permissions to check for the `resource`. Permissions with
 *                                   wildcards (such as '*' or 'storage.*') are not allowed. For more
 *                                   information see
 *                                   [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
 */
function test_iam_permissions_sample(string $resource, string $permissionsElement): void
{
    // Create a client.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $permissions = [$permissionsElement,];
    $request = (new TestIamPermissionsRequest())
        ->setResource($resource)
        ->setPermissions($permissions);

    // Call the API and handle any network failures.
    try {
        /** @var TestIamPermissionsResponse $response */
        $response = $dataplexServiceClient->testIamPermissions($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
{
    $resource = '[RESOURCE]';
    $permissionsElement = '[PERMISSIONS]';

    test_iam_permissions_sample($resource, $permissionsElement);
}

getLocation

Gets information about a location.

Parameters
NameDescription
optionalArgs array

Optional.

↳ name string

Resource name for the location.

↳ 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
TypeDescription
Google\Cloud\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
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.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = new GetLocationRequest();

    // Call the API and handle any network failures.
    try {
        /** @var Location $response */
        $response = $dataplexServiceClient->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.

Parameters
NameDescription
optionalArgs array

Optional.

↳ name string

The resource that owns the locations collection, if applicable.

↳ filter string

The standard list filter.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\DataplexServiceClient;
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.
    $dataplexServiceClient = new DataplexServiceClient();

    // Prepare the request message.
    $request = new ListLocationsRequest();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $dataplexServiceClient->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());
    }
}

getOperationsClient

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

Returns
TypeDescription
Google\ApiCore\LongRunning\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
NameDescription
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
TypeDescription
Google\ApiCore\OperationResponse

static::assetName

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

Parameters
NameDescription
project string
location string
lake string
zone string
asset string
Returns
TypeDescription
stringThe formatted asset resource.

static::environmentName

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

Parameters
NameDescription
project string
location string
lake string
environment string
Returns
TypeDescription
stringThe formatted environment resource.

static::jobName

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

Parameters
NameDescription
project string
location string
lake string
task string
job string
Returns
TypeDescription
stringThe formatted job resource.

static::lakeName

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

Parameters
NameDescription
project string
location string
lake string
Returns
TypeDescription
stringThe formatted lake resource.

static::locationName

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

Parameters
NameDescription
project string
location string
Returns
TypeDescription
stringThe formatted location resource.

static::taskName

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

Parameters
NameDescription
project string
location string
lake string
task string
Returns
TypeDescription
stringThe formatted task resource.

static::zoneName

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

Parameters
NameDescription
project string
location string
lake string
zone string
Returns
TypeDescription
stringThe formatted zone 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

  • asset: projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}
  • environment: projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}
  • job: projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}/jobs/{job}
  • lake: projects/{project}/locations/{location}/lakes/{lake}
  • location: projects/{project}/locations/{location}
  • task: projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}
  • zone: projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}

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
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.

Constants

SERVICE_NAME

Value: 'google.cloud.dataplex.v1.DataplexService'

The name of the service.

SERVICE_ADDRESS

Value: 'dataplex.googleapis.com'

The default address of the service.

DEFAULT_SERVICE_PORT

Value: 443

The default port of the service.

CODEGEN_NAME

Value: 'gapic'

The name of the code generator, to be included in the agent header.