Google Cloud Ai Platform V1 Client - Class MetadataServiceClient (0.25.0)

Reference documentation and code samples for the Google Cloud Ai Platform V1 Client class MetadataServiceClient.

Service Description: Service for reading and writing metadata entries.

This class is currently experimental and may be subject to changes.

Namespace

Google \ Cloud \ AIPlatform \ V1 \ Client

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.

addContextArtifactsAndExecutions

Adds a set of Artifacts and Executions to a Context. If any of the Artifacts or Executions have already been added to a Context, they are simply skipped.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::addContextArtifactsAndExecutionsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsRequest;
use Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;

/**
 * @param string $formattedContext The resource name of the Context that the Artifacts and
 *                                 Executions belong to. Format:
 *                                 `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
 *                                 Please see {@see MetadataServiceClient::contextName()} for help formatting this field.
 */
function add_context_artifacts_and_executions_sample(string $formattedContext): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $request = (new AddContextArtifactsAndExecutionsRequest())
        ->setContext($formattedContext);

    // Call the API and handle any network failures.
    try {
        /** @var AddContextArtifactsAndExecutionsResponse $response */
        $response = $metadataServiceClient->addContextArtifactsAndExecutions($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
{
    $formattedContext = MetadataServiceClient::contextName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[CONTEXT]'
    );

    add_context_artifacts_and_executions_sample($formattedContext);
}

addContextChildren

Adds a set of Contexts as children to a parent Context. If any of the child Contexts have already been added to the parent Context, they are simply skipped. If this call would create a cycle or cause any Context to have more than 10 parents, the request will fail with an INVALID_ARGUMENT error.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::addContextChildrenAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\AddContextChildrenRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\AddContextChildrenResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\AddContextChildrenRequest;
use Google\Cloud\AIPlatform\V1\AddContextChildrenResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;

/**
 * @param string $formattedContext The resource name of the parent Context.
 *
 *                                 Format:
 *                                 `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
 *                                 Please see {@see MetadataServiceClient::contextName()} for help formatting this field.
 */
function add_context_children_sample(string $formattedContext): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $request = (new AddContextChildrenRequest())
        ->setContext($formattedContext);

    // Call the API and handle any network failures.
    try {
        /** @var AddContextChildrenResponse $response */
        $response = $metadataServiceClient->addContextChildren($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
{
    $formattedContext = MetadataServiceClient::contextName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[CONTEXT]'
    );

    add_context_children_sample($formattedContext);
}

addExecutionEvents

Adds Events to the specified Execution. An Event indicates whether an Artifact was used as an input or output for an Execution. If an Event already exists between the Execution and the Artifact, the Event is skipped.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::addExecutionEventsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\AddExecutionEventsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\AddExecutionEventsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\AddExecutionEventsRequest;
use Google\Cloud\AIPlatform\V1\AddExecutionEventsResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;

/**
 * @param string $formattedExecution The resource name of the Execution that the Events connect
 *                                   Artifacts with.
 *                                   Format:
 *                                   `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`
 *                                   Please see {@see MetadataServiceClient::executionName()} for help formatting this field.
 */
function add_execution_events_sample(string $formattedExecution): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $request = (new AddExecutionEventsRequest())
        ->setExecution($formattedExecution);

    // Call the API and handle any network failures.
    try {
        /** @var AddExecutionEventsResponse $response */
        $response = $metadataServiceClient->addExecutionEvents($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
{
    $formattedExecution = MetadataServiceClient::executionName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[EXECUTION]'
    );

    add_execution_events_sample($formattedExecution);
}

createArtifact

Creates an Artifact associated with a MetadataStore.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::createArtifactAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateArtifactRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\Artifact
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Artifact;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\CreateArtifactRequest;

/**
 * @param string $formattedParent The resource name of the MetadataStore where the Artifact should
 *                                be created.
 *                                Format:
 *                                `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                                Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 */
function create_artifact_sample(string $formattedParent): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $artifact = new Artifact();
    $request = (new CreateArtifactRequest())
        ->setParent($formattedParent)
        ->setArtifact($artifact);

    // Call the API and handle any network failures.
    try {
        /** @var Artifact $response */
        $response = $metadataServiceClient->createArtifact($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    create_artifact_sample($formattedParent);
}

createContext

Creates a Context associated with a MetadataStore.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::createContextAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateContextRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\Context
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Context;
use Google\Cloud\AIPlatform\V1\CreateContextRequest;

/**
 * @param string $formattedParent The resource name of the MetadataStore where the Context should
 *                                be created. Format:
 *                                `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                                Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 */
function create_context_sample(string $formattedParent): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $context = new Context();
    $request = (new CreateContextRequest())
        ->setParent($formattedParent)
        ->setContext($context);

    // Call the API and handle any network failures.
    try {
        /** @var Context $response */
        $response = $metadataServiceClient->createContext($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    create_context_sample($formattedParent);
}

createExecution

Creates an Execution associated with a MetadataStore.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::createExecutionAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateExecutionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\Execution
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\CreateExecutionRequest;
use Google\Cloud\AIPlatform\V1\Execution;

/**
 * @param string $formattedParent The resource name of the MetadataStore where the Execution should
 *                                be created.
 *                                Format:
 *                                `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                                Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 */
function create_execution_sample(string $formattedParent): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $execution = new Execution();
    $request = (new CreateExecutionRequest())
        ->setParent($formattedParent)
        ->setExecution($execution);

    // Call the API and handle any network failures.
    try {
        /** @var Execution $response */
        $response = $metadataServiceClient->createExecution($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    create_execution_sample($formattedParent);
}

createMetadataSchema

Creates a MetadataSchema.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::createMetadataSchemaAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateMetadataSchemaRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\MetadataSchema
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\CreateMetadataSchemaRequest;
use Google\Cloud\AIPlatform\V1\MetadataSchema;

/**
 * @param string $formattedParent      The resource name of the MetadataStore where the MetadataSchema
 *                                     should be created. Format:
 *                                     `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                                     Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 * @param string $metadataSchemaSchema The raw YAML string representation of the MetadataSchema. The
 *                                     combination of [MetadataSchema.version] and the schema name given by
 *                                     `title` in [MetadataSchema.schema] must be unique within a MetadataStore.
 *
 *                                     The schema is defined as an OpenAPI 3.0.2
 *                                     [MetadataSchema
 *                                     Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject)
 */
function create_metadata_schema_sample(
    string $formattedParent,
    string $metadataSchemaSchema
): void {
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $metadataSchema = (new MetadataSchema())
        ->setSchema($metadataSchemaSchema);
    $request = (new CreateMetadataSchemaRequest())
        ->setParent($formattedParent)
        ->setMetadataSchema($metadataSchema);

    // Call the API and handle any network failures.
    try {
        /** @var MetadataSchema $response */
        $response = $metadataServiceClient->createMetadataSchema($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    create_metadata_schema_sample($formattedParent, $metadataSchemaSchema);
}

createMetadataStore

Initializes a MetadataStore, including allocation of resources.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::createMetadataStoreAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateMetadataStoreRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\CreateMetadataStoreRequest;
use Google\Cloud\AIPlatform\V1\MetadataStore;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The resource name of the Location where the MetadataStore should
 *                                be created.
 *                                Format: `projects/{project}/locations/{location}/`
 *                                Please see {@see MetadataServiceClient::locationName()} for help formatting this field.
 */
function create_metadata_store_sample(string $formattedParent): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $metadataStore = new MetadataStore();
    $request = (new CreateMetadataStoreRequest())
        ->setParent($formattedParent)
        ->setMetadataStore($metadataStore);

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

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

    create_metadata_store_sample($formattedParent);
}

deleteArtifact

Deletes an Artifact.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::deleteArtifactAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteArtifactRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteArtifactRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the Artifact to delete.
 *                              Format:
 *                              `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`
 *                              Please see {@see MetadataServiceClient::artifactName()} for help formatting this field.
 */
function delete_artifact_sample(string $formattedName): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $metadataServiceClient->deleteArtifact($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 = MetadataServiceClient::artifactName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[ARTIFACT]'
    );

    delete_artifact_sample($formattedName);
}

deleteContext

Deletes a stored Context.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::deleteContextAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteContextRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteContextRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the Context to delete.
 *                              Format:
 *                              `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
 *                              Please see {@see MetadataServiceClient::contextName()} for help formatting this field.
 */
function delete_context_sample(string $formattedName): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $metadataServiceClient->deleteContext($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 = MetadataServiceClient::contextName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[CONTEXT]'
    );

    delete_context_sample($formattedName);
}

deleteExecution

Deletes an Execution.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::deleteExecutionAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteExecutionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteExecutionRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the Execution to delete.
 *                              Format:
 *                              `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`
 *                              Please see {@see MetadataServiceClient::executionName()} for help formatting this field.
 */
function delete_execution_sample(string $formattedName): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $metadataServiceClient->deleteExecution($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 = MetadataServiceClient::executionName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[EXECUTION]'
    );

    delete_execution_sample($formattedName);
}

deleteMetadataStore

Deletes a single MetadataStore and all its child resources (Artifacts, Executions, and Contexts).

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::deleteMetadataStoreAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteMetadataStoreRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\DeleteMetadataStoreRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the MetadataStore to delete.
 *                              Format:
 *                              `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                              Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 */
function delete_metadata_store_sample(string $formattedName): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $metadataServiceClient->deleteMetadataStore($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 = MetadataServiceClient::metadataStoreName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]'
    );

    delete_metadata_store_sample($formattedName);
}

getArtifact

Retrieves a specific Artifact.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getArtifactAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetArtifactRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\Artifact
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Artifact;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\GetArtifactRequest;

/**
 * @param string $formattedName The resource name of the Artifact to retrieve.
 *                              Format:
 *                              `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`
 *                              Please see {@see MetadataServiceClient::artifactName()} for help formatting this field.
 */
function get_artifact_sample(string $formattedName): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Artifact $response */
        $response = $metadataServiceClient->getArtifact($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 = MetadataServiceClient::artifactName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[ARTIFACT]'
    );

    get_artifact_sample($formattedName);
}

getContext

Retrieves a specific Context.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getContextAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetContextRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\Context
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Context;
use Google\Cloud\AIPlatform\V1\GetContextRequest;

/**
 * @param string $formattedName The resource name of the Context to retrieve.
 *                              Format:
 *                              `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
 *                              Please see {@see MetadataServiceClient::contextName()} for help formatting this field.
 */
function get_context_sample(string $formattedName): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Context $response */
        $response = $metadataServiceClient->getContext($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 = MetadataServiceClient::contextName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[CONTEXT]'
    );

    get_context_sample($formattedName);
}

getExecution

Retrieves a specific Execution.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getExecutionAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetExecutionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\Execution
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Execution;
use Google\Cloud\AIPlatform\V1\GetExecutionRequest;

/**
 * @param string $formattedName The resource name of the Execution to retrieve.
 *                              Format:
 *                              `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`
 *                              Please see {@see MetadataServiceClient::executionName()} for help formatting this field.
 */
function get_execution_sample(string $formattedName): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Execution $response */
        $response = $metadataServiceClient->getExecution($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 = MetadataServiceClient::executionName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[EXECUTION]'
    );

    get_execution_sample($formattedName);
}

getMetadataSchema

Retrieves a specific MetadataSchema.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getMetadataSchemaAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetMetadataSchemaRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\MetadataSchema
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\GetMetadataSchemaRequest;
use Google\Cloud\AIPlatform\V1\MetadataSchema;

/**
 * @param string $formattedName The resource name of the MetadataSchema to retrieve.
 *                              Format:
 *                              `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}`
 *                              Please see {@see MetadataServiceClient::metadataSchemaName()} for help formatting this field.
 */
function get_metadata_schema_sample(string $formattedName): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var MetadataSchema $response */
        $response = $metadataServiceClient->getMetadataSchema($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 = MetadataServiceClient::metadataSchemaName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[METADATA_SCHEMA]'
    );

    get_metadata_schema_sample($formattedName);
}

