Google Cloud Dataform V1beta1 Client - Class DataformClient (0.4.6)

Reference documentation and code samples for the Google Cloud Dataform V1beta1 Client class DataformClient.

Service Description: Dataform is a service to develop, create, document, test, and update curated tables in BigQuery.

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

$dataformClient = new DataformClient();
try {
    $formattedName = $dataformClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]');
    $dataformClient->cancelWorkflowInvocation($formattedName);
} finally {
    $dataformClient->close();
}

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.

Namespace

Google \ Cloud \ Dataform \ V1beta1

Methods

__construct

Constructor.

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

cancelWorkflowInvocation

Requests cancellation of a running WorkflowInvocation.

Parameters
Name Description
name string

Required. The workflow invocation resource's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\CancelWorkflowInvocationRequest;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;

/**
 * @param string $formattedName The workflow invocation resource's name. Please see
 *                              {@see DataformClient::workflowInvocationName()} for help formatting this field.
 */
function cancel_workflow_invocation_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        $dataformClient->cancelWorkflowInvocation($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    cancel_workflow_invocation_sample($formattedName);
}

commitRepositoryChanges

Applies a Git commit to a Repository. The Repository must not have a value for git_remote_settings.url.

Parameters
Name Description
name string

Required. The repository's name.

commitMetadata Google\Cloud\Dataform\V1beta1\CommitMetadata

Required. The changes to commit to the repository.

optionalArgs array

Optional.

↳ requiredHeadCommitSha string

Optional. The commit SHA which must be the repository's current HEAD before applying this commit; otherwise this request will fail. If unset, no validation on the current HEAD commit SHA is performed.

↳ fileOperations array

A map to the path of the file to the operation. The path is the full file path including filename, from repository root.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CommitAuthor;
use Google\Cloud\Dataform\V1beta1\CommitMetadata;
use Google\Cloud\Dataform\V1beta1\CommitRepositoryChangesRequest;

/**
 * @param string $formattedName                    The repository's name. Please see
 *                                                 {@see DataformClient::repositoryName()} for help formatting this field.
 * @param string $commitMetadataAuthorName         The commit author's name.
 * @param string $commitMetadataAuthorEmailAddress The commit author's email address.
 */
function commit_repository_changes_sample(
    string $formattedName,
    string $commitMetadataAuthorName,
    string $commitMetadataAuthorEmailAddress
): void {
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $commitMetadataAuthor = (new CommitAuthor())
        ->setName($commitMetadataAuthorName)
        ->setEmailAddress($commitMetadataAuthorEmailAddress);
    $commitMetadata = (new CommitMetadata())
        ->setAuthor($commitMetadataAuthor);
    $request = (new CommitRepositoryChangesRequest())
        ->setName($formattedName)
        ->setCommitMetadata($commitMetadata);

    // Call the API and handle any network failures.
    try {
        $dataformClient->commitRepositoryChanges($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    commit_repository_changes_sample(
        $formattedName,
        $commitMetadataAuthorName,
        $commitMetadataAuthorEmailAddress
    );
}

commitWorkspaceChanges

Applies a Git commit for uncommitted files in a Workspace.

Parameters
Name Description
name string

Required. The workspace's name.

author Google\Cloud\Dataform\V1beta1\CommitAuthor

Required. The commit's author.

optionalArgs array

Optional.

↳ commitMessage string

Optional. The commit's message.

↳ paths string[]

Optional. Full file paths to commit including filename, rooted at workspace root. If left empty, all files will be committed.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CommitAuthor;
use Google\Cloud\Dataform\V1beta1\CommitWorkspaceChangesRequest;

/**
 * @param string $formattedName      The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 * @param string $authorName         The commit author's name.
 * @param string $authorEmailAddress The commit author's email address.
 */
function commit_workspace_changes_sample(
    string $formattedName,
    string $authorName,
    string $authorEmailAddress
): void {
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $author = (new CommitAuthor())
        ->setName($authorName)
        ->setEmailAddress($authorEmailAddress);
    $request = (new CommitWorkspaceChangesRequest())
        ->setName($formattedName)
        ->setAuthor($author);

    // Call the API and handle any network failures.
    try {
        $dataformClient->commitWorkspaceChanges($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    commit_workspace_changes_sample($formattedName, $authorName, $authorEmailAddress);
}

computeRepositoryAccessTokenStatus

Computes a Repository's Git access token status.

Parameters
Name Description
name string

Required. The repository's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\ComputeRepositoryAccessTokenStatusResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\ComputeRepositoryAccessTokenStatusRequest;
use Google\Cloud\Dataform\V1beta1\ComputeRepositoryAccessTokenStatusResponse;

/**
 * @param string $formattedName The repository's name. Please see
 *                              {@see DataformClient::repositoryName()} for help formatting this field.
 */
function compute_repository_access_token_status_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var ComputeRepositoryAccessTokenStatusResponse $response */
        $response = $dataformClient->computeRepositoryAccessTokenStatus($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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    compute_repository_access_token_status_sample($formattedName);
}

createCompilationResult

Creates a new CompilationResult in a given project and location.

Parameters
Name Description
parent string

Required. The repository in which to create the compilation result. Must be in the format projects/*/locations/*/repositories/*.

compilationResult Google\Cloud\Dataform\V1beta1\CompilationResult

Required. The compilation result to create.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\CompilationResult
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CompilationResult;
use Google\Cloud\Dataform\V1beta1\CreateCompilationResultRequest;

/**
 * @param string $formattedParent The repository in which to create the compilation result. Must be
 *                                in the format `projects/*/locations/*/repositories/*`. Please see
 *                                {@see DataformClient::repositoryName()} for help formatting this field.
 */
function create_compilation_result_sample(string $formattedParent): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $compilationResult = new CompilationResult();
    $request = (new CreateCompilationResultRequest())
        ->setParent($formattedParent)
        ->setCompilationResult($compilationResult);

    // Call the API and handle any network failures.
    try {
        /** @var CompilationResult $response */
        $response = $dataformClient->createCompilationResult($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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    create_compilation_result_sample($formattedParent);
}

createReleaseConfig

Creates a new ReleaseConfig in a given Repository.

Parameters
Name Description
parent string

Required. The repository in which to create the release config. Must be in the format projects/*/locations/*/repositories/*.

releaseConfig Google\Cloud\Dataform\V1beta1\ReleaseConfig

Required. The release config to create.

releaseConfigId string

Required. The ID to use for the release config, which will become the final component of the release config's resource name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\ReleaseConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CreateReleaseConfigRequest;
use Google\Cloud\Dataform\V1beta1\ReleaseConfig;

/**
 * @param string $formattedParent           The repository in which to create the release config. Must be in
 *                                          the format `projects/*/locations/*/repositories/*`. Please see
 *                                          {@see DataformClient::repositoryName()} for help formatting this field.
 * @param string $releaseConfigGitCommitish Git commit/tag/branch name at which the repository should be
 *                                          compiled. Must exist in the remote repository. Examples:
 *                                          - a commit SHA: `12ade345`
 *                                          - a tag: `tag1`
 *                                          - a branch name: `branch1`
 * @param string $releaseConfigId           The ID to use for the release config, which will become the final
 *                                          component of the release config's resource name.
 */
function create_release_config_sample(
    string $formattedParent,
    string $releaseConfigGitCommitish,
    string $releaseConfigId
): void {
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $releaseConfig = (new ReleaseConfig())
        ->setGitCommitish($releaseConfigGitCommitish);
    $request = (new CreateReleaseConfigRequest())
        ->setParent($formattedParent)
        ->setReleaseConfig($releaseConfig)
        ->setReleaseConfigId($releaseConfigId);

    // Call the API and handle any network failures.
    try {
        /** @var ReleaseConfig $response */
        $response = $dataformClient->createReleaseConfig($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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');
    $releaseConfigGitCommitish = '[GIT_COMMITISH]';
    $releaseConfigId = '[RELEASE_CONFIG_ID]';

    create_release_config_sample($formattedParent, $releaseConfigGitCommitish, $releaseConfigId);
}

createRepository

Creates a new Repository in a given project and location.

Parameters
Name Description
parent string

Required. The location in which to create the repository. Must be in the format projects/*/locations/*.

repository Google\Cloud\Dataform\V1beta1\Repository

Required. The repository to create.

repositoryId string

Required. The ID to use for the repository, which will become the final component of the repository's resource name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\Repository
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CreateRepositoryRequest;
use Google\Cloud\Dataform\V1beta1\Repository;

/**
 * @param string $formattedParent The location in which to create the repository. Must be in the
 *                                format `projects/*/locations/*`. Please see
 *                                {@see DataformClient::locationName()} for help formatting this field.
 * @param string $repositoryId    The ID to use for the repository, which will become the final
 *                                component of the repository's resource name.
 */
function create_repository_sample(string $formattedParent, string $repositoryId): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $repository = new Repository();
    $request = (new CreateRepositoryRequest())
        ->setParent($formattedParent)
        ->setRepository($repository)
        ->setRepositoryId($repositoryId);

    // Call the API and handle any network failures.
    try {
        /** @var Repository $response */
        $response = $dataformClient->createRepository($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 = DataformClient::locationName('[PROJECT]', '[LOCATION]');
    $repositoryId = '[REPOSITORY_ID]';

    create_repository_sample($formattedParent, $repositoryId);
}

createWorkflowConfig

Creates a new WorkflowConfig in a given Repository.

Parameters
Name Description
parent string

Required. The repository in which to create the workflow config. Must be in the format projects/*/locations/*/repositories/*.

workflowConfig Google\Cloud\Dataform\V1beta1\WorkflowConfig

Required. The workflow config to create.

workflowConfigId string

Required. The ID to use for the workflow config, which will become the final component of the workflow config's resource name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\WorkflowConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CreateWorkflowConfigRequest;
use Google\Cloud\Dataform\V1beta1\WorkflowConfig;

/**
 * @param string $formattedParent                      The repository in which to create the workflow config. Must be in
 *                                                     the format `projects/*/locations/*/repositories/*`. Please see
 *                                                     {@see DataformClient::repositoryName()} for help formatting this field.
 * @param string $formattedWorkflowConfigReleaseConfig The name of the release config whose release_compilation_result
 *                                                     should be executed. Must be in the format
 *                                                     `projects/*/locations/*/repositories/*/releaseConfigs/*`. Please see
 *                                                     {@see DataformClient::releaseConfigName()} for help formatting this field.
 * @param string $workflowConfigId                     The ID to use for the workflow config, which will become the
 *                                                     final component of the workflow config's resource name.
 */
function create_workflow_config_sample(
    string $formattedParent,
    string $formattedWorkflowConfigReleaseConfig,
    string $workflowConfigId
): void {
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $workflowConfig = (new WorkflowConfig())
        ->setReleaseConfig($formattedWorkflowConfigReleaseConfig);
    $request = (new CreateWorkflowConfigRequest())
        ->setParent($formattedParent)
        ->setWorkflowConfig($workflowConfig)
        ->setWorkflowConfigId($workflowConfigId);

    // Call the API and handle any network failures.
    try {
        /** @var WorkflowConfig $response */
        $response = $dataformClient->createWorkflowConfig($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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');
    $formattedWorkflowConfigReleaseConfig = DataformClient::releaseConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[RELEASE_CONFIG]'
    );
    $workflowConfigId = '[WORKFLOW_CONFIG_ID]';

    create_workflow_config_sample(
        $formattedParent,
        $formattedWorkflowConfigReleaseConfig,
        $workflowConfigId
    );
}

createWorkflowInvocation

Creates a new WorkflowInvocation in a given Repository.

Parameters
Name Description
parent string

Required. The repository in which to create the workflow invocation. Must be in the format projects/*/locations/*/repositories/*.

workflowInvocation Google\Cloud\Dataform\V1beta1\WorkflowInvocation

Required. The workflow invocation resource to create.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\WorkflowInvocation
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CreateWorkflowInvocationRequest;
use Google\Cloud\Dataform\V1beta1\WorkflowInvocation;

/**
 * @param string $formattedParent The repository in which to create the workflow invocation. Must
 *                                be in the format `projects/*/locations/*/repositories/*`. Please see
 *                                {@see DataformClient::repositoryName()} for help formatting this field.
 */
function create_workflow_invocation_sample(string $formattedParent): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $workflowInvocation = new WorkflowInvocation();
    $request = (new CreateWorkflowInvocationRequest())
        ->setParent($formattedParent)
        ->setWorkflowInvocation($workflowInvocation);

    // Call the API and handle any network failures.
    try {
        /** @var WorkflowInvocation $response */
        $response = $dataformClient->createWorkflowInvocation($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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    create_workflow_invocation_sample($formattedParent);
}

createWorkspace

Creates a new Workspace in a given Repository.

Parameters
Name Description
parent string

Required. The repository in which to create the workspace. Must be in the format projects/*/locations/*/repositories/*.

workspace Google\Cloud\Dataform\V1beta1\Workspace

Required. The workspace to create.

workspaceId string

Required. The ID to use for the workspace, which will become the final component of the workspace's resource name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\Workspace
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CreateWorkspaceRequest;
use Google\Cloud\Dataform\V1beta1\Workspace;

/**
 * @param string $formattedParent The repository in which to create the workspace. Must be in the
 *                                format `projects/*/locations/*/repositories/*`. Please see
 *                                {@see DataformClient::repositoryName()} for help formatting this field.
 * @param string $workspaceId     The ID to use for the workspace, which will become the final
 *                                component of the workspace's resource name.
 */
function create_workspace_sample(string $formattedParent, string $workspaceId): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $workspace = new Workspace();
    $request = (new CreateWorkspaceRequest())
        ->setParent($formattedParent)
        ->setWorkspace($workspace)
        ->setWorkspaceId($workspaceId);

    // Call the API and handle any network failures.
    try {
        /** @var Workspace $response */
        $response = $dataformClient->createWorkspace($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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');
    $workspaceId = '[WORKSPACE_ID]';

    create_workspace_sample($formattedParent, $workspaceId);
}

deleteReleaseConfig

Deletes a single ReleaseConfig.

Parameters
Name Description
name string

Required. The release config's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\DeleteReleaseConfigRequest;

/**
 * @param string $formattedName The release config's name. Please see
 *                              {@see DataformClient::releaseConfigName()} for help formatting this field.
 */
function delete_release_config_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        $dataformClient->deleteReleaseConfig($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    delete_release_config_sample($formattedName);
}

deleteRepository

Deletes a single Repository.

Parameters
Name Description
name string

Required. The repository's name.

optionalArgs array

Optional.

↳ force bool

If set to true, any child resources of this repository will also be deleted. (Otherwise, the request will only succeed if the repository has no child resources.)

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\DeleteRepositoryRequest;

/**
 * @param string $formattedName The repository's name. Please see
 *                              {@see DataformClient::repositoryName()} for help formatting this field.
 */
function delete_repository_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        $dataformClient->deleteRepository($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    delete_repository_sample($formattedName);
}

deleteWorkflowConfig

Deletes a single WorkflowConfig.

Parameters
Name Description
name string

Required. The workflow config's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\DeleteWorkflowConfigRequest;

/**
 * @param string $formattedName The workflow config's name. Please see
 *                              {@see DataformClient::workflowConfigName()} for help formatting this field.
 */
function delete_workflow_config_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        $dataformClient->deleteWorkflowConfig($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    delete_workflow_config_sample($formattedName);
}

deleteWorkflowInvocation

Deletes a single WorkflowInvocation.

Parameters
Name Description
name string

Required. The workflow invocation resource's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\DeleteWorkflowInvocationRequest;

/**
 * @param string $formattedName The workflow invocation resource's name. Please see
 *                              {@see DataformClient::workflowInvocationName()} for help formatting this field.
 */
function delete_workflow_invocation_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        $dataformClient->deleteWorkflowInvocation($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    delete_workflow_invocation_sample($formattedName);
}

deleteWorkspace

Deletes a single Workspace.

Parameters
Name Description
name string

Required. The workspace resource's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\DeleteWorkspaceRequest;

/**
 * @param string $formattedName The workspace resource's name. Please see
 *                              {@see DataformClient::workspaceName()} for help formatting this field.
 */
function delete_workspace_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        $dataformClient->deleteWorkspace($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    delete_workspace_sample($formattedName);
}

fetchFileDiff

Fetches Git diff for an uncommitted file in a Workspace.

Parameters
Name Description
workspace string

Required. The workspace's name.

path string

Required. The file's full path including filename, relative to the workspace root.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\FetchFileDiffResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\FetchFileDiffRequest;
use Google\Cloud\Dataform\V1beta1\FetchFileDiffResponse;

/**
 * @param string $formattedWorkspace The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 * @param string $path               The file's full path including filename, relative to the
 *                                   workspace root.
 */
function fetch_file_diff_sample(string $formattedWorkspace, string $path): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $request = (new FetchFileDiffRequest())
        ->setWorkspace($formattedWorkspace)
        ->setPath($path);

    // Call the API and handle any network failures.
    try {
        /** @var FetchFileDiffResponse $response */
        $response = $dataformClient->fetchFileDiff($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
{
    $formattedWorkspace = DataformClient::workspaceName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKSPACE]'
    );
    $path = '[PATH]';

    fetch_file_diff_sample($formattedWorkspace, $path);
}

fetchFileGitStatuses

Fetches Git statuses for the files in a Workspace.

Parameters
Name Description
name string

Required. The workspace's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\FetchFileGitStatusesResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\FetchFileGitStatusesRequest;
use Google\Cloud\Dataform\V1beta1\FetchFileGitStatusesResponse;

/**
 * @param string $formattedName The workspace's name. Please see
 *                              {@see DataformClient::workspaceName()} for help formatting this field.
 */
function fetch_file_git_statuses_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var FetchFileGitStatusesResponse $response */
        $response = $dataformClient->fetchFileGitStatuses($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 = DataformClient::workspaceName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKSPACE]'
    );

    fetch_file_git_statuses_sample($formattedName);
}

fetchGitAheadBehind

Fetches Git ahead/behind against a remote branch.

Parameters
Name Description
name string

Required. The workspace's name.

optionalArgs array

Optional.

↳ remoteBranch string

Optional. The name of the branch in the Git remote against which this workspace should be compared. If left unset, the repository's default branch name will be used.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\FetchGitAheadBehindResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\FetchGitAheadBehindRequest;
use Google\Cloud\Dataform\V1beta1\FetchGitAheadBehindResponse;

/**
 * @param string $formattedName The workspace's name. Please see
 *                              {@see DataformClient::workspaceName()} for help formatting this field.
 */
function fetch_git_ahead_behind_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var FetchGitAheadBehindResponse $response */
        $response = $dataformClient->fetchGitAheadBehind($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 = DataformClient::workspaceName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKSPACE]'
    );

    fetch_git_ahead_behind_sample($formattedName);
}

fetchRemoteBranches

Fetches a Repository's remote branches.

Parameters
Name Description
name string

Required. The repository's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\FetchRemoteBranchesResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\FetchRemoteBranchesRequest;
use Google\Cloud\Dataform\V1beta1\FetchRemoteBranchesResponse;

/**
 * @param string $formattedName The repository's name. Please see
 *                              {@see DataformClient::repositoryName()} for help formatting this field.
 */
function fetch_remote_branches_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var FetchRemoteBranchesResponse $response */
        $response = $dataformClient->fetchRemoteBranches($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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    fetch_remote_branches_sample($formattedName);
}

fetchRepositoryHistory

Fetches a Repository's history of commits. The Repository must not have a value for git_remote_settings.url.

Parameters
Name Description
name string

Required. The repository's name.

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CommitLogEntry;
use Google\Cloud\Dataform\V1beta1\FetchRepositoryHistoryRequest;

/**
 * @param string $formattedName The repository's name. Please see
 *                              {@see DataformClient::repositoryName()} for help formatting this field.
 */
function fetch_repository_history_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

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

        /** @var CommitLogEntry $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
{
    $formattedName = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    fetch_repository_history_sample($formattedName);
}

getCompilationResult

Fetches a single CompilationResult.

Parameters
Name Description
name string

Required. The compilation result's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\CompilationResult
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CompilationResult;
use Google\Cloud\Dataform\V1beta1\GetCompilationResultRequest;

/**
 * @param string $formattedName The compilation result's name. Please see
 *                              {@see DataformClient::compilationResultName()} for help formatting this field.
 */
function get_compilation_result_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var CompilationResult $response */
        $response = $dataformClient->getCompilationResult($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 = DataformClient::compilationResultName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[COMPILATION_RESULT]'
    );

    get_compilation_result_sample($formattedName);
}

getReleaseConfig

Fetches a single ReleaseConfig.

Parameters
Name Description
name string

Required. The release config's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\ReleaseConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\GetReleaseConfigRequest;
use Google\Cloud\Dataform\V1beta1\ReleaseConfig;

/**
 * @param string $formattedName The release config's name. Please see
 *                              {@see DataformClient::releaseConfigName()} for help formatting this field.
 */
function get_release_config_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var ReleaseConfig $response */
        $response = $dataformClient->getReleaseConfig($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 = DataformClient::releaseConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[RELEASE_CONFIG]'
    );

    get_release_config_sample($formattedName);
}

getRepository

Fetches a single Repository.

Parameters
Name Description
name string

Required. The repository's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\Repository
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\GetRepositoryRequest;
use Google\Cloud\Dataform\V1beta1\Repository;

/**
 * @param string $formattedName The repository's name. Please see
 *                              {@see DataformClient::repositoryName()} for help formatting this field.
 */
function get_repository_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Repository $response */
        $response = $dataformClient->getRepository($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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    get_repository_sample($formattedName);
}

getWorkflowConfig

Fetches a single WorkflowConfig.

Parameters
Name Description
name string

Required. The workflow config's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\WorkflowConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\GetWorkflowConfigRequest;
use Google\Cloud\Dataform\V1beta1\WorkflowConfig;

/**
 * @param string $formattedName The workflow config's name. Please see
 *                              {@see DataformClient::workflowConfigName()} for help formatting this field.
 */
function get_workflow_config_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var WorkflowConfig $response */
        $response = $dataformClient->getWorkflowConfig($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 = DataformClient::workflowConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKFLOW_CONFIG]'
    );

    get_workflow_config_sample($formattedName);
}

getWorkflowInvocation

Fetches a single WorkflowInvocation.

Parameters
Name Description
name string

Required. The workflow invocation resource's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\WorkflowInvocation
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\GetWorkflowInvocationRequest;
use Google\Cloud\Dataform\V1beta1\WorkflowInvocation;

/**
 * @param string $formattedName The workflow invocation resource's name. Please see
 *                              {@see DataformClient::workflowInvocationName()} for help formatting this field.
 */
function get_workflow_invocation_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var WorkflowInvocation $response */
        $response = $dataformClient->getWorkflowInvocation($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 = DataformClient::workflowInvocationName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKFLOW_INVOCATION]'
    );

    get_workflow_invocation_sample($formattedName);
}

getWorkspace

Fetches a single Workspace.

Parameters
Name Description
name string

Required. The workspace's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\Workspace
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\GetWorkspaceRequest;
use Google\Cloud\Dataform\V1beta1\Workspace;

/**
 * @param string $formattedName The workspace's name. Please see
 *                              {@see DataformClient::workspaceName()} for help formatting this field.
 */
function get_workspace_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Workspace $response */
        $response = $dataformClient->getWorkspace($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 = DataformClient::workspaceName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKSPACE]'
    );

    get_workspace_sample($formattedName);
}