getMetadataStore

Retrieves a specific MetadataStore.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getMetadataStoreAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetMetadataStoreRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\MetadataStore
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\GetMetadataStoreRequest;
use Google\Cloud\AIPlatform\V1\MetadataStore;

/**
 * @param string $formattedName The resource name of the MetadataStore to retrieve.
 *                              Format:
 *                              `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                              Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 */
function get_metadata_store_sample(string $formattedName): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var MetadataStore $response */
        $response = $metadataServiceClient->getMetadataStore($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 = MetadataServiceClient::metadataStoreName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]'
    );

    get_metadata_store_sample($formattedName);
}

listArtifacts

Lists Artifacts in the MetadataStore.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listArtifactsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListArtifactsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Artifact;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\ListArtifactsRequest;

/**
 * @param string $formattedParent The MetadataStore whose Artifacts should be listed.
 *                                Format:
 *                                `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                                Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 */
function list_artifacts_sample(string $formattedParent): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

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

        /** @var Artifact $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 = MetadataServiceClient::metadataStoreName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]'
    );

    list_artifacts_sample($formattedParent);
}

listContexts

Lists Contexts on the MetadataStore.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listContextsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListContextsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Context;
use Google\Cloud\AIPlatform\V1\ListContextsRequest;

/**
 * @param string $formattedParent The MetadataStore whose Contexts should be listed.
 *                                Format:
 *                                `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                                Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 */