installNpmPackages

Installs dependency NPM packages (inside a Workspace).

Parameters
Name Description
workspace string

Required. The workspace's name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\InstallNpmPackagesResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\InstallNpmPackagesRequest;
use Google\Cloud\Dataform\V1beta1\InstallNpmPackagesResponse;

/**
 * @param string $formattedWorkspace The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 */
function install_npm_packages_sample(string $formattedWorkspace): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $request = (new InstallNpmPackagesRequest())
        ->setWorkspace($formattedWorkspace);

    // Call the API and handle any network failures.
    try {
        /** @var InstallNpmPackagesResponse $response */
        $response = $dataformClient->installNpmPackages($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
{
    $formattedWorkspace = DataformClient::workspaceName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKSPACE]'
    );

    install_npm_packages_sample($formattedWorkspace);
}

listCompilationResults

Lists CompilationResults in a given Repository.

Parameters
Name Description
parent string

Required. The repository in which to list compilation results. Must be in the format projects/*/locations/*/repositories/*.

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CompilationResult;
use Google\Cloud\Dataform\V1beta1\ListCompilationResultsRequest;

/**
 * @param string $formattedParent The repository in which to list compilation results. Must be in
 *                                the format `projects/*/locations/*/repositories/*`. Please see
 *                                {@see DataformClient::repositoryName()} for help formatting this field.
 */