function list_contexts_sample(string $formattedParent): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

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

        /** @var Context $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 = MetadataServiceClient::metadataStoreName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]'
    );

    list_contexts_sample($formattedParent);
}

listExecutions

Lists Executions in the MetadataStore.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listExecutionsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListExecutionsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Execution;
use Google\Cloud\AIPlatform\V1\ListExecutionsRequest;

/**
 * @param string $formattedParent The MetadataStore whose Executions should be listed.
 *                                Format:
 *                                `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                                Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 */
function list_executions_sample(string $formattedParent): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

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

        /** @var Execution $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 = MetadataServiceClient::metadataStoreName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]'
    );

    list_executions_sample($formattedParent);
}

listMetadataSchemas

Lists MetadataSchemas.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listMetadataSchemasAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListMetadataSchemasRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\ListMetadataSchemasRequest;
use Google\Cloud\AIPlatform\V1\MetadataSchema;

/**
 * @param string $formattedParent The MetadataStore whose MetadataSchemas should be listed.
 *                                Format:
 *                                `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                                Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 */
function list_metadata_schemas_sample(string $formattedParent): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

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

        /** @var MetadataSchema $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 = MetadataServiceClient::metadataStoreName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]'
    );

    list_metadata_schemas_sample($formattedParent);
}

listMetadataStores

Lists MetadataStores for a Location.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listMetadataStoresAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListMetadataStoresRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\ListMetadataStoresRequest;
use Google\Cloud\AIPlatform\V1\MetadataStore;

/**
 * @param string $formattedParent The Location whose MetadataStores should be listed.
 *                                Format:
 *                                `projects/{project}/locations/{location}`
 *                                Please see {@see MetadataServiceClient::locationName()} for help formatting this field.
 */