function list_compilation_results_sample(string $formattedParent): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

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

        /** @var CompilationResult $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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    list_compilation_results_sample($formattedParent);
}

listReleaseConfigs

Lists ReleaseConfigs in a given Repository.

Parameters
Name Description
parent string

Required. The repository in which to list release configs. Must be in the format projects/*/locations/*/repositories/*.

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\ListReleaseConfigsRequest;
use Google\Cloud\Dataform\V1beta1\ReleaseConfig;

/**
 * @param string $formattedParent The repository in which to list release configs. Must be in the
 *                                format `projects/*/locations/*/repositories/*`. Please see
 *                                {@see DataformClient::repositoryName()} for help formatting this field.
 */
function list_release_configs_sample(string $formattedParent): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

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

        /** @var ReleaseConfig $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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    list_release_configs_sample($formattedParent);
}

listRepositories

Lists Repositories in a given project and location.

Parameters
Name Description
parent string

Required. The location in which to list repositories. Must be in the format projects/*/locations/*.

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ orderBy string

Optional. This field only supports ordering by name. If unspecified, the server will choose the ordering. If specified, the default order is ascending for the name field.

↳ filter string

Optional. Filter for the returned list.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\ListRepositoriesRequest;
use Google\Cloud\Dataform\V1beta1\Repository;

/**
 * @param string $formattedParent The location in which to list repositories. Must be in the format
 *                                `projects/*/locations/*`. Please see
 *                                {@see DataformClient::locationName()} for help formatting this field.
 */
function list_repositories_sample(string $formattedParent): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

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

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

    list_repositories_sample($formattedParent);
}

listWorkflowConfigs

Lists WorkflowConfigs in a given Repository.

Parameters
Name Description
parent string

Required. The repository in which to list workflow configs. Must be in the format projects/*/locations/*/repositories/*.

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\ListWorkflowConfigsRequest;
use Google\Cloud\Dataform\V1beta1\WorkflowConfig;

/**
 * @param string $formattedParent The repository in which to list workflow configs. Must be in the
 *                                format `projects/*/locations/*/repositories/*`. Please see
 *                                {@see DataformClient::repositoryName()} for help formatting this field.
 */
function list_workflow_configs_sample(string $formattedParent): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

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

        /** @var WorkflowConfig $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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    list_workflow_configs_sample($formattedParent);
}

listWorkflowInvocations

Lists WorkflowInvocations in a given Repository.

Parameters
Name Description
parent string

Required. The parent resource of the WorkflowInvocation type. Must be in the format projects/*/locations/*/repositories/*.

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ orderBy string

Optional. This field only supports ordering by name. If unspecified, the server will choose the ordering. If specified, the default order is ascending for the name field.

↳ filter string

Optional. Filter for the returned list.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\ListWorkflowInvocationsRequest;
use Google\Cloud\Dataform\V1beta1\WorkflowInvocation;

/**
 * @param string $formattedParent The parent resource of the WorkflowInvocation type. Must be in
 *                                the format `projects/*/locations/*/repositories/*`. Please see
 *                                {@see DataformClient::repositoryName()} for help formatting this field.
 */
function list_workflow_invocations_sample(string $formattedParent): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

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

        /** @var WorkflowInvocation $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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    list_workflow_invocations_sample($formattedParent);
}

listWorkspaces

Lists Workspaces in a given Repository.

Parameters
Name Description
parent string

Required. The repository in which to list workspaces. Must be in the format projects/*/locations/*/repositories/*.

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ orderBy string

Optional. This field only supports ordering by name. If unspecified, the server will choose the ordering. If specified, the default order is ascending for the name field.

↳ filter string

Optional. Filter for the returned list.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\ListWorkspacesRequest;
use Google\Cloud\Dataform\V1beta1\Workspace;

/**
 * @param string $formattedParent The repository in which to list workspaces. Must be in the
 *                                format `projects/*/locations/*/repositories/*`. Please see
 *                                {@see DataformClient::repositoryName()} for help formatting this field.
 */
function list_workspaces_sample(string $formattedParent): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

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

        /** @var Workspace $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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    list_workspaces_sample($formattedParent);
}

makeDirectory

Creates a directory inside a Workspace.

Parameters
Name Description
workspace string

Required. The workspace's name.

path string

Required. The directory's full path including directory name, relative to the workspace root.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\MakeDirectoryResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\MakeDirectoryRequest;
use Google\Cloud\Dataform\V1beta1\MakeDirectoryResponse;

/**
 * @param string $formattedWorkspace The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 * @param string $path               The directory's full path including directory name, relative to
 *                                   the workspace root.
 */
function make_directory_sample(string $formattedWorkspace, string $path): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $request = (new MakeDirectoryRequest())
        ->setWorkspace($formattedWorkspace)
        ->setPath($path);

    // Call the API and handle any network failures.
    try {
        /** @var MakeDirectoryResponse $response */
        $response = $dataformClient->makeDirectory($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
{
    $formattedWorkspace = DataformClient::workspaceName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKSPACE]'
    );
    $path = '[PATH]';

    make_directory_sample($formattedWorkspace, $path);
}

moveDirectory

Moves a directory (inside a Workspace), and all of its contents, to a new location.

Parameters
Name Description
workspace string

Required. The workspace's name.

path string

Required. The directory's full path including directory name, relative to the workspace root.

newPath string

Required. The new path for the directory including directory name, rooted at workspace root.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\MoveDirectoryResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\MoveDirectoryRequest;
use Google\Cloud\Dataform\V1beta1\MoveDirectoryResponse;