function list_metadata_stores_sample(string $formattedParent): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

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

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

    list_metadata_stores_sample($formattedParent);
}

purgeArtifacts

Purges Artifacts.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::purgeArtifactsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\PurgeArtifactsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\PurgeArtifactsRequest;
use Google\Cloud\AIPlatform\V1\PurgeArtifactsResponse;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The metadata store to purge Artifacts from.
 *                                Format:
 *                                `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                                Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 * @param string $filter          A required filter matching the Artifacts to be purged.
 *                                E.g., `update_time <= 2020-11-19T11:30:00-04:00`.
 */
function purge_artifacts_sample(string $formattedParent, string $filter): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

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

        if ($response->operationSucceeded()) {
            /** @var PurgeArtifactsResponse $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 = MetadataServiceClient::metadataStoreName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]'
    );
    $filter = '[FILTER]';

    purge_artifacts_sample($formattedParent, $filter);
}

purgeContexts

Purges Contexts.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::purgeContextsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\PurgeContextsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\PurgeContextsRequest;
use Google\Cloud\AIPlatform\V1\PurgeContextsResponse;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The metadata store to purge Contexts from.
 *                                Format:
 *                                `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                                Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 * @param string $filter          A required filter matching the Contexts to be purged.
 *                                E.g., `update_time <= 2020-11-19T11:30:00-04:00`.
 */