/**
 * @param string $formattedWorkspace The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 * @param string $path               The directory's full path including directory name, relative to
 *                                   the workspace root.
 * @param string $newPath            The new path for the directory including directory name, rooted
 *                                   at workspace root.
 */
function move_directory_sample(string $formattedWorkspace, string $path, string $newPath): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $request = (new MoveDirectoryRequest())
        ->setWorkspace($formattedWorkspace)
        ->setPath($path)
        ->setNewPath($newPath);

    // Call the API and handle any network failures.
    try {
        /** @var MoveDirectoryResponse $response */
        $response = $dataformClient->moveDirectory($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
{
    $formattedWorkspace = DataformClient::workspaceName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKSPACE]'
    );
    $path = '[PATH]';
    $newPath = '[NEW_PATH]';

    move_directory_sample($formattedWorkspace, $path, $newPath);
}

moveFile

Moves a file (inside a Workspace) to a new location.

Parameters
Name Description
workspace string

Required. The workspace's name.

path string

Required. The file's full path including filename, relative to the workspace root.

newPath string

Required. The file's new path including filename, relative to the workspace root.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\MoveFileResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\MoveFileRequest;
use Google\Cloud\Dataform\V1beta1\MoveFileResponse;

/**
 * @param string $formattedWorkspace The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 * @param string $path               The file's full path including filename, relative to the
 *                                   workspace root.
 * @param string $newPath            The file's new path including filename, relative to the workspace
 *                                   root.
 */
function move_file_sample(string $formattedWorkspace, string $path, string $newPath): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $request = (new MoveFileRequest())
        ->setWorkspace($formattedWorkspace)
        ->setPath($path)
        ->setNewPath($newPath);

    // Call the API and handle any network failures.
    try {
        /** @var MoveFileResponse $response */
        $response = $dataformClient->moveFile($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
{
    $formattedWorkspace = DataformClient::workspaceName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKSPACE]'
    );
    $path = '[PATH]';
    $newPath = '[NEW_PATH]';

    move_file_sample($formattedWorkspace, $path, $newPath);
}

pullGitCommits

Pulls Git commits from the Repository's remote into a Workspace.

Parameters
Name Description
name string

Required. The workspace's name.

author Google\Cloud\Dataform\V1beta1\CommitAuthor

Required. The author of any merge commit which may be created as a result of merging fetched Git commits into this workspace.

optionalArgs array

Optional.

↳ remoteBranch string

Optional. The name of the branch in the Git remote from which to pull commits. If left unset, the repository's default branch name will be used.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CommitAuthor;
use Google\Cloud\Dataform\V1beta1\PullGitCommitsRequest;

/**
 * @param string $formattedName      The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 * @param string $authorName         The commit author's name.
 * @param string $authorEmailAddress The commit author's email address.
 */
function pull_git_commits_sample(
    string $formattedName,
    string $authorName,
    string $authorEmailAddress
): void {
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $author = (new CommitAuthor())
        ->setName($authorName)
        ->setEmailAddress($authorEmailAddress);
    $request = (new PullGitCommitsRequest())
        ->setName($formattedName)
        ->setAuthor($author);

    // Call the API and handle any network failures.
    try {
        $dataformClient->pullGitCommits($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    pull_git_commits_sample($formattedName, $authorName, $authorEmailAddress);
}

pushGitCommits

Pushes Git commits from a Workspace to the Repository's remote.

Parameters
Name Description
name string

Required. The workspace's name.

optionalArgs array

Optional.

↳ remoteBranch string

Optional. The name of the branch in the Git remote to which commits should be pushed. If left unset, the repository's default branch name will be used.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\PushGitCommitsRequest;

/**
 * @param string $formattedName The workspace's name. Please see
 *                              {@see DataformClient::workspaceName()} for help formatting this field.
 */
function push_git_commits_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        $dataformClient->pushGitCommits($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    push_git_commits_sample($formattedName);
}

queryCompilationResultActions

Returns CompilationResultActions in a given CompilationResult.

Parameters
Name Description
name string

Required. The compilation result's name.

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ filter string

Optional. Optional filter for the returned list. Filtering is only currently supported on the file_path field.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\CompilationResultAction;
use Google\Cloud\Dataform\V1beta1\QueryCompilationResultActionsRequest;

/**
 * @param string $formattedName The compilation result's name. Please see
 *                              {@see DataformClient::compilationResultName()} for help formatting this field.
 */
function query_compilation_result_actions_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

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

        /** @var CompilationResultAction $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
{
    $formattedName = DataformClient::compilationResultName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[COMPILATION_RESULT]'
    );

    query_compilation_result_actions_sample($formattedName);
}

queryDirectoryContents

Returns the contents of a given Workspace directory.

Parameters
Name Description
workspace string

Required. The workspace's name.

optionalArgs array

Optional.

↳ path string

Optional. The directory's full path including directory name, relative to the workspace root. If left unset, the workspace root is used.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\DirectoryEntry;
use Google\Cloud\Dataform\V1beta1\QueryDirectoryContentsRequest;

/**
 * @param string $formattedWorkspace The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 */
function query_directory_contents_sample(string $formattedWorkspace): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $request = (new QueryDirectoryContentsRequest())
        ->setWorkspace($formattedWorkspace);

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

        /** @var DirectoryEntry $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
{
    $formattedWorkspace = DataformClient::workspaceName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKSPACE]'
    );

    query_directory_contents_sample($formattedWorkspace);
}

queryRepositoryDirectoryContents

Returns the contents of a given Repository directory. The Repository must not have a value for git_remote_settings.url.

Parameters
Name Description
name string

Required. The repository's name.

optionalArgs array

Optional.

↳ commitSha string

Optional. The Commit SHA for the commit to query from. If unset, the directory will be queried from HEAD.

↳ path string

Optional. The directory's full path including directory name, relative to root. If left unset, the root is used.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\DirectoryEntry;
use Google\Cloud\Dataform\V1beta1\QueryRepositoryDirectoryContentsRequest;

/**
 * @param string $formattedName The repository's name. Please see
 *                              {@see DataformClient::repositoryName()} for help formatting this field.
 */
function query_repository_directory_contents_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

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

        /** @var DirectoryEntry $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
{
    $formattedName = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');

    query_repository_directory_contents_sample($formattedName);
}

queryWorkflowInvocationActions

Returns WorkflowInvocationActions in a given WorkflowInvocation.

Parameters
Name Description
name string

Required. The workflow invocation's name.

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\QueryWorkflowInvocationActionsRequest;
use Google\Cloud\Dataform\V1beta1\WorkflowInvocationAction;

/**
 * @param string $formattedName The workflow invocation's name. Please see
 *                              {@see DataformClient::workflowInvocationName()} for help formatting this field.
 */
function query_workflow_invocation_actions_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

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

        /** @var WorkflowInvocationAction $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
{
    $formattedName = DataformClient::workflowInvocationName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKFLOW_INVOCATION]'
    );

    query_workflow_invocation_actions_sample($formattedName);
}

readFile

Returns the contents of a file (inside a Workspace).

Parameters
Name Description
workspace string

Required. The workspace's name.

path string

Required. The file's full path including filename, relative to the workspace root.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\ReadFileResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\ReadFileRequest;
use Google\Cloud\Dataform\V1beta1\ReadFileResponse;

/**
 * @param string $formattedWorkspace The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 * @param string $path               The file's full path including filename, relative to the
 *                                   workspace root.
 */
function read_file_sample(string $formattedWorkspace, string $path): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $request = (new ReadFileRequest())
        ->setWorkspace($formattedWorkspace)
        ->setPath($path);

    // Call the API and handle any network failures.
    try {
        /** @var ReadFileResponse $response */
        $response = $dataformClient->readFile($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
{
    $formattedWorkspace = DataformClient::workspaceName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKSPACE]'
    );
    $path = '[PATH]';

    read_file_sample($formattedWorkspace, $path);
}

readRepositoryFile

Returns the contents of a file (inside a Repository). The Repository must not have a value for git_remote_settings.url.

Parameters
Name Description
name string

Required. The repository's name.

path string

Required. Full file path to read including filename, from repository root.

optionalArgs array

Optional.

↳ commitSha string

Optional. The commit SHA for the commit to read from. If unset, the file will be read from HEAD.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\ReadRepositoryFileResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\ReadRepositoryFileRequest;
use Google\Cloud\Dataform\V1beta1\ReadRepositoryFileResponse;

/**
 * @param string $formattedName The repository's name. Please see
 *                              {@see DataformClient::repositoryName()} for help formatting this field.
 * @param string $path          Full file path to read including filename, from repository root.
 */
function read_repository_file_sample(string $formattedName, string $path): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var ReadRepositoryFileResponse $response */
        $response = $dataformClient->readRepositoryFile($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 = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');
    $path = '[PATH]';

    read_repository_file_sample($formattedName, $path);
}

removeDirectory

Deletes a directory (inside a Workspace) and all of its contents.

Parameters
Name Description
workspace string

Required. The workspace's name.

path string

Required. The directory's full path including directory name, relative to the workspace root.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\RemoveDirectoryRequest;

/**
 * @param string $formattedWorkspace The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 * @param string $path               The directory's full path including directory name, relative to
 *                                   the workspace root.
 */
function remove_directory_sample(string $formattedWorkspace, string $path): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $request = (new RemoveDirectoryRequest())
        ->setWorkspace($formattedWorkspace)
        ->setPath($path);

    // Call the API and handle any network failures.
    try {
        $dataformClient->removeDirectory($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    remove_directory_sample($formattedWorkspace, $path);
}

removeFile

Deletes a file (inside a Workspace).

Parameters
Name Description
workspace string

Required. The workspace's name.

path string

Required. The file's full path including filename, relative to the workspace root.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\RemoveFileRequest;

/**
 * @param string $formattedWorkspace The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 * @param string $path               The file's full path including filename, relative to the
 *                                   workspace root.
 */
function remove_file_sample(string $formattedWorkspace, string $path): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $request = (new RemoveFileRequest())
        ->setWorkspace($formattedWorkspace)
        ->setPath($path);

    // Call the API and handle any network failures.
    try {
        $dataformClient->removeFile($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    remove_file_sample($formattedWorkspace, $path);
}

resetWorkspaceChanges

Performs a Git reset for uncommitted files in a Workspace.

Parameters
Name Description
name string

Required. The workspace's name.

optionalArgs array

Optional.

↳ paths string[]

Optional. Full file paths to reset back to their committed state including filename, rooted at workspace root. If left empty, all files will be reset.

↳ clean bool

Optional. If set to true, untracked files will be deleted.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\ResetWorkspaceChangesRequest;

/**
 * @param string $formattedName The workspace's name. Please see
 *                              {@see DataformClient::workspaceName()} for help formatting this field.
 */
function reset_workspace_changes_sample(string $formattedName): void
{
    // Create a client.
    $dataformClient = new DataformClient();

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

    // Call the API and handle any network failures.
    try {
        $dataformClient->resetWorkspaceChanges($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    reset_workspace_changes_sample($formattedName);
}

updateReleaseConfig

Updates a single ReleaseConfig.

Parameters
Name Description
releaseConfig Google\Cloud\Dataform\V1beta1\ReleaseConfig

Required. The release config to update.

optionalArgs array

Optional.

↳ updateMask FieldMask

Optional. Specifies the fields to be updated in the release config. If left unset, all fields will be updated.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\ReleaseConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\ReleaseConfig;
use Google\Cloud\Dataform\V1beta1\UpdateReleaseConfigRequest;

/**
 * @param string $releaseConfigGitCommitish Git commit/tag/branch name at which the repository should be
 *                                          compiled. Must exist in the remote repository. Examples:
 *                                          - a commit SHA: `12ade345`
 *                                          - a tag: `tag1`
 *                                          - a branch name: `branch1`
 */
function update_release_config_sample(string $releaseConfigGitCommitish): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $releaseConfig = (new ReleaseConfig())
        ->setGitCommitish($releaseConfigGitCommitish);
    $request = (new UpdateReleaseConfigRequest())
        ->setReleaseConfig($releaseConfig);

    // Call the API and handle any network failures.
    try {
        /** @var ReleaseConfig $response */
        $response = $dataformClient->updateReleaseConfig($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
{
    $releaseConfigGitCommitish = '[GIT_COMMITISH]';

    update_release_config_sample($releaseConfigGitCommitish);
}

updateRepository

Updates a single Repository.

Parameters
Name Description
repository Google\Cloud\Dataform\V1beta1\Repository

Required. The repository to update.

optionalArgs array

Optional.

↳ updateMask FieldMask

Optional. Specifies the fields to be updated in the repository. If left unset, all fields will be updated.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\Repository
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\Repository;
use Google\Cloud\Dataform\V1beta1\UpdateRepositoryRequest;

/**
 * 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_repository_sample(): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $repository = new Repository();
    $request = (new UpdateRepositoryRequest())
        ->setRepository($repository);

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

updateWorkflowConfig

Updates a single WorkflowConfig.

Parameters
Name Description
workflowConfig Google\Cloud\Dataform\V1beta1\WorkflowConfig

Required. The workflow config to update.

optionalArgs array

Optional.

↳ updateMask FieldMask

Optional. Specifies the fields to be updated in the workflow config. If left unset, all fields will be updated.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\WorkflowConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\UpdateWorkflowConfigRequest;
use Google\Cloud\Dataform\V1beta1\WorkflowConfig;

/**
 * @param string $formattedWorkflowConfigReleaseConfig The name of the release config whose release_compilation_result
 *                                                     should be executed. Must be in the format
 *                                                     `projects/*/locations/*/repositories/*/releaseConfigs/*`. Please see
 *                                                     {@see DataformClient::releaseConfigName()} for help formatting this field.
 */
function update_workflow_config_sample(string $formattedWorkflowConfigReleaseConfig): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $workflowConfig = (new WorkflowConfig())
        ->setReleaseConfig($formattedWorkflowConfigReleaseConfig);
    $request = (new UpdateWorkflowConfigRequest())
        ->setWorkflowConfig($workflowConfig);

    // Call the API and handle any network failures.
    try {
        /** @var WorkflowConfig $response */
        $response = $dataformClient->updateWorkflowConfig($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
{
    $formattedWorkflowConfigReleaseConfig = DataformClient::releaseConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[RELEASE_CONFIG]'
    );

    update_workflow_config_sample($formattedWorkflowConfigReleaseConfig);
}

writeFile

Writes to a file (inside a Workspace).

Parameters
Name Description
workspace string

Required. The workspace's name.

path string

Required. The file.

contents string

Required. The file's contents.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Dataform\V1beta1\WriteFileResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
use Google\Cloud\Dataform\V1beta1\WriteFileRequest;
use Google\Cloud\Dataform\V1beta1\WriteFileResponse;

/**
 * @param string $formattedWorkspace The workspace's name. Please see
 *                                   {@see DataformClient::workspaceName()} for help formatting this field.
 * @param string $path               The file.
 * @param string $contents           The file's contents.
 */
function write_file_sample(string $formattedWorkspace, string $path, string $contents): void
{
    // Create a client.
    $dataformClient = new DataformClient();

    // Prepare the request message.
    $request = (new WriteFileRequest())
        ->setWorkspace($formattedWorkspace)
        ->setPath($path)
        ->setContents($contents);

    // Call the API and handle any network failures.
    try {
        /** @var WriteFileResponse $response */
        $response = $dataformClient->writeFile($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
{
    $formattedWorkspace = DataformClient::workspaceName(
        '[PROJECT]',
        '[LOCATION]',
        '[REPOSITORY]',
        '[WORKSPACE]'
    );
    $path = '[PATH]';
    $contents = '...';

    write_file_sample($formattedWorkspace, $path, $contents);
}

getLocation

Gets information about a location.

Parameters
Name Description
optionalArgs array

Optional.

↳ name string

Resource name for the location.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
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.
    $dataformClient = new DataformClient();

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

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

listLocations

Lists information about the supported locations for this service.

Parameters
Name Description
optionalArgs array

Optional.

↳ name string

The resource that owns the locations collection, if applicable.

↳ filter string

The standard list filter.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
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.
    $dataformClient = new DataformClient();

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

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

Parameters
Name Description
resource string

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

optionalArgs array

Optional.

↳ options GetPolicyOptions

OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
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.
    $dataformClient = new DataformClient();

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

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

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

    get_iam_policy_sample($resource);
}

setIamPolicy

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

Parameters
Name Description
resource string

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

policy Google\Cloud\Iam\V1\Policy

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

optionalArgs array

Optional.

↳ updateMask FieldMask

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

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
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.
    $dataformClient = new DataformClient();

    // 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 = $dataformClient->setIamPolicy($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

    set_iam_policy_sample($resource);
}

testIamPermissions

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

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

Parameters
Name Description
resource string

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

permissions string[]

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

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\Iam\V1\TestIamPermissionsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
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.
    $dataformClient = new DataformClient();

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

static::compilationResultName

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

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

static::locationName

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

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

static::releaseConfigName

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

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

static::repositoryName

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

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

static::secretVersionName

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

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

static::workflowConfigName

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

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

static::workflowInvocationName

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

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

static::workspaceName

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

Parameters
Name Description
project string
location string
repository string
workspace string
Returns
Type Description
string The formatted workspace 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

  • compilationResult: projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}
  • location: projects/{project}/locations/{location}
  • releaseConfig: projects/{project}/locations/{location}/repositories/{repository}/releaseConfigs/{release_config}
  • repository: projects/{project}/locations/{location}/repositories/{repository}
  • secretVersion: projects/{project}/secrets/{secret}/versions/{version}
  • workflowConfig: projects/{project}/locations/{location}/repositories/{repository}/workflowConfigs/{workflow_config}
  • workflowInvocation: projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}
  • workspace: projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}

The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.

Parameters
Name Description
formattedName string

The formatted name string

template string

Optional name of template to match

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

Constants

SERVICE_NAME

Value: 'google.cloud.dataform.v1beta1.Dataform'

The name of the service.

SERVICE_ADDRESS

Value: 'dataform.googleapis.com'

The default address of the service.

DEFAULT_SERVICE_PORT

Value: 443

The default port of the service.

CODEGEN_NAME

Value: 'gapic'

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