function purge_contexts_sample(string $formattedParent, string $filter): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

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

        if ($response->operationSucceeded()) {
            /** @var PurgeContextsResponse $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 = MetadataServiceClient::metadataStoreName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]'
    );
    $filter = '[FILTER]';

    purge_contexts_sample($formattedParent, $filter);
}

purgeExecutions

Purges Executions.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::purgeExecutionsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\PurgeExecutionsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\PurgeExecutionsRequest;
use Google\Cloud\AIPlatform\V1\PurgeExecutionsResponse;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The metadata store to purge Executions from.
 *                                Format:
 *                                `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
 *                                Please see {@see MetadataServiceClient::metadataStoreName()} for help formatting this field.
 * @param string $filter          A required filter matching the Executions to be purged.
 *                                E.g., `update_time <= 2020-11-19T11:30:00-04:00`.
 */
function purge_executions_sample(string $formattedParent, string $filter): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

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

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

        if ($response->operationSucceeded()) {
            /** @var PurgeExecutionsResponse $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 = MetadataServiceClient::metadataStoreName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]'
    );
    $filter = '[FILTER]';

    purge_executions_sample($formattedParent, $filter);
}

queryArtifactLineageSubgraph

Retrieves lineage of an Artifact represented through Artifacts and Executions connected by Event edges and returned as a LineageSubgraph.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::queryArtifactLineageSubgraphAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\QueryArtifactLineageSubgraphRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\LineageSubgraph
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\LineageSubgraph;
use Google\Cloud\AIPlatform\V1\QueryArtifactLineageSubgraphRequest;

/**
 * @param string $formattedArtifact The resource name of the Artifact whose Lineage needs to be
 *                                  retrieved as a LineageSubgraph. Format:
 *                                  `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`
 *
 *                                  The request may error with FAILED_PRECONDITION if the number of Artifacts,
 *                                  the number of Executions, or the number of Events that would be returned
 *                                  for the Context exceeds 1000. Please see
 *                                  {@see MetadataServiceClient::artifactName()} for help formatting this field.
 */
function query_artifact_lineage_subgraph_sample(string $formattedArtifact): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $request = (new QueryArtifactLineageSubgraphRequest())
        ->setArtifact($formattedArtifact);

    // Call the API and handle any network failures.
    try {
        /** @var LineageSubgraph $response */
        $response = $metadataServiceClient->queryArtifactLineageSubgraph($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
{
    $formattedArtifact = MetadataServiceClient::artifactName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[ARTIFACT]'
    );

    query_artifact_lineage_subgraph_sample($formattedArtifact);
}

queryContextLineageSubgraph

Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::queryContextLineageSubgraphAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\QueryContextLineageSubgraphRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\LineageSubgraph
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\LineageSubgraph;
use Google\Cloud\AIPlatform\V1\QueryContextLineageSubgraphRequest;

/**
 * @param string $formattedContext The resource name of the Context whose Artifacts and Executions
 *                                 should be retrieved as a LineageSubgraph.
 *                                 Format:
 *                                 `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
 *
 *                                 The request may error with FAILED_PRECONDITION if the number of Artifacts,
 *                                 the number of Executions, or the number of Events that would be returned
 *                                 for the Context exceeds 1000. Please see
 *                                 {@see MetadataServiceClient::contextName()} for help formatting this field.
 */
function query_context_lineage_subgraph_sample(string $formattedContext): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $request = (new QueryContextLineageSubgraphRequest())
        ->setContext($formattedContext);

    // Call the API and handle any network failures.
    try {
        /** @var LineageSubgraph $response */
        $response = $metadataServiceClient->queryContextLineageSubgraph($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
{
    $formattedContext = MetadataServiceClient::contextName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[CONTEXT]'
    );

    query_context_lineage_subgraph_sample($formattedContext);
}

queryExecutionInputsAndOutputs

Obtains the set of input and output Artifacts for this Execution, in the form of LineageSubgraph that also contains the Execution and connecting Events.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::queryExecutionInputsAndOutputsAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\QueryExecutionInputsAndOutputsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\LineageSubgraph
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\LineageSubgraph;
use Google\Cloud\AIPlatform\V1\QueryExecutionInputsAndOutputsRequest;

/**
 * @param string $formattedExecution The resource name of the Execution whose input and output
 *                                   Artifacts should be retrieved as a LineageSubgraph. Format:
 *                                   `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`
 *                                   Please see {@see MetadataServiceClient::executionName()} for help formatting this field.
 */
function query_execution_inputs_and_outputs_sample(string $formattedExecution): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $request = (new QueryExecutionInputsAndOutputsRequest())
        ->setExecution($formattedExecution);

    // Call the API and handle any network failures.
    try {
        /** @var LineageSubgraph $response */
        $response = $metadataServiceClient->queryExecutionInputsAndOutputs($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
{
    $formattedExecution = MetadataServiceClient::executionName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[EXECUTION]'
    );

    query_execution_inputs_and_outputs_sample($formattedExecution);
}

removeContextChildren

Remove a set of children contexts from a parent Context. If any of the child Contexts were NOT added to the parent Context, they are simply skipped.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::removeContextChildrenAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\RemoveContextChildrenRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\RemoveContextChildrenResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\RemoveContextChildrenRequest;
use Google\Cloud\AIPlatform\V1\RemoveContextChildrenResponse;

/**
 * @param string $formattedContext The resource name of the parent Context.
 *
 *                                 Format:
 *                                 `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
 *                                 Please see {@see MetadataServiceClient::contextName()} for help formatting this field.
 */
function remove_context_children_sample(string $formattedContext): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $request = (new RemoveContextChildrenRequest())
        ->setContext($formattedContext);

    // Call the API and handle any network failures.
    try {
        /** @var RemoveContextChildrenResponse $response */
        $response = $metadataServiceClient->removeContextChildren($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
{
    $formattedContext = MetadataServiceClient::contextName(
        '[PROJECT]',
        '[LOCATION]',
        '[METADATA_STORE]',
        '[CONTEXT]'
    );

    remove_context_children_sample($formattedContext);
}

updateArtifact

Updates a stored Artifact.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::updateArtifactAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\UpdateArtifactRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\Artifact
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Artifact;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\UpdateArtifactRequest;

/**
 * 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_artifact_sample(): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $artifact = new Artifact();
    $request = (new UpdateArtifactRequest())
        ->setArtifact($artifact);

    // Call the API and handle any network failures.
    try {
        /** @var Artifact $response */
        $response = $metadataServiceClient->updateArtifact($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateContext

Updates a stored Context.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::updateContextAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\UpdateContextRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\Context
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Context;
use Google\Cloud\AIPlatform\V1\UpdateContextRequest;

/**
 * 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_context_sample(): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $context = new Context();
    $request = (new UpdateContextRequest())
        ->setContext($context);

    // Call the API and handle any network failures.
    try {
        /** @var Context $response */
        $response = $metadataServiceClient->updateContext($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateExecution

Updates a stored Execution.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::updateExecutionAsync() .

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\UpdateExecutionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\Execution
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
use Google\Cloud\AIPlatform\V1\Execution;
use Google\Cloud\AIPlatform\V1\UpdateExecutionRequest;

/**
 * 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_execution_sample(): void
{
    // Create a client.
    $metadataServiceClient = new MetadataServiceClient();

    // Prepare the request message.
    $execution = new Execution();
    $request = (new UpdateExecutionRequest())
        ->setExecution($execution);

    // Call the API and handle any network failures.
    try {
        /** @var Execution $response */
        $response = $metadataServiceClient->updateExecution($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

getLocation

Gets information about a location.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getLocationAsync() .

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
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.
    $metadataServiceClient = new MetadataServiceClient();

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

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

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::listLocationsAsync() .

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
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.
    $metadataServiceClient = new MetadataServiceClient();

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

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

getIamPolicy

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

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::getIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\GetIamPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
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.
    $metadataServiceClient = new MetadataServiceClient();

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

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

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::setIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\SetIamPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
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.
    $metadataServiceClient = new MetadataServiceClient();

    // 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 = $metadataServiceClient->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.

The async variant is Google\Cloud\AIPlatform\V1\Client\BaseClient\self::testIamPermissionsAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\TestIamPermissionsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Iam\V1\TestIamPermissionsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\MetadataServiceClient;
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.
    $metadataServiceClient = new MetadataServiceClient();

    // 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 = $metadataServiceClient->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);
}

addContextArtifactsAndExecutionsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\AddContextArtifactsAndExecutionsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

addContextChildrenAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\AddContextChildrenRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

addExecutionEventsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\AddExecutionEventsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createArtifactAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateArtifactRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createContextAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateContextRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createExecutionAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateExecutionRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createMetadataSchemaAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateMetadataSchemaRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createMetadataStoreAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\CreateMetadataStoreRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteArtifactAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteArtifactRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteContextAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteContextRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteExecutionAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteExecutionRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteMetadataStoreAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\DeleteMetadataStoreRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getArtifactAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetArtifactRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getContextAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetContextRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getExecutionAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetExecutionRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getMetadataSchemaAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetMetadataSchemaRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getMetadataStoreAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\GetMetadataStoreRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listArtifactsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListArtifactsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listContextsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListContextsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listExecutionsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListExecutionsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listMetadataSchemasAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListMetadataSchemasRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listMetadataStoresAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\ListMetadataStoresRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

purgeArtifactsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\PurgeArtifactsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

purgeContextsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\PurgeContextsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

purgeExecutionsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\PurgeExecutionsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

queryArtifactLineageSubgraphAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\QueryArtifactLineageSubgraphRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

queryContextLineageSubgraphAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\QueryContextLineageSubgraphRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

queryExecutionInputsAndOutputsAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\QueryExecutionInputsAndOutputsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

removeContextChildrenAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\RemoveContextChildrenRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateArtifactAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\UpdateArtifactRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateContextAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\UpdateContextRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateExecutionAsync

Parameters
NameDescription
request Google\Cloud\AIPlatform\V1\UpdateExecutionRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getLocationAsync

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listLocationsAsync

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getIamPolicyAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\GetIamPolicyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setIamPolicyAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\SetIamPolicyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

testIamPermissionsAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\TestIamPermissionsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

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::artifactName

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

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

static::contextName

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

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

static::executionName

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

Parameters
NameDescription
project string
location string
metadataStore string
execution string
Returns
TypeDescription
stringThe formatted execution 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::metadataSchemaName

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

Parameters
NameDescription
project string
location string
metadataStore string
metadataSchema string
Returns
TypeDescription
stringThe formatted metadata_schema resource.

static::metadataStoreName

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

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

  • artifact: projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}
  • context: projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}
  • execution: projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}
  • location: projects/{project}/locations/{location}
  • metadataSchema: projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}
  • metadataStore: projects/{project}/locations/{location}/metadataStores/{metadata_store}

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.