diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index 47293b0e4b2a..cd552317439c 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -517,7 +517,7 @@ "Dataform": { "language": "php", "distribution_name": "google/cloud-dataform", - "release_level": "preview", + "release_level": "stable", "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataform/latest", "library_type": "GAPIC_AUTO", "product_documentation": "https://cloud.google.com/dataform/docs", @@ -1599,4 +1599,4 @@ "library_type": "GAPIC_AUTO", "api_shortname": "workflows" } -} +} \ No newline at end of file diff --git a/Dataform/.OwlBot.yaml b/Dataform/.OwlBot.yaml index ae79350878f4..aaf4853765b7 100644 --- a/Dataform/.OwlBot.yaml +++ b/Dataform/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/dataform/v1beta1/.*-php/(.*) - dest: /owl-bot-staging/Dataform/v1beta1/$1 + - source: /google/cloud/dataform/(v1beta1)/.*-php/(.*) + dest: /owl-bot-staging/Dataform/$1/$2 api-name: Dataform diff --git a/Dataform/owlbot.py b/Dataform/owlbot.py index f903f99c5612..8d0889d7473a 100644 --- a/Dataform/owlbot.py +++ b/Dataform/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,14 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php", - src / "**/*GrpcClient.php" - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -48,32 +41,6 @@ + "\n", '') -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) - # format generated clients subprocess.run([ 'npm', @@ -82,8 +49,8 @@ '--package=@prettier/plugin-php@^0.16', '--', 'prettier', - '**/Gapic/*', + '**/Client/*', '--write', '--parser=php', '--single-quote', - '--print-width=80']) + '--print-width=120']) diff --git a/Dataform/src/V1beta1/CancelWorkflowInvocationRequest.php b/Dataform/src/V1beta1/CancelWorkflowInvocationRequest.php index ebd88bbbfc4d..2e7c0859ce31 100644 --- a/Dataform/src/V1beta1/CancelWorkflowInvocationRequest.php +++ b/Dataform/src/V1beta1/CancelWorkflowInvocationRequest.php @@ -20,7 +20,7 @@ class CancelWorkflowInvocationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/Client/DataformClient.php b/Dataform/src/V1beta1/Client/DataformClient.php index 96cdad51e53e..eccb11bdee82 100644 --- a/Dataform/src/V1beta1/Client/DataformClient.php +++ b/Dataform/src/V1beta1/Client/DataformClient.php @@ -1,6 +1,6 @@ render([ 'project' => $project, 'location' => $location, @@ -289,8 +290,12 @@ public static function locationName(string $project, string $location): string * * @experimental */ - public static function releaseConfigName(string $project, string $location, string $repository, string $releaseConfig): string - { + public static function releaseConfigName( + string $project, + string $location, + string $repository, + string $releaseConfig + ): string { return self::getPathTemplate('releaseConfig')->render([ 'project' => $project, 'location' => $location, @@ -354,8 +359,12 @@ public static function secretVersionName(string $project, string $secret, string * * @experimental */ - public static function workflowConfigName(string $project, string $location, string $repository, string $workflowConfig): string - { + public static function workflowConfigName( + string $project, + string $location, + string $repository, + string $workflowConfig + ): string { return self::getPathTemplate('workflowConfig')->render([ 'project' => $project, 'location' => $location, @@ -377,8 +386,12 @@ public static function workflowConfigName(string $project, string $location, str * * @experimental */ - public static function workflowInvocationName(string $project, string $location, string $repository, string $workflowInvocation): string - { + public static function workflowInvocationName( + string $project, + string $location, + string $repository, + string $workflowInvocation + ): string { return self::getPathTemplate('workflowInvocation')->render([ 'project' => $project, 'location' => $location, @@ -400,8 +413,12 @@ public static function workflowInvocationName(string $project, string $location, * * @experimental */ - public static function workspaceName(string $project, string $location, string $repository, string $workspace): string - { + public static function workspaceName( + string $project, + string $location, + string $repository, + string $workspace + ): string { return self::getPathTemplate('workspace')->render([ 'project' => $project, 'location' => $location, @@ -429,8 +446,8 @@ public static function workspaceName(string $project, string $location, string $ * listed, then parseName will check each of the supported templates, and return * the first match. * - * @param string $formattedName The formatted name string - * @param ?string $template Optional name of template to match + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match * * @return array An associative array from name component IDs to component values. * @@ -438,7 +455,7 @@ public static function workspaceName(string $project, string $location, string $ * * @experimental */ - public static function parseName(string $formattedName, ?string $template = null): array + public static function parseName(string $formattedName, string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -493,9 +510,6 @@ public static function parseName(string $formattedName, ?string $template = null * @type callable $clientCertSource * 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. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException @@ -622,8 +636,10 @@ public function commitWorkspaceChanges(CommitWorkspaceChangesRequest $request, a * * @experimental */ - public function computeRepositoryAccessTokenStatus(ComputeRepositoryAccessTokenStatusRequest $request, array $callOptions = []): ComputeRepositoryAccessTokenStatusResponse - { + public function computeRepositoryAccessTokenStatus( + ComputeRepositoryAccessTokenStatusRequest $request, + array $callOptions = [] + ): ComputeRepositoryAccessTokenStatusResponse { return $this->startApiCall('ComputeRepositoryAccessTokenStatus', $request, $callOptions)->wait(); } @@ -650,8 +666,10 @@ public function computeRepositoryAccessTokenStatus(ComputeRepositoryAccessTokenS * * @experimental */ - public function createCompilationResult(CreateCompilationResultRequest $request, array $callOptions = []): CompilationResult - { + public function createCompilationResult( + CreateCompilationResultRequest $request, + array $callOptions = [] + ): CompilationResult { return $this->startApiCall('CreateCompilationResult', $request, $callOptions)->wait(); } @@ -762,8 +780,10 @@ public function createWorkflowConfig(CreateWorkflowConfigRequest $request, array * * @experimental */ - public function createWorkflowInvocation(CreateWorkflowInvocationRequest $request, array $callOptions = []): WorkflowInvocation - { + public function createWorkflowInvocation( + CreateWorkflowInvocationRequest $request, + array $callOptions = [] + ): WorkflowInvocation { return $this->startApiCall('CreateWorkflowInvocation', $request, $callOptions)->wait(); } @@ -976,8 +996,10 @@ public function fetchFileDiff(FetchFileDiffRequest $request, array $callOptions * * @experimental */ - public function fetchFileGitStatuses(FetchFileGitStatusesRequest $request, array $callOptions = []): FetchFileGitStatusesResponse - { + public function fetchFileGitStatuses( + FetchFileGitStatusesRequest $request, + array $callOptions = [] + ): FetchFileGitStatusesResponse { return $this->startApiCall('FetchFileGitStatuses', $request, $callOptions)->wait(); } @@ -1004,8 +1026,10 @@ public function fetchFileGitStatuses(FetchFileGitStatusesRequest $request, array * * @experimental */ - public function fetchGitAheadBehind(FetchGitAheadBehindRequest $request, array $callOptions = []): FetchGitAheadBehindResponse - { + public function fetchGitAheadBehind( + FetchGitAheadBehindRequest $request, + array $callOptions = [] + ): FetchGitAheadBehindResponse { return $this->startApiCall('FetchGitAheadBehind', $request, $callOptions)->wait(); } @@ -1032,8 +1056,10 @@ public function fetchGitAheadBehind(FetchGitAheadBehindRequest $request, array $ * * @experimental */ - public function fetchRemoteBranches(FetchRemoteBranchesRequest $request, array $callOptions = []): FetchRemoteBranchesResponse - { + public function fetchRemoteBranches( + FetchRemoteBranchesRequest $request, + array $callOptions = [] + ): FetchRemoteBranchesResponse { return $this->startApiCall('FetchRemoteBranches', $request, $callOptions)->wait(); } @@ -1061,8 +1087,10 @@ public function fetchRemoteBranches(FetchRemoteBranchesRequest $request, array $ * * @experimental */ - public function fetchRepositoryHistory(FetchRepositoryHistoryRequest $request, array $callOptions = []): PagedListResponse - { + public function fetchRepositoryHistory( + FetchRepositoryHistoryRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('FetchRepositoryHistory', $request, $callOptions); } @@ -1089,8 +1117,10 @@ public function fetchRepositoryHistory(FetchRepositoryHistoryRequest $request, a * * @experimental */ - public function getCompilationResult(GetCompilationResultRequest $request, array $callOptions = []): CompilationResult - { + public function getCompilationResult( + GetCompilationResultRequest $request, + array $callOptions = [] + ): CompilationResult { return $this->startApiCall('GetCompilationResult', $request, $callOptions)->wait(); } @@ -1201,8 +1231,10 @@ public function getWorkflowConfig(GetWorkflowConfigRequest $request, array $call * * @experimental */ - public function getWorkflowInvocation(GetWorkflowInvocationRequest $request, array $callOptions = []): WorkflowInvocation - { + public function getWorkflowInvocation( + GetWorkflowInvocationRequest $request, + array $callOptions = [] + ): WorkflowInvocation { return $this->startApiCall('GetWorkflowInvocation', $request, $callOptions)->wait(); } @@ -1257,8 +1289,10 @@ public function getWorkspace(GetWorkspaceRequest $request, array $callOptions = * * @experimental */ - public function installNpmPackages(InstallNpmPackagesRequest $request, array $callOptions = []): InstallNpmPackagesResponse - { + public function installNpmPackages( + InstallNpmPackagesRequest $request, + array $callOptions = [] + ): InstallNpmPackagesResponse { return $this->startApiCall('InstallNpmPackages', $request, $callOptions)->wait(); } @@ -1285,8 +1319,10 @@ public function installNpmPackages(InstallNpmPackagesRequest $request, array $ca * * @experimental */ - public function listCompilationResults(ListCompilationResultsRequest $request, array $callOptions = []): PagedListResponse - { + public function listCompilationResults( + ListCompilationResultsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListCompilationResults', $request, $callOptions); } @@ -1397,8 +1433,10 @@ public function listWorkflowConfigs(ListWorkflowConfigsRequest $request, array $ * * @experimental */ - public function listWorkflowInvocations(ListWorkflowInvocationsRequest $request, array $callOptions = []): PagedListResponse - { + public function listWorkflowInvocations( + ListWorkflowInvocationsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListWorkflowInvocations', $request, $callOptions); } @@ -1591,8 +1629,10 @@ public function pushGitCommits(PushGitCommitsRequest $request, array $callOption * * @experimental */ - public function queryCompilationResultActions(QueryCompilationResultActionsRequest $request, array $callOptions = []): PagedListResponse - { + public function queryCompilationResultActions( + QueryCompilationResultActionsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('QueryCompilationResultActions', $request, $callOptions); } @@ -1619,8 +1659,10 @@ public function queryCompilationResultActions(QueryCompilationResultActionsReque * * @experimental */ - public function queryDirectoryContents(QueryDirectoryContentsRequest $request, array $callOptions = []): PagedListResponse - { + public function queryDirectoryContents( + QueryDirectoryContentsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('QueryDirectoryContents', $request, $callOptions); } @@ -1649,8 +1691,10 @@ public function queryDirectoryContents(QueryDirectoryContentsRequest $request, a * * @experimental */ - public function queryRepositoryDirectoryContents(QueryRepositoryDirectoryContentsRequest $request, array $callOptions = []): PagedListResponse - { + public function queryRepositoryDirectoryContents( + QueryRepositoryDirectoryContentsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('QueryRepositoryDirectoryContents', $request, $callOptions); } @@ -1678,8 +1722,10 @@ public function queryRepositoryDirectoryContents(QueryRepositoryDirectoryContent * * @experimental */ - public function queryWorkflowInvocationActions(QueryWorkflowInvocationActionsRequest $request, array $callOptions = []): PagedListResponse - { + public function queryWorkflowInvocationActions( + QueryWorkflowInvocationActionsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('QueryWorkflowInvocationActions', $request, $callOptions); } @@ -1735,8 +1781,10 @@ public function readFile(ReadFileRequest $request, array $callOptions = []): Rea * * @experimental */ - public function readRepositoryFile(ReadRepositoryFileRequest $request, array $callOptions = []): ReadRepositoryFileResponse - { + public function readRepositoryFile( + ReadRepositoryFileRequest $request, + array $callOptions = [] + ): ReadRepositoryFileResponse { return $this->startApiCall('ReadRepositoryFile', $request, $callOptions)->wait(); } @@ -2076,8 +2124,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @experimental */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/Dataform/src/V1beta1/CodeCompilationConfig.php b/Dataform/src/V1beta1/CodeCompilationConfig.php index cea34b4495c7..935c12da9355 100644 --- a/Dataform/src/V1beta1/CodeCompilationConfig.php +++ b/Dataform/src/V1beta1/CodeCompilationConfig.php @@ -20,13 +20,13 @@ class CodeCompilationConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string default_database = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $default_database = ''; + protected $default_database = ''; /** * Optional. The default schema (BigQuery dataset ID). * * Generated from protobuf field string default_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $default_schema = ''; + protected $default_schema = ''; /** * Optional. The default BigQuery location to use. Defaults to "US". * See the BigQuery docs for a full list of locations: @@ -34,13 +34,13 @@ class CodeCompilationConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string default_location = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $default_location = ''; + protected $default_location = ''; /** * Optional. The default schema (BigQuery dataset ID) for assertions. * * Generated from protobuf field string assertion_schema = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $assertion_schema = ''; + protected $assertion_schema = ''; /** * Optional. User-defined variables that are made available to project code * during compilation. @@ -54,20 +54,20 @@ class CodeCompilationConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string database_suffix = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $database_suffix = ''; + protected $database_suffix = ''; /** * Optional. The suffix that should be appended to all schema (BigQuery * dataset ID) names. * * Generated from protobuf field string schema_suffix = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $schema_suffix = ''; + protected $schema_suffix = ''; /** * Optional. The prefix that should be prepended to all table names. * * Generated from protobuf field string table_prefix = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $table_prefix = ''; + protected $table_prefix = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/CommitAuthor.php b/Dataform/src/V1beta1/CommitAuthor.php index afd74b082256..90bc52fb50d3 100644 --- a/Dataform/src/V1beta1/CommitAuthor.php +++ b/Dataform/src/V1beta1/CommitAuthor.php @@ -20,13 +20,13 @@ class CommitAuthor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. The commit author's email address. * * Generated from protobuf field string email_address = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $email_address = ''; + protected $email_address = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/CommitLogEntry.php b/Dataform/src/V1beta1/CommitLogEntry.php index a54f272729b3..4874da98a0b2 100644 --- a/Dataform/src/V1beta1/CommitLogEntry.php +++ b/Dataform/src/V1beta1/CommitLogEntry.php @@ -20,25 +20,25 @@ class CommitLogEntry extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp commit_time = 1; */ - private $commit_time = null; + protected $commit_time = null; /** * The commit SHA for this commit log entry. * * Generated from protobuf field string commit_sha = 2; */ - private $commit_sha = ''; + protected $commit_sha = ''; /** * The commit author for this commit log entry. * * Generated from protobuf field .google.cloud.dataform.v1beta1.CommitAuthor author = 3; */ - private $author = null; + protected $author = null; /** * The commit message for this commit log entry. * * Generated from protobuf field string commit_message = 4; */ - private $commit_message = ''; + protected $commit_message = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/CommitMetadata.php b/Dataform/src/V1beta1/CommitMetadata.php index 236f22bade39..f1a343c32fe1 100644 --- a/Dataform/src/V1beta1/CommitMetadata.php +++ b/Dataform/src/V1beta1/CommitMetadata.php @@ -20,13 +20,13 @@ class CommitMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataform.v1beta1.CommitAuthor author = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $author = null; + protected $author = null; /** * Optional. The commit's message. * * Generated from protobuf field string commit_message = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $commit_message = ''; + protected $commit_message = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/CommitRepositoryChangesRequest.php b/Dataform/src/V1beta1/CommitRepositoryChangesRequest.php index 4f15b4029f6d..b40f619f523c 100644 --- a/Dataform/src/V1beta1/CommitRepositoryChangesRequest.php +++ b/Dataform/src/V1beta1/CommitRepositoryChangesRequest.php @@ -20,13 +20,13 @@ class CommitRepositoryChangesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The changes to commit to the repository. * * Generated from protobuf field .google.cloud.dataform.v1beta1.CommitMetadata commit_metadata = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $commit_metadata = null; + protected $commit_metadata = null; /** * Optional. The commit SHA which must be the repository's current HEAD before * applying this commit; otherwise this request will fail. If unset, no @@ -34,7 +34,7 @@ class CommitRepositoryChangesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string required_head_commit_sha = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $required_head_commit_sha = ''; + protected $required_head_commit_sha = ''; /** * A map to the path of the file to the operation. The path is the full file * path including filename, from repository root. diff --git a/Dataform/src/V1beta1/CommitRepositoryChangesRequest/FileOperation/WriteFile.php b/Dataform/src/V1beta1/CommitRepositoryChangesRequest/FileOperation/WriteFile.php index 41445ae40618..1abb7f39db3b 100644 --- a/Dataform/src/V1beta1/CommitRepositoryChangesRequest/FileOperation/WriteFile.php +++ b/Dataform/src/V1beta1/CommitRepositoryChangesRequest/FileOperation/WriteFile.php @@ -20,7 +20,7 @@ class WriteFile extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes contents = 1; */ - private $contents = ''; + protected $contents = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/CommitWorkspaceChangesRequest.php b/Dataform/src/V1beta1/CommitWorkspaceChangesRequest.php index 00480e1fb8df..b702242faadc 100644 --- a/Dataform/src/V1beta1/CommitWorkspaceChangesRequest.php +++ b/Dataform/src/V1beta1/CommitWorkspaceChangesRequest.php @@ -20,19 +20,19 @@ class CommitWorkspaceChangesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Required. The commit's author. * * Generated from protobuf field .google.cloud.dataform.v1beta1.CommitAuthor author = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $author = null; + protected $author = null; /** * Optional. The commit's message. * * Generated from protobuf field string commit_message = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $commit_message = ''; + protected $commit_message = ''; /** * Optional. Full file paths to commit including filename, rooted at workspace * root. If left empty, all files will be committed. diff --git a/Dataform/src/V1beta1/CompilationResult.php b/Dataform/src/V1beta1/CompilationResult.php index ea1166284cc4..eeb729289342 100644 --- a/Dataform/src/V1beta1/CompilationResult.php +++ b/Dataform/src/V1beta1/CompilationResult.php @@ -20,27 +20,27 @@ class CompilationResult extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Immutable. If set, fields of `code_compilation_config` override the default * compilation settings that are specified in dataform.json. * * Generated from protobuf field .google.cloud.dataform.v1beta1.CodeCompilationConfig code_compilation_config = 4 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $code_compilation_config = null; + protected $code_compilation_config = null; /** * Output only. The fully resolved Git commit SHA of the code that was * compiled. Not set for compilation results whose source is a workspace. * * Generated from protobuf field string resolved_git_commit_sha = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $resolved_git_commit_sha = ''; + protected $resolved_git_commit_sha = ''; /** * Output only. The version of `@dataform/core` that was used for compilation. * * Generated from protobuf field string dataform_core_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $dataform_core_version = ''; + protected $dataform_core_version = ''; /** * Output only. Errors encountered during project compilation. * diff --git a/Dataform/src/V1beta1/CompilationResult/CodeCompilationConfig.php b/Dataform/src/V1beta1/CompilationResult/CodeCompilationConfig.php deleted file mode 100644 index 2945dd608614..000000000000 --- a/Dataform/src/V1beta1/CompilationResult/CodeCompilationConfig.php +++ /dev/null @@ -1,326 +0,0 @@ -google.cloud.dataform.v1beta1.CompilationResult.CodeCompilationConfig - */ -class CodeCompilationConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The default database (Google Cloud project ID). - * - * Generated from protobuf field string default_database = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $default_database = ''; - /** - * Optional. The default schema (BigQuery dataset ID). - * - * Generated from protobuf field string default_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $default_schema = ''; - /** - * Optional. The default BigQuery location to use. Defaults to "US". - * See the BigQuery docs for a full list of locations: - * https://cloud.google.com/bigquery/docs/locations. - * - * Generated from protobuf field string default_location = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $default_location = ''; - /** - * Optional. The default schema (BigQuery dataset ID) for assertions. - * - * Generated from protobuf field string assertion_schema = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $assertion_schema = ''; - /** - * Optional. User-defined variables that are made available to project code during - * compilation. - * - * Generated from protobuf field map vars = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $vars; - /** - * Optional. The suffix that should be appended to all database (Google Cloud project - * ID) names. - * - * Generated from protobuf field string database_suffix = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $database_suffix = ''; - /** - * Optional. The suffix that should be appended to all schema (BigQuery dataset ID) - * names. - * - * Generated from protobuf field string schema_suffix = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $schema_suffix = ''; - /** - * Optional. The prefix that should be prepended to all table names. - * - * Generated from protobuf field string table_prefix = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $table_prefix = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $default_database - * Optional. The default database (Google Cloud project ID). - * @type string $default_schema - * Optional. The default schema (BigQuery dataset ID). - * @type string $default_location - * Optional. The default BigQuery location to use. Defaults to "US". - * See the BigQuery docs for a full list of locations: - * https://cloud.google.com/bigquery/docs/locations. - * @type string $assertion_schema - * Optional. The default schema (BigQuery dataset ID) for assertions. - * @type array|\Google\Protobuf\Internal\MapField $vars - * Optional. User-defined variables that are made available to project code during - * compilation. - * @type string $database_suffix - * Optional. The suffix that should be appended to all database (Google Cloud project - * ID) names. - * @type string $schema_suffix - * Optional. The suffix that should be appended to all schema (BigQuery dataset ID) - * names. - * @type string $table_prefix - * Optional. The prefix that should be prepended to all table names. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dataform\V1Beta1\Dataform::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The default database (Google Cloud project ID). - * - * Generated from protobuf field string default_database = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDefaultDatabase() - { - return $this->default_database; - } - - /** - * Optional. The default database (Google Cloud project ID). - * - * Generated from protobuf field string default_database = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDefaultDatabase($var) - { - GPBUtil::checkString($var, True); - $this->default_database = $var; - - return $this; - } - - /** - * Optional. The default schema (BigQuery dataset ID). - * - * Generated from protobuf field string default_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDefaultSchema() - { - return $this->default_schema; - } - - /** - * Optional. The default schema (BigQuery dataset ID). - * - * Generated from protobuf field string default_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDefaultSchema($var) - { - GPBUtil::checkString($var, True); - $this->default_schema = $var; - - return $this; - } - - /** - * Optional. The default BigQuery location to use. Defaults to "US". - * See the BigQuery docs for a full list of locations: - * https://cloud.google.com/bigquery/docs/locations. - * - * Generated from protobuf field string default_location = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDefaultLocation() - { - return $this->default_location; - } - - /** - * Optional. The default BigQuery location to use. Defaults to "US". - * See the BigQuery docs for a full list of locations: - * https://cloud.google.com/bigquery/docs/locations. - * - * Generated from protobuf field string default_location = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDefaultLocation($var) - { - GPBUtil::checkString($var, True); - $this->default_location = $var; - - return $this; - } - - /** - * Optional. The default schema (BigQuery dataset ID) for assertions. - * - * Generated from protobuf field string assertion_schema = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAssertionSchema() - { - return $this->assertion_schema; - } - - /** - * Optional. The default schema (BigQuery dataset ID) for assertions. - * - * Generated from protobuf field string assertion_schema = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAssertionSchema($var) - { - GPBUtil::checkString($var, True); - $this->assertion_schema = $var; - - return $this; - } - - /** - * Optional. User-defined variables that are made available to project code during - * compilation. - * - * Generated from protobuf field map vars = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getVars() - { - return $this->vars; - } - - /** - * Optional. User-defined variables that are made available to project code during - * compilation. - * - * Generated from protobuf field map vars = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setVars($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->vars = $arr; - - return $this; - } - - /** - * Optional. The suffix that should be appended to all database (Google Cloud project - * ID) names. - * - * Generated from protobuf field string database_suffix = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDatabaseSuffix() - { - return $this->database_suffix; - } - - /** - * Optional. The suffix that should be appended to all database (Google Cloud project - * ID) names. - * - * Generated from protobuf field string database_suffix = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDatabaseSuffix($var) - { - GPBUtil::checkString($var, True); - $this->database_suffix = $var; - - return $this; - } - - /** - * Optional. The suffix that should be appended to all schema (BigQuery dataset ID) - * names. - * - * Generated from protobuf field string schema_suffix = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getSchemaSuffix() - { - return $this->schema_suffix; - } - - /** - * Optional. The suffix that should be appended to all schema (BigQuery dataset ID) - * names. - * - * Generated from protobuf field string schema_suffix = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setSchemaSuffix($var) - { - GPBUtil::checkString($var, True); - $this->schema_suffix = $var; - - return $this; - } - - /** - * Optional. The prefix that should be prepended to all table names. - * - * Generated from protobuf field string table_prefix = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getTablePrefix() - { - return $this->table_prefix; - } - - /** - * Optional. The prefix that should be prepended to all table names. - * - * Generated from protobuf field string table_prefix = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setTablePrefix($var) - { - GPBUtil::checkString($var, True); - $this->table_prefix = $var; - - return $this; - } - -} - - diff --git a/Dataform/src/V1beta1/CompilationResult/CompilationError.php b/Dataform/src/V1beta1/CompilationResult/CompilationError.php index 498cff85f746..c40384fb5a2f 100644 --- a/Dataform/src/V1beta1/CompilationResult/CompilationError.php +++ b/Dataform/src/V1beta1/CompilationResult/CompilationError.php @@ -20,27 +20,27 @@ class CompilationError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $message = ''; + protected $message = ''; /** * Output only. The error's full stack trace. * * Generated from protobuf field string stack = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $stack = ''; + protected $stack = ''; /** * Output only. The path of the file where this error occurred, if * available, relative to the project root. * * Generated from protobuf field string path = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $path = ''; + protected $path = ''; /** * Output only. The identifier of the action where this error occurred, if * available. * * Generated from protobuf field .google.cloud.dataform.v1beta1.Target action_target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $action_target = null; + protected $action_target = null; /** * Constructor. diff --git a/Dataform/src/V1beta1/CompilationResultAction.php b/Dataform/src/V1beta1/CompilationResultAction.php index 75a9ce648bf0..0a727609866c 100644 --- a/Dataform/src/V1beta1/CompilationResultAction.php +++ b/Dataform/src/V1beta1/CompilationResultAction.php @@ -20,21 +20,21 @@ class CompilationResultAction extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataform.v1beta1.Target target = 1; */ - private $target = null; + protected $target = null; /** * The action's identifier if the project had been compiled without any * overrides configured. Unique within the compilation result. * * Generated from protobuf field .google.cloud.dataform.v1beta1.Target canonical_target = 2; */ - private $canonical_target = null; + protected $canonical_target = null; /** * The full path including filename in which this action is located, relative * to the workspace root. * * Generated from protobuf field string file_path = 3; */ - private $file_path = ''; + protected $file_path = ''; protected $compiled_object; /** diff --git a/Dataform/src/V1beta1/CompilationResultAction/Assertion.php b/Dataform/src/V1beta1/CompilationResultAction/Assertion.php index 0deaa286fd1e..bfba2012b9ca 100644 --- a/Dataform/src/V1beta1/CompilationResultAction/Assertion.php +++ b/Dataform/src/V1beta1/CompilationResultAction/Assertion.php @@ -28,13 +28,13 @@ class Assertion extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataform.v1beta1.Target parent_action = 5; */ - private $parent_action = null; + protected $parent_action = null; /** * Whether this action is disabled (i.e. should not be run). * * Generated from protobuf field bool disabled = 2; */ - private $disabled = false; + protected $disabled = false; /** * Arbitrary, user-defined tags on this action. * @@ -47,14 +47,14 @@ class Assertion extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string select_query = 4; */ - private $select_query = ''; + protected $select_query = ''; /** * Descriptor for the assertion's automatically-generated view and its * columns. * * Generated from protobuf field .google.cloud.dataform.v1beta1.RelationDescriptor relation_descriptor = 6; */ - private $relation_descriptor = null; + protected $relation_descriptor = null; /** * Constructor. diff --git a/Dataform/src/V1beta1/CompilationResultAction/Declaration.php b/Dataform/src/V1beta1/CompilationResultAction/Declaration.php index bb78d81c5324..1d830aad21c4 100644 --- a/Dataform/src/V1beta1/CompilationResultAction/Declaration.php +++ b/Dataform/src/V1beta1/CompilationResultAction/Declaration.php @@ -22,7 +22,7 @@ class Declaration extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataform.v1beta1.RelationDescriptor relation_descriptor = 1; */ - private $relation_descriptor = null; + protected $relation_descriptor = null; /** * Constructor. diff --git a/Dataform/src/V1beta1/CompilationResultAction/Operations.php b/Dataform/src/V1beta1/CompilationResultAction/Operations.php index 77fe2a7c13ab..a065f925a982 100644 --- a/Dataform/src/V1beta1/CompilationResultAction/Operations.php +++ b/Dataform/src/V1beta1/CompilationResultAction/Operations.php @@ -26,7 +26,7 @@ class Operations extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disabled = 2; */ - private $disabled = false; + protected $disabled = false; /** * Arbitrary, user-defined tags on this action. * @@ -39,7 +39,7 @@ class Operations extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataform.v1beta1.RelationDescriptor relation_descriptor = 6; */ - private $relation_descriptor = null; + protected $relation_descriptor = null; /** * A list of arbitrary SQL statements that will be executed without * alteration. @@ -52,7 +52,7 @@ class Operations extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool has_output = 5; */ - private $has_output = false; + protected $has_output = false; /** * Constructor. diff --git a/Dataform/src/V1beta1/CompilationResultAction/Relation.php b/Dataform/src/V1beta1/CompilationResultAction/Relation.php index ea761e963bca..20116817dc57 100644 --- a/Dataform/src/V1beta1/CompilationResultAction/Relation.php +++ b/Dataform/src/V1beta1/CompilationResultAction/Relation.php @@ -26,7 +26,7 @@ class Relation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disabled = 2; */ - private $disabled = false; + protected $disabled = false; /** * Arbitrary, user-defined tags on this action. * @@ -38,19 +38,19 @@ class Relation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataform.v1beta1.RelationDescriptor relation_descriptor = 4; */ - private $relation_descriptor = null; + protected $relation_descriptor = null; /** * The type of this relation. * * Generated from protobuf field .google.cloud.dataform.v1beta1.CompilationResultAction.Relation.RelationType relation_type = 5; */ - private $relation_type = 0; + protected $relation_type = 0; /** * The SELECT query which returns rows which this relation should contain. * * Generated from protobuf field string select_query = 6; */ - private $select_query = ''; + protected $select_query = ''; /** * SQL statements to be executed before creating the relation. * @@ -69,13 +69,13 @@ class Relation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataform.v1beta1.CompilationResultAction.Relation.IncrementalTableConfig incremental_table_config = 9; */ - private $incremental_table_config = null; + protected $incremental_table_config = null; /** * The SQL expression used to partition the relation. * * Generated from protobuf field string partition_expression = 10; */ - private $partition_expression = ''; + protected $partition_expression = ''; /** * A list of columns or SQL expressions used to cluster the table. * @@ -87,14 +87,14 @@ class Relation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 partition_expiration_days = 12; */ - private $partition_expiration_days = 0; + protected $partition_expiration_days = 0; /** * Specifies whether queries on this table must include a predicate filter * that filters on the partitioning column. * * Generated from protobuf field bool require_partition_filter = 13; */ - private $require_partition_filter = false; + protected $require_partition_filter = false; /** * Additional options that will be provided as key/value pairs into the * options clause of a create table/view statement. See diff --git a/Dataform/src/V1beta1/CompilationResultAction/Relation/IncrementalTableConfig.php b/Dataform/src/V1beta1/CompilationResultAction/Relation/IncrementalTableConfig.php index c8137a63a535..4354693e1ae9 100644 --- a/Dataform/src/V1beta1/CompilationResultAction/Relation/IncrementalTableConfig.php +++ b/Dataform/src/V1beta1/CompilationResultAction/Relation/IncrementalTableConfig.php @@ -21,13 +21,13 @@ class IncrementalTableConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string incremental_select_query = 1; */ - private $incremental_select_query = ''; + protected $incremental_select_query = ''; /** * Whether this table should be protected from being refreshed. * * Generated from protobuf field bool refresh_disabled = 2; */ - private $refresh_disabled = false; + protected $refresh_disabled = false; /** * A set of columns or SQL expressions used to define row uniqueness. * If any duplicates are discovered (as defined by `unique_key_parts`), @@ -44,7 +44,7 @@ class IncrementalTableConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string update_partition_filter = 4; */ - private $update_partition_filter = ''; + protected $update_partition_filter = ''; /** * SQL statements to be executed before inserting new rows into the * relation. diff --git a/Dataform/src/V1beta1/ComputeRepositoryAccessTokenStatusRequest.php b/Dataform/src/V1beta1/ComputeRepositoryAccessTokenStatusRequest.php index b3044a4218e6..af8cf7c7c5f2 100644 --- a/Dataform/src/V1beta1/ComputeRepositoryAccessTokenStatusRequest.php +++ b/Dataform/src/V1beta1/ComputeRepositoryAccessTokenStatusRequest.php @@ -20,7 +20,7 @@ class ComputeRepositoryAccessTokenStatusRequest extends \Google\Protobuf\Interna * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/ComputeRepositoryAccessTokenStatusResponse.php b/Dataform/src/V1beta1/ComputeRepositoryAccessTokenStatusResponse.php index 50856ee47f03..33f504c6759f 100644 --- a/Dataform/src/V1beta1/ComputeRepositoryAccessTokenStatusResponse.php +++ b/Dataform/src/V1beta1/ComputeRepositoryAccessTokenStatusResponse.php @@ -20,7 +20,7 @@ class ComputeRepositoryAccessTokenStatusResponse extends \Google\Protobuf\Intern * * Generated from protobuf field .google.cloud.dataform.v1beta1.ComputeRepositoryAccessTokenStatusResponse.TokenStatus token_status = 1; */ - private $token_status = 0; + protected $token_status = 0; /** * Constructor. diff --git a/Dataform/src/V1beta1/CreateCompilationResultRequest.php b/Dataform/src/V1beta1/CreateCompilationResultRequest.php index dabfb4e64153..c4ca7803576e 100644 --- a/Dataform/src/V1beta1/CreateCompilationResultRequest.php +++ b/Dataform/src/V1beta1/CreateCompilationResultRequest.php @@ -21,13 +21,13 @@ class CreateCompilationResultRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The compilation result to create. * * Generated from protobuf field .google.cloud.dataform.v1beta1.CompilationResult compilation_result = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $compilation_result = null; + protected $compilation_result = null; /** * @param string $parent Required. The repository in which to create the compilation result. Must be diff --git a/Dataform/src/V1beta1/CreateReleaseConfigRequest.php b/Dataform/src/V1beta1/CreateReleaseConfigRequest.php index 3fa02d71e138..dd56851f2a17 100644 --- a/Dataform/src/V1beta1/CreateReleaseConfigRequest.php +++ b/Dataform/src/V1beta1/CreateReleaseConfigRequest.php @@ -21,20 +21,20 @@ class CreateReleaseConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The release config to create. * * Generated from protobuf field .google.cloud.dataform.v1beta1.ReleaseConfig release_config = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $release_config = null; + protected $release_config = null; /** * Required. The ID to use for the release config, which will become the final * component of the release config's resource name. * * Generated from protobuf field string release_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $release_config_id = ''; + protected $release_config_id = ''; /** * @param string $parent Required. The repository in which to create the release config. Must be in diff --git a/Dataform/src/V1beta1/CreateRepositoryRequest.php b/Dataform/src/V1beta1/CreateRepositoryRequest.php index 3bc2bfba0c39..b10b110eb5f5 100644 --- a/Dataform/src/V1beta1/CreateRepositoryRequest.php +++ b/Dataform/src/V1beta1/CreateRepositoryRequest.php @@ -21,20 +21,20 @@ class CreateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The repository to create. * * Generated from protobuf field .google.cloud.dataform.v1beta1.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository = null; + protected $repository = null; /** * Required. The ID to use for the repository, which will become the final * component of the repository's resource name. * * Generated from protobuf field string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository_id = ''; + protected $repository_id = ''; /** * @param string $parent Required. The location in which to create the repository. Must be in the diff --git a/Dataform/src/V1beta1/CreateWorkflowConfigRequest.php b/Dataform/src/V1beta1/CreateWorkflowConfigRequest.php index 97525b65fda9..0d2162284e7e 100644 --- a/Dataform/src/V1beta1/CreateWorkflowConfigRequest.php +++ b/Dataform/src/V1beta1/CreateWorkflowConfigRequest.php @@ -21,20 +21,20 @@ class CreateWorkflowConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The workflow config to create. * * Generated from protobuf field .google.cloud.dataform.v1beta1.WorkflowConfig workflow_config = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $workflow_config = null; + protected $workflow_config = null; /** * Required. The ID to use for the workflow config, which will become the * final component of the workflow config's resource name. * * Generated from protobuf field string workflow_config_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $workflow_config_id = ''; + protected $workflow_config_id = ''; /** * @param string $parent Required. The repository in which to create the workflow config. Must be in diff --git a/Dataform/src/V1beta1/CreateWorkflowInvocationRequest.php b/Dataform/src/V1beta1/CreateWorkflowInvocationRequest.php index 707f96d104b8..8e2ce4911ddb 100644 --- a/Dataform/src/V1beta1/CreateWorkflowInvocationRequest.php +++ b/Dataform/src/V1beta1/CreateWorkflowInvocationRequest.php @@ -21,13 +21,13 @@ class CreateWorkflowInvocationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The workflow invocation resource to create. * * Generated from protobuf field .google.cloud.dataform.v1beta1.WorkflowInvocation workflow_invocation = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $workflow_invocation = null; + protected $workflow_invocation = null; /** * @param string $parent Required. The repository in which to create the workflow invocation. Must diff --git a/Dataform/src/V1beta1/CreateWorkspaceRequest.php b/Dataform/src/V1beta1/CreateWorkspaceRequest.php index a29e555735bc..1974d634d01a 100644 --- a/Dataform/src/V1beta1/CreateWorkspaceRequest.php +++ b/Dataform/src/V1beta1/CreateWorkspaceRequest.php @@ -21,20 +21,20 @@ class CreateWorkspaceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The workspace to create. * * Generated from protobuf field .google.cloud.dataform.v1beta1.Workspace workspace = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $workspace = null; + protected $workspace = null; /** * Required. The ID to use for the workspace, which will become the final * component of the workspace's resource name. * * Generated from protobuf field string workspace_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $workspace_id = ''; + protected $workspace_id = ''; /** * @param string $parent Required. The repository in which to create the workspace. Must be in the diff --git a/Dataform/src/V1beta1/DataformClient.php b/Dataform/src/V1beta1/DataformClient.php deleted file mode 100644 index c044e3719d64..000000000000 --- a/Dataform/src/V1beta1/DataformClient.php +++ /dev/null @@ -1,36 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The release config's name. Please see diff --git a/Dataform/src/V1beta1/DeleteRepositoryRequest.php b/Dataform/src/V1beta1/DeleteRepositoryRequest.php index f85235b9d56a..4ab952474da0 100644 --- a/Dataform/src/V1beta1/DeleteRepositoryRequest.php +++ b/Dataform/src/V1beta1/DeleteRepositoryRequest.php @@ -20,7 +20,7 @@ class DeleteRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * 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 @@ -28,7 +28,7 @@ class DeleteRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool force = 2; */ - private $force = false; + protected $force = false; /** * @param string $name Required. The repository's name. Please see diff --git a/Dataform/src/V1beta1/DeleteWorkflowConfigRequest.php b/Dataform/src/V1beta1/DeleteWorkflowConfigRequest.php index 03044e3ef036..95f92f8c02a6 100644 --- a/Dataform/src/V1beta1/DeleteWorkflowConfigRequest.php +++ b/Dataform/src/V1beta1/DeleteWorkflowConfigRequest.php @@ -20,7 +20,7 @@ class DeleteWorkflowConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The workflow config's name. Please see diff --git a/Dataform/src/V1beta1/DeleteWorkflowInvocationRequest.php b/Dataform/src/V1beta1/DeleteWorkflowInvocationRequest.php index c38e09e0fd30..bfd061a26936 100644 --- a/Dataform/src/V1beta1/DeleteWorkflowInvocationRequest.php +++ b/Dataform/src/V1beta1/DeleteWorkflowInvocationRequest.php @@ -20,7 +20,7 @@ class DeleteWorkflowInvocationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The workflow invocation resource's name. Please see diff --git a/Dataform/src/V1beta1/DeleteWorkspaceRequest.php b/Dataform/src/V1beta1/DeleteWorkspaceRequest.php index cf1d7fdb6167..bf2989f15dd4 100644 --- a/Dataform/src/V1beta1/DeleteWorkspaceRequest.php +++ b/Dataform/src/V1beta1/DeleteWorkspaceRequest.php @@ -20,7 +20,7 @@ class DeleteWorkspaceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The workspace resource's name. Please see diff --git a/Dataform/src/V1beta1/FetchFileDiffRequest.php b/Dataform/src/V1beta1/FetchFileDiffRequest.php index cc05bd4795b0..2e5e46755d5b 100644 --- a/Dataform/src/V1beta1/FetchFileDiffRequest.php +++ b/Dataform/src/V1beta1/FetchFileDiffRequest.php @@ -20,14 +20,14 @@ class FetchFileDiffRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $workspace = ''; + protected $workspace = ''; /** * Required. The file's full path including filename, relative to the * workspace root. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $path = ''; + protected $path = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/FetchFileDiffResponse.php b/Dataform/src/V1beta1/FetchFileDiffResponse.php index 889e88955d4c..a6f86b5d5a6a 100644 --- a/Dataform/src/V1beta1/FetchFileDiffResponse.php +++ b/Dataform/src/V1beta1/FetchFileDiffResponse.php @@ -20,7 +20,7 @@ class FetchFileDiffResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string formatted_diff = 1; */ - private $formatted_diff = ''; + protected $formatted_diff = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/FetchFileGitStatusesRequest.php b/Dataform/src/V1beta1/FetchFileGitStatusesRequest.php index 2986b1e1f9a7..842203ba1a95 100644 --- a/Dataform/src/V1beta1/FetchFileGitStatusesRequest.php +++ b/Dataform/src/V1beta1/FetchFileGitStatusesRequest.php @@ -20,7 +20,7 @@ class FetchFileGitStatusesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/FetchFileGitStatusesResponse/UncommittedFileChange.php b/Dataform/src/V1beta1/FetchFileGitStatusesResponse/UncommittedFileChange.php index 296676b03eb7..ae942c2f6a33 100644 --- a/Dataform/src/V1beta1/FetchFileGitStatusesResponse/UncommittedFileChange.php +++ b/Dataform/src/V1beta1/FetchFileGitStatusesResponse/UncommittedFileChange.php @@ -20,13 +20,13 @@ class UncommittedFileChange extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string path = 1; */ - private $path = ''; + protected $path = ''; /** * Indicates the status of the file. * * Generated from protobuf field .google.cloud.dataform.v1beta1.FetchFileGitStatusesResponse.UncommittedFileChange.State state = 2; */ - private $state = 0; + protected $state = 0; /** * Constructor. diff --git a/Dataform/src/V1beta1/FetchGitAheadBehindRequest.php b/Dataform/src/V1beta1/FetchGitAheadBehindRequest.php index a3c29f29bf0e..93f52b15bed5 100644 --- a/Dataform/src/V1beta1/FetchGitAheadBehindRequest.php +++ b/Dataform/src/V1beta1/FetchGitAheadBehindRequest.php @@ -20,7 +20,7 @@ class FetchGitAheadBehindRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The name of the branch in the Git remote against which this * workspace should be compared. If left unset, the repository's default @@ -28,7 +28,7 @@ class FetchGitAheadBehindRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string remote_branch = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $remote_branch = ''; + protected $remote_branch = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/FetchGitAheadBehindResponse.php b/Dataform/src/V1beta1/FetchGitAheadBehindResponse.php index ebc89f4649d3..27b1b288d80d 100644 --- a/Dataform/src/V1beta1/FetchGitAheadBehindResponse.php +++ b/Dataform/src/V1beta1/FetchGitAheadBehindResponse.php @@ -20,13 +20,13 @@ class FetchGitAheadBehindResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 commits_ahead = 1; */ - private $commits_ahead = 0; + protected $commits_ahead = 0; /** * The number of commits in the workspace that are not in the remote branch. * * Generated from protobuf field int32 commits_behind = 2; */ - private $commits_behind = 0; + protected $commits_behind = 0; /** * Constructor. diff --git a/Dataform/src/V1beta1/FetchRemoteBranchesRequest.php b/Dataform/src/V1beta1/FetchRemoteBranchesRequest.php index a35025321fb3..68515930cd47 100644 --- a/Dataform/src/V1beta1/FetchRemoteBranchesRequest.php +++ b/Dataform/src/V1beta1/FetchRemoteBranchesRequest.php @@ -20,7 +20,7 @@ class FetchRemoteBranchesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/FetchRepositoryHistoryRequest.php b/Dataform/src/V1beta1/FetchRepositoryHistoryRequest.php index e6b96a722734..8c4f62a23b8c 100644 --- a/Dataform/src/V1beta1/FetchRepositoryHistoryRequest.php +++ b/Dataform/src/V1beta1/FetchRepositoryHistoryRequest.php @@ -20,7 +20,7 @@ class FetchRepositoryHistoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. Maximum number of commits to return. The server may return fewer * items than requested. If unspecified, the server will pick an appropriate @@ -28,7 +28,7 @@ class FetchRepositoryHistoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `FetchRepositoryHistory` * call. Provide this to retrieve the subsequent page. @@ -37,7 +37,7 @@ class FetchRepositoryHistoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/FetchRepositoryHistoryResponse.php b/Dataform/src/V1beta1/FetchRepositoryHistoryResponse.php index c09d457f0061..575423827c89 100644 --- a/Dataform/src/V1beta1/FetchRepositoryHistoryResponse.php +++ b/Dataform/src/V1beta1/FetchRepositoryHistoryResponse.php @@ -27,7 +27,7 @@ class FetchRepositoryHistoryResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/Gapic/DataformGapicClient.php b/Dataform/src/V1beta1/Gapic/DataformGapicClient.php deleted file mode 100644 index 44e09104c9a8..000000000000 --- a/Dataform/src/V1beta1/Gapic/DataformGapicClient.php +++ /dev/null @@ -1,4169 +0,0 @@ -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. - * - * @experimental - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataform\V1beta1\Client\DataformClient}. - */ -class DataformGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dataform.v1beta1.Dataform'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataform.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataform.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $compilationResultNameTemplate; - - private static $locationNameTemplate; - - private static $releaseConfigNameTemplate; - - private static $repositoryNameTemplate; - - private static $secretVersionNameTemplate; - - private static $workflowConfigNameTemplate; - - private static $workflowInvocationNameTemplate; - - private static $workspaceNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/dataform_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/dataform_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/dataform_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/dataform_rest_client_config.php', - ], - ], - ]; - } - - private static function getCompilationResultNameTemplate() - { - if (self::$compilationResultNameTemplate == null) { - self::$compilationResultNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}' - ); - } - - return self::$compilationResultNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}' - ); - } - - return self::$locationNameTemplate; - } - - private static function getReleaseConfigNameTemplate() - { - if (self::$releaseConfigNameTemplate == null) { - self::$releaseConfigNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}/releaseConfigs/{release_config}' - ); - } - - return self::$releaseConfigNameTemplate; - } - - private static function getRepositoryNameTemplate() - { - if (self::$repositoryNameTemplate == null) { - self::$repositoryNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}' - ); - } - - return self::$repositoryNameTemplate; - } - - private static function getSecretVersionNameTemplate() - { - if (self::$secretVersionNameTemplate == null) { - self::$secretVersionNameTemplate = new PathTemplate( - 'projects/{project}/secrets/{secret}/versions/{version}' - ); - } - - return self::$secretVersionNameTemplate; - } - - private static function getWorkflowConfigNameTemplate() - { - if (self::$workflowConfigNameTemplate == null) { - self::$workflowConfigNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}/workflowConfigs/{workflow_config}' - ); - } - - return self::$workflowConfigNameTemplate; - } - - private static function getWorkflowInvocationNameTemplate() - { - if (self::$workflowInvocationNameTemplate == null) { - self::$workflowInvocationNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}' - ); - } - - return self::$workflowInvocationNameTemplate; - } - - private static function getWorkspaceNameTemplate() - { - if (self::$workspaceNameTemplate == null) { - self::$workspaceNameTemplate = new PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}' - ); - } - - return self::$workspaceNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'compilationResult' => self::getCompilationResultNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'releaseConfig' => self::getReleaseConfigNameTemplate(), - 'repository' => self::getRepositoryNameTemplate(), - 'secretVersion' => self::getSecretVersionNameTemplate(), - 'workflowConfig' => self::getWorkflowConfigNameTemplate(), - 'workflowInvocation' => self::getWorkflowInvocationNameTemplate(), - 'workspace' => self::getWorkspaceNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * compilation_result resource. - * - * @param string $project - * @param string $location - * @param string $repository - * @param string $compilationResult - * - * @return string The formatted compilation_result resource. - * - * @experimental - */ - public static function compilationResultName( - $project, - $location, - $repository, - $compilationResult - ) { - return self::getCompilationResultNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'repository' => $repository, - 'compilation_result' => $compilationResult, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * release_config resource. - * - * @param string $project - * @param string $location - * @param string $repository - * @param string $releaseConfig - * - * @return string The formatted release_config resource. - * - * @experimental - */ - public static function releaseConfigName( - $project, - $location, - $repository, - $releaseConfig - ) { - return self::getReleaseConfigNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'repository' => $repository, - 'release_config' => $releaseConfig, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a repository - * resource. - * - * @param string $project - * @param string $location - * @param string $repository - * - * @return string The formatted repository resource. - * - * @experimental - */ - public static function repositoryName($project, $location, $repository) - { - return self::getRepositoryNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'repository' => $repository, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * secret_version resource. - * - * @param string $project - * @param string $secret - * @param string $version - * - * @return string The formatted secret_version resource. - * - * @experimental - */ - public static function secretVersionName($project, $secret, $version) - { - return self::getSecretVersionNameTemplate()->render([ - 'project' => $project, - 'secret' => $secret, - 'version' => $version, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * workflow_config resource. - * - * @param string $project - * @param string $location - * @param string $repository - * @param string $workflowConfig - * - * @return string The formatted workflow_config resource. - * - * @experimental - */ - public static function workflowConfigName( - $project, - $location, - $repository, - $workflowConfig - ) { - return self::getWorkflowConfigNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'repository' => $repository, - 'workflow_config' => $workflowConfig, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * workflow_invocation resource. - * - * @param string $project - * @param string $location - * @param string $repository - * @param string $workflowInvocation - * - * @return string The formatted workflow_invocation resource. - * - * @experimental - */ - public static function workflowInvocationName( - $project, - $location, - $repository, - $workflowInvocation - ) { - return self::getWorkflowInvocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'repository' => $repository, - 'workflow_invocation' => $workflowInvocation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a workspace - * resource. - * - * @param string $project - * @param string $location - * @param string $repository - * @param string $workspace - * - * @return string The formatted workspace resource. - * - * @experimental - */ - public static function workspaceName( - $project, - $location, - $repository, - $workspace - ) { - return self::getWorkspaceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'repository' => $repository, - 'workspace' => $workspace, - ]); - } - - /** - * 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. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException( - "Template name $template does not exist" - ); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException( - "Input did not match any known format. Input: $formattedName" - ); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataform.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * 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 - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * 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. - * @type string|TransportInterface $transport - * 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 {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * 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 {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * 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. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Requests cancellation of a running WorkflowInvocation. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - * $dataformClient->cancelWorkflowInvocation($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workflow invocation resource's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function cancelWorkflowInvocation($name, array $optionalArgs = []) - { - $request = new CancelWorkflowInvocationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CancelWorkflowInvocation', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Applies a Git commit to a Repository. The Repository must not have a value - * for `git_remote_settings.url`. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $commitMetadata = new CommitMetadata(); - * $dataformClient->commitRepositoryChanges($formattedName, $commitMetadata); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The repository's name. - * @param CommitMetadata $commitMetadata Required. The changes to commit to the repository. - * @param array $optionalArgs { - * Optional. - * - * @type string $requiredHeadCommitSha - * 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. - * @type array $fileOperations - * A map to the path of the file to the operation. The path is the full file - * path including filename, from repository root. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function commitRepositoryChanges( - $name, - $commitMetadata, - array $optionalArgs = [] - ) { - $request = new CommitRepositoryChangesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setCommitMetadata($commitMetadata); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requiredHeadCommitSha'])) { - $request->setRequiredHeadCommitSha( - $optionalArgs['requiredHeadCommitSha'] - ); - } - - if (isset($optionalArgs['fileOperations'])) { - $request->setFileOperations($optionalArgs['fileOperations']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CommitRepositoryChanges', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Applies a Git commit for uncommitted files in a Workspace. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $author = new CommitAuthor(); - * $dataformClient->commitWorkspaceChanges($formattedName, $author); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workspace's name. - * @param CommitAuthor $author Required. The commit's author. - * @param array $optionalArgs { - * Optional. - * - * @type string $commitMessage - * Optional. The commit's message. - * @type string[] $paths - * Optional. Full file paths to commit including filename, rooted at workspace - * root. If left empty, all files will be committed. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function commitWorkspaceChanges( - $name, - $author, - array $optionalArgs = [] - ) { - $request = new CommitWorkspaceChangesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setAuthor($author); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['commitMessage'])) { - $request->setCommitMessage($optionalArgs['commitMessage']); - } - - if (isset($optionalArgs['paths'])) { - $request->setPaths($optionalArgs['paths']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CommitWorkspaceChanges', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Computes a Repository's Git access token status. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $response = $dataformClient->computeRepositoryAccessTokenStatus($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The repository's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\ComputeRepositoryAccessTokenStatusResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function computeRepositoryAccessTokenStatus( - $name, - array $optionalArgs = [] - ) { - $request = new ComputeRepositoryAccessTokenStatusRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ComputeRepositoryAccessTokenStatus', - ComputeRepositoryAccessTokenStatusResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a new CompilationResult in a given project and location. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $compilationResult = new CompilationResult(); - * $response = $dataformClient->createCompilationResult($formattedParent, $compilationResult); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The repository in which to create the compilation result. Must be - * in the format `projects/*/locations/*/repositories/*`. - * @param CompilationResult $compilationResult Required. The compilation result to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\CompilationResult - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createCompilationResult( - $parent, - $compilationResult, - array $optionalArgs = [] - ) { - $request = new CreateCompilationResultRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setCompilationResult($compilationResult); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateCompilationResult', - CompilationResult::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a new ReleaseConfig in a given Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $releaseConfig = new ReleaseConfig(); - * $releaseConfigId = 'release_config_id'; - * $response = $dataformClient->createReleaseConfig($formattedParent, $releaseConfig, $releaseConfigId); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The repository in which to create the release config. Must be in - * the format `projects/*/locations/*/repositories/*`. - * @param ReleaseConfig $releaseConfig Required. The release config to create. - * @param string $releaseConfigId Required. The ID to use for the release config, which will become the final - * component of the release config's resource name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\ReleaseConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createReleaseConfig( - $parent, - $releaseConfig, - $releaseConfigId, - array $optionalArgs = [] - ) { - $request = new CreateReleaseConfigRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setReleaseConfig($releaseConfig); - $request->setReleaseConfigId($releaseConfigId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateReleaseConfig', - ReleaseConfig::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a new Repository in a given project and location. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->locationName('[PROJECT]', '[LOCATION]'); - * $repository = new Repository(); - * $repositoryId = 'repository_id'; - * $response = $dataformClient->createRepository($formattedParent, $repository, $repositoryId); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The location in which to create the repository. Must be in the - * format `projects/*/locations/*`. - * @param Repository $repository Required. The repository to create. - * @param string $repositoryId Required. The ID to use for the repository, which will become the final - * component of the repository's resource name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\Repository - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createRepository( - $parent, - $repository, - $repositoryId, - array $optionalArgs = [] - ) { - $request = new CreateRepositoryRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRepository($repository); - $request->setRepositoryId($repositoryId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateRepository', - Repository::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a new WorkflowConfig in a given Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $workflowConfig = new WorkflowConfig(); - * $workflowConfigId = 'workflow_config_id'; - * $response = $dataformClient->createWorkflowConfig($formattedParent, $workflowConfig, $workflowConfigId); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The repository in which to create the workflow config. Must be in - * the format `projects/*/locations/*/repositories/*`. - * @param WorkflowConfig $workflowConfig Required. The workflow config to create. - * @param string $workflowConfigId Required. The ID to use for the workflow config, which will become the - * final component of the workflow config's resource name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\WorkflowConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createWorkflowConfig( - $parent, - $workflowConfig, - $workflowConfigId, - array $optionalArgs = [] - ) { - $request = new CreateWorkflowConfigRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setWorkflowConfig($workflowConfig); - $request->setWorkflowConfigId($workflowConfigId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateWorkflowConfig', - WorkflowConfig::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a new WorkflowInvocation in a given Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $workflowInvocation = new WorkflowInvocation(); - * $response = $dataformClient->createWorkflowInvocation($formattedParent, $workflowInvocation); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The repository in which to create the workflow invocation. Must - * be in the format `projects/*/locations/*/repositories/*`. - * @param WorkflowInvocation $workflowInvocation Required. The workflow invocation resource to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\WorkflowInvocation - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createWorkflowInvocation( - $parent, - $workflowInvocation, - array $optionalArgs = [] - ) { - $request = new CreateWorkflowInvocationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setWorkflowInvocation($workflowInvocation); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateWorkflowInvocation', - WorkflowInvocation::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a new Workspace in a given Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $workspace = new Workspace(); - * $workspaceId = 'workspace_id'; - * $response = $dataformClient->createWorkspace($formattedParent, $workspace, $workspaceId); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The repository in which to create the workspace. Must be in the - * format `projects/*/locations/*/repositories/*`. - * @param Workspace $workspace Required. The workspace to create. - * @param string $workspaceId Required. The ID to use for the workspace, which will become the final - * component of the workspace's resource name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\Workspace - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createWorkspace( - $parent, - $workspace, - $workspaceId, - array $optionalArgs = [] - ) { - $request = new CreateWorkspaceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setWorkspace($workspace); - $request->setWorkspaceId($workspaceId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateWorkspace', - Workspace::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a single ReleaseConfig. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - * $dataformClient->deleteReleaseConfig($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The release config's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteReleaseConfig($name, array $optionalArgs = []) - { - $request = new DeleteReleaseConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteReleaseConfig', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a single Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $dataformClient->deleteRepository($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The repository's name. - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * 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.) - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteRepository($name, array $optionalArgs = []) - { - $request = new DeleteRepositoryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteRepository', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a single WorkflowConfig. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workflowConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_CONFIG]'); - * $dataformClient->deleteWorkflowConfig($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workflow config's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteWorkflowConfig($name, array $optionalArgs = []) - { - $request = new DeleteWorkflowConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteWorkflowConfig', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a single WorkflowInvocation. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - * $dataformClient->deleteWorkflowInvocation($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workflow invocation resource's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteWorkflowInvocation($name, array $optionalArgs = []) - { - $request = new DeleteWorkflowInvocationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteWorkflowInvocation', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a single Workspace. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $dataformClient->deleteWorkspace($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workspace resource's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteWorkspace($name, array $optionalArgs = []) - { - $request = new DeleteWorkspaceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteWorkspace', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Fetches Git diff for an uncommitted file in a Workspace. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedWorkspace = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $path = 'path'; - * $response = $dataformClient->fetchFileDiff($formattedWorkspace, $path); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $workspace Required. The workspace's name. - * @param string $path Required. The file's full path including filename, relative to the - * workspace root. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\FetchFileDiffResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function fetchFileDiff($workspace, $path, array $optionalArgs = []) - { - $request = new FetchFileDiffRequest(); - $requestParamHeaders = []; - $request->setWorkspace($workspace); - $request->setPath($path); - $requestParamHeaders['workspace'] = $workspace; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'FetchFileDiff', - FetchFileDiffResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Fetches Git statuses for the files in a Workspace. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $response = $dataformClient->fetchFileGitStatuses($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workspace's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\FetchFileGitStatusesResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function fetchFileGitStatuses($name, array $optionalArgs = []) - { - $request = new FetchFileGitStatusesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'FetchFileGitStatuses', - FetchFileGitStatusesResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Fetches Git ahead/behind against a remote branch. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $response = $dataformClient->fetchGitAheadBehind($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workspace's name. - * @param array $optionalArgs { - * Optional. - * - * @type string $remoteBranch - * 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. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\FetchGitAheadBehindResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function fetchGitAheadBehind($name, array $optionalArgs = []) - { - $request = new FetchGitAheadBehindRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['remoteBranch'])) { - $request->setRemoteBranch($optionalArgs['remoteBranch']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'FetchGitAheadBehind', - FetchGitAheadBehindResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Fetches a Repository's remote branches. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $response = $dataformClient->fetchRemoteBranches($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The repository's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\FetchRemoteBranchesResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function fetchRemoteBranches($name, array $optionalArgs = []) - { - $request = new FetchRemoteBranchesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'FetchRemoteBranches', - FetchRemoteBranchesResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Fetches a Repository's history of commits. The Repository must not have a - * value for `git_remote_settings.url`. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->fetchRepositoryHistory($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->fetchRepositoryHistory($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The repository's name. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function fetchRepositoryHistory($name, array $optionalArgs = []) - { - $request = new FetchRepositoryHistoryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'FetchRepositoryHistory', - $optionalArgs, - FetchRepositoryHistoryResponse::class, - $request - ); - } - - /** - * Fetches a single CompilationResult. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->compilationResultName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[COMPILATION_RESULT]'); - * $response = $dataformClient->getCompilationResult($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The compilation result's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\CompilationResult - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getCompilationResult($name, array $optionalArgs = []) - { - $request = new GetCompilationResultRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetCompilationResult', - CompilationResult::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Fetches a single ReleaseConfig. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - * $response = $dataformClient->getReleaseConfig($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The release config's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\ReleaseConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getReleaseConfig($name, array $optionalArgs = []) - { - $request = new GetReleaseConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetReleaseConfig', - ReleaseConfig::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Fetches a single Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $response = $dataformClient->getRepository($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The repository's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\Repository - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getRepository($name, array $optionalArgs = []) - { - $request = new GetRepositoryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetRepository', - Repository::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Fetches a single WorkflowConfig. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workflowConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_CONFIG]'); - * $response = $dataformClient->getWorkflowConfig($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workflow config's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\WorkflowConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getWorkflowConfig($name, array $optionalArgs = []) - { - $request = new GetWorkflowConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetWorkflowConfig', - WorkflowConfig::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Fetches a single WorkflowInvocation. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - * $response = $dataformClient->getWorkflowInvocation($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workflow invocation resource's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\WorkflowInvocation - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getWorkflowInvocation($name, array $optionalArgs = []) - { - $request = new GetWorkflowInvocationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetWorkflowInvocation', - WorkflowInvocation::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Fetches a single Workspace. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $response = $dataformClient->getWorkspace($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workspace's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\Workspace - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getWorkspace($name, array $optionalArgs = []) - { - $request = new GetWorkspaceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetWorkspace', - Workspace::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Installs dependency NPM packages (inside a Workspace). - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedWorkspace = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $response = $dataformClient->installNpmPackages($formattedWorkspace); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $workspace Required. The workspace's name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\InstallNpmPackagesResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function installNpmPackages($workspace, array $optionalArgs = []) - { - $request = new InstallNpmPackagesRequest(); - $requestParamHeaders = []; - $request->setWorkspace($workspace); - $requestParamHeaders['workspace'] = $workspace; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'InstallNpmPackages', - InstallNpmPackagesResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists CompilationResults in a given Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->listCompilationResults($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->listCompilationResults($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The repository in which to list compilation results. Must be in - * the format `projects/*/locations/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listCompilationResults($parent, array $optionalArgs = []) - { - $request = new ListCompilationResultsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListCompilationResults', - $optionalArgs, - ListCompilationResultsResponse::class, - $request - ); - } - - /** - * Lists ReleaseConfigs in a given Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->listReleaseConfigs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->listReleaseConfigs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The repository in which to list release configs. Must be in the - * format `projects/*/locations/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listReleaseConfigs($parent, array $optionalArgs = []) - { - $request = new ListReleaseConfigsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListReleaseConfigs', - $optionalArgs, - ListReleaseConfigsResponse::class, - $request - ); - } - - /** - * Lists Repositories in a given project and location. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->listRepositories($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->listRepositories($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The location in which to list repositories. Must be in the format - * `projects/*/locations/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type string $orderBy - * 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. - * @type string $filter - * Optional. Filter for the returned list. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listRepositories($parent, array $optionalArgs = []) - { - $request = new ListRepositoriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListRepositories', - $optionalArgs, - ListRepositoriesResponse::class, - $request - ); - } - - /** - * Lists WorkflowConfigs in a given Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->listWorkflowConfigs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->listWorkflowConfigs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The repository in which to list workflow configs. Must be in the - * format `projects/*/locations/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listWorkflowConfigs($parent, array $optionalArgs = []) - { - $request = new ListWorkflowConfigsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListWorkflowConfigs', - $optionalArgs, - ListWorkflowConfigsResponse::class, - $request - ); - } - - /** - * Lists WorkflowInvocations in a given Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->listWorkflowInvocations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->listWorkflowInvocations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource of the WorkflowInvocation type. Must be in - * the format `projects/*/locations/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type string $orderBy - * 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. - * @type string $filter - * Optional. Filter for the returned list. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listWorkflowInvocations($parent, array $optionalArgs = []) - { - $request = new ListWorkflowInvocationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListWorkflowInvocations', - $optionalArgs, - ListWorkflowInvocationsResponse::class, - $request - ); - } - - /** - * Lists Workspaces in a given Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedParent = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->listWorkspaces($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->listWorkspaces($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $parent Required. The repository in which to list workspaces. Must be in the - * format `projects/*/locations/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type string $orderBy - * 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. - * @type string $filter - * Optional. Filter for the returned list. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listWorkspaces($parent, array $optionalArgs = []) - { - $request = new ListWorkspacesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListWorkspaces', - $optionalArgs, - ListWorkspacesResponse::class, - $request - ); - } - - /** - * Creates a directory inside a Workspace. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedWorkspace = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $path = 'path'; - * $response = $dataformClient->makeDirectory($formattedWorkspace, $path); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $workspace Required. The workspace's name. - * @param string $path Required. The directory's full path including directory name, relative to - * the workspace root. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\MakeDirectoryResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function makeDirectory($workspace, $path, array $optionalArgs = []) - { - $request = new MakeDirectoryRequest(); - $requestParamHeaders = []; - $request->setWorkspace($workspace); - $request->setPath($path); - $requestParamHeaders['workspace'] = $workspace; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'MakeDirectory', - MakeDirectoryResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Moves a directory (inside a Workspace), and all of its contents, to a new - * location. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedWorkspace = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $path = 'path'; - * $newPath = 'new_path'; - * $response = $dataformClient->moveDirectory($formattedWorkspace, $path, $newPath); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $workspace Required. The workspace's name. - * @param string $path Required. The directory's full path including directory name, relative to - * the workspace root. - * @param string $newPath Required. The new path for the directory including directory name, rooted - * at workspace root. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\MoveDirectoryResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function moveDirectory( - $workspace, - $path, - $newPath, - array $optionalArgs = [] - ) { - $request = new MoveDirectoryRequest(); - $requestParamHeaders = []; - $request->setWorkspace($workspace); - $request->setPath($path); - $request->setNewPath($newPath); - $requestParamHeaders['workspace'] = $workspace; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'MoveDirectory', - MoveDirectoryResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Moves a file (inside a Workspace) to a new location. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedWorkspace = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $path = 'path'; - * $newPath = 'new_path'; - * $response = $dataformClient->moveFile($formattedWorkspace, $path, $newPath); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $workspace Required. The workspace's name. - * @param string $path Required. The file's full path including filename, relative to the - * workspace root. - * @param string $newPath Required. The file's new path including filename, relative to the workspace - * root. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\MoveFileResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function moveFile( - $workspace, - $path, - $newPath, - array $optionalArgs = [] - ) { - $request = new MoveFileRequest(); - $requestParamHeaders = []; - $request->setWorkspace($workspace); - $request->setPath($path); - $request->setNewPath($newPath); - $requestParamHeaders['workspace'] = $workspace; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'MoveFile', - MoveFileResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Pulls Git commits from the Repository's remote into a Workspace. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $author = new CommitAuthor(); - * $dataformClient->pullGitCommits($formattedName, $author); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workspace's name. - * @param CommitAuthor $author Required. The author of any merge commit which may be created as a result - * of merging fetched Git commits into this workspace. - * @param array $optionalArgs { - * Optional. - * - * @type string $remoteBranch - * 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. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function pullGitCommits($name, $author, array $optionalArgs = []) - { - $request = new PullGitCommitsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setAuthor($author); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['remoteBranch'])) { - $request->setRemoteBranch($optionalArgs['remoteBranch']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'PullGitCommits', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Pushes Git commits from a Workspace to the Repository's remote. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $dataformClient->pushGitCommits($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workspace's name. - * @param array $optionalArgs { - * Optional. - * - * @type string $remoteBranch - * 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. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function pushGitCommits($name, array $optionalArgs = []) - { - $request = new PushGitCommitsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['remoteBranch'])) { - $request->setRemoteBranch($optionalArgs['remoteBranch']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'PushGitCommits', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Returns CompilationResultActions in a given CompilationResult. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->compilationResultName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[COMPILATION_RESULT]'); - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->queryCompilationResultActions($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->queryCompilationResultActions($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The compilation result's name. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type string $filter - * Optional. Optional filter for the returned list. Filtering is only - * currently supported on the `file_path` field. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function queryCompilationResultActions( - $name, - array $optionalArgs = [] - ) { - $request = new QueryCompilationResultActionsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'QueryCompilationResultActions', - $optionalArgs, - QueryCompilationResultActionsResponse::class, - $request - ); - } - - /** - * Returns the contents of a given Workspace directory. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedWorkspace = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->queryDirectoryContents($formattedWorkspace); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->queryDirectoryContents($formattedWorkspace); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $workspace Required. The workspace's name. - * @param array $optionalArgs { - * Optional. - * - * @type string $path - * Optional. The directory's full path including directory name, relative to - * the workspace root. If left unset, the workspace root is used. - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function queryDirectoryContents($workspace, array $optionalArgs = []) - { - $request = new QueryDirectoryContentsRequest(); - $requestParamHeaders = []; - $request->setWorkspace($workspace); - $requestParamHeaders['workspace'] = $workspace; - if (isset($optionalArgs['path'])) { - $request->setPath($optionalArgs['path']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'QueryDirectoryContents', - $optionalArgs, - QueryDirectoryContentsResponse::class, - $request - ); - } - - /** - * Returns the contents of a given Repository directory. The Repository must - * not have a value for `git_remote_settings.url`. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->queryRepositoryDirectoryContents($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->queryRepositoryDirectoryContents($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The repository's name. - * @param array $optionalArgs { - * Optional. - * - * @type string $commitSha - * Optional. The Commit SHA for the commit to query from. If unset, the - * directory will be queried from HEAD. - * @type string $path - * Optional. The directory's full path including directory name, relative to - * root. If left unset, the root is used. - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function queryRepositoryDirectoryContents( - $name, - array $optionalArgs = [] - ) { - $request = new QueryRepositoryDirectoryContentsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['commitSha'])) { - $request->setCommitSha($optionalArgs['commitSha']); - } - - if (isset($optionalArgs['path'])) { - $request->setPath($optionalArgs['path']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'QueryRepositoryDirectoryContents', - $optionalArgs, - QueryRepositoryDirectoryContentsResponse::class, - $request - ); - } - - /** - * Returns WorkflowInvocationActions in a given WorkflowInvocation. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->queryWorkflowInvocationActions($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->queryWorkflowInvocationActions($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workflow invocation's name. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function queryWorkflowInvocationActions( - $name, - array $optionalArgs = [] - ) { - $request = new QueryWorkflowInvocationActionsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'QueryWorkflowInvocationActions', - $optionalArgs, - QueryWorkflowInvocationActionsResponse::class, - $request - ); - } - - /** - * Returns the contents of a file (inside a Workspace). - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedWorkspace = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $path = 'path'; - * $response = $dataformClient->readFile($formattedWorkspace, $path); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $workspace Required. The workspace's name. - * @param string $path Required. The file's full path including filename, relative to the - * workspace root. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\ReadFileResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function readFile($workspace, $path, array $optionalArgs = []) - { - $request = new ReadFileRequest(); - $requestParamHeaders = []; - $request->setWorkspace($workspace); - $request->setPath($path); - $requestParamHeaders['workspace'] = $workspace; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ReadFile', - ReadFileResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Returns the contents of a file (inside a Repository). The Repository - * must not have a value for `git_remote_settings.url`. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $path = 'path'; - * $response = $dataformClient->readRepositoryFile($formattedName, $path); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The repository's name. - * @param string $path Required. Full file path to read including filename, from repository root. - * @param array $optionalArgs { - * Optional. - * - * @type string $commitSha - * Optional. The commit SHA for the commit to read from. If unset, the file - * will be read from HEAD. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\ReadRepositoryFileResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function readRepositoryFile($name, $path, array $optionalArgs = []) - { - $request = new ReadRepositoryFileRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setPath($path); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['commitSha'])) { - $request->setCommitSha($optionalArgs['commitSha']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ReadRepositoryFile', - ReadRepositoryFileResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a directory (inside a Workspace) and all of its contents. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedWorkspace = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $path = 'path'; - * $dataformClient->removeDirectory($formattedWorkspace, $path); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $workspace Required. The workspace's name. - * @param string $path Required. The directory's full path including directory name, relative to - * the workspace root. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function removeDirectory($workspace, $path, array $optionalArgs = []) - { - $request = new RemoveDirectoryRequest(); - $requestParamHeaders = []; - $request->setWorkspace($workspace); - $request->setPath($path); - $requestParamHeaders['workspace'] = $workspace; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'RemoveDirectory', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Deletes a file (inside a Workspace). - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedWorkspace = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $path = 'path'; - * $dataformClient->removeFile($formattedWorkspace, $path); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $workspace Required. The workspace's name. - * @param string $path Required. The file's full path including filename, relative to the - * workspace root. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function removeFile($workspace, $path, array $optionalArgs = []) - { - $request = new RemoveFileRequest(); - $requestParamHeaders = []; - $request->setWorkspace($workspace); - $request->setPath($path); - $requestParamHeaders['workspace'] = $workspace; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'RemoveFile', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Performs a Git reset for uncommitted files in a Workspace. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedName = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $dataformClient->resetWorkspaceChanges($formattedName); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $name Required. The workspace's name. - * @param array $optionalArgs { - * Optional. - * - * @type string[] $paths - * 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. - * @type bool $clean - * Optional. If set to true, untracked files will be deleted. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function resetWorkspaceChanges($name, array $optionalArgs = []) - { - $request = new ResetWorkspaceChangesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['paths'])) { - $request->setPaths($optionalArgs['paths']); - } - - if (isset($optionalArgs['clean'])) { - $request->setClean($optionalArgs['clean']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ResetWorkspaceChanges', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates a single ReleaseConfig. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $releaseConfig = new ReleaseConfig(); - * $response = $dataformClient->updateReleaseConfig($releaseConfig); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param ReleaseConfig $releaseConfig Required. The release config to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Specifies the fields to be updated in the release config. If left - * unset, all fields will be updated. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\ReleaseConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateReleaseConfig( - $releaseConfig, - array $optionalArgs = [] - ) { - $request = new UpdateReleaseConfigRequest(); - $requestParamHeaders = []; - $request->setReleaseConfig($releaseConfig); - $requestParamHeaders['release_config.name'] = $releaseConfig->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateReleaseConfig', - ReleaseConfig::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates a single Repository. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $repository = new Repository(); - * $response = $dataformClient->updateRepository($repository); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param Repository $repository Required. The repository to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Specifies the fields to be updated in the repository. If left - * unset, all fields will be updated. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\Repository - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateRepository($repository, array $optionalArgs = []) - { - $request = new UpdateRepositoryRequest(); - $requestParamHeaders = []; - $request->setRepository($repository); - $requestParamHeaders['repository.name'] = $repository->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateRepository', - Repository::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates a single WorkflowConfig. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $workflowConfig = new WorkflowConfig(); - * $response = $dataformClient->updateWorkflowConfig($workflowConfig); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param WorkflowConfig $workflowConfig Required. The workflow config to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Specifies the fields to be updated in the workflow config. If - * left unset, all fields will be updated. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\WorkflowConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateWorkflowConfig( - $workflowConfig, - array $optionalArgs = [] - ) { - $request = new UpdateWorkflowConfigRequest(); - $requestParamHeaders = []; - $request->setWorkflowConfig($workflowConfig); - $requestParamHeaders[ - 'workflow_config.name' - ] = $workflowConfig->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateWorkflowConfig', - WorkflowConfig::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Writes to a file (inside a Workspace). - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $formattedWorkspace = $dataformClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - * $path = 'path'; - * $contents = '...'; - * $response = $dataformClient->writeFile($formattedWorkspace, $path, $contents); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $workspace Required. The workspace's name. - * @param string $path Required. The file. - * @param string $contents Required. The file's contents. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataform\V1beta1\WriteFileResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function writeFile( - $workspace, - $path, - $contents, - array $optionalArgs = [] - ) { - $request = new WriteFileRequest(); - $requestParamHeaders = []; - $request->setWorkspace($workspace); - $request->setPath($path); - $request->setContents($contents); - $requestParamHeaders['workspace'] = $workspace; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'WriteFile', - WriteFileResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $response = $dataformClient->getLocation(); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetLocation', - Location::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.cloud.location.Locations' - )->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataformClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataformClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * 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. - * @type string $pageToken - * 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. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListLocations', - $optionalArgs, - ListLocationsResponse::class, - $request, - 'google.cloud.location.Locations' - ); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $resource = 'resource'; - * $response = $dataformClient->getIamPolicy($resource); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataformClient->setIamPolicy($resource, $policy); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $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. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * 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"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * 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. - * - * Sample code: - * ``` - * $dataformClient = new DataformClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataformClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataformClient->close(); - * } - * ``` - * - * @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[] $permissions 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). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } -} diff --git a/Dataform/src/V1beta1/GetCompilationResultRequest.php b/Dataform/src/V1beta1/GetCompilationResultRequest.php index ec14cdd6b36a..ff571e3e3e87 100644 --- a/Dataform/src/V1beta1/GetCompilationResultRequest.php +++ b/Dataform/src/V1beta1/GetCompilationResultRequest.php @@ -20,7 +20,7 @@ class GetCompilationResultRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The compilation result's name. Please see diff --git a/Dataform/src/V1beta1/GetReleaseConfigRequest.php b/Dataform/src/V1beta1/GetReleaseConfigRequest.php index b6257385a754..74e46b386dc0 100644 --- a/Dataform/src/V1beta1/GetReleaseConfigRequest.php +++ b/Dataform/src/V1beta1/GetReleaseConfigRequest.php @@ -20,7 +20,7 @@ class GetReleaseConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The release config's name. Please see diff --git a/Dataform/src/V1beta1/GetRepositoryRequest.php b/Dataform/src/V1beta1/GetRepositoryRequest.php index 5e8493e038dc..faab65436cf9 100644 --- a/Dataform/src/V1beta1/GetRepositoryRequest.php +++ b/Dataform/src/V1beta1/GetRepositoryRequest.php @@ -20,7 +20,7 @@ class GetRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The repository's name. Please see diff --git a/Dataform/src/V1beta1/GetWorkflowConfigRequest.php b/Dataform/src/V1beta1/GetWorkflowConfigRequest.php index 8ac786b11e76..9bf1531c25f2 100644 --- a/Dataform/src/V1beta1/GetWorkflowConfigRequest.php +++ b/Dataform/src/V1beta1/GetWorkflowConfigRequest.php @@ -20,7 +20,7 @@ class GetWorkflowConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The workflow config's name. Please see diff --git a/Dataform/src/V1beta1/GetWorkflowInvocationRequest.php b/Dataform/src/V1beta1/GetWorkflowInvocationRequest.php index 91590b4708e0..f071607835a7 100644 --- a/Dataform/src/V1beta1/GetWorkflowInvocationRequest.php +++ b/Dataform/src/V1beta1/GetWorkflowInvocationRequest.php @@ -20,7 +20,7 @@ class GetWorkflowInvocationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The workflow invocation resource's name. Please see diff --git a/Dataform/src/V1beta1/GetWorkspaceRequest.php b/Dataform/src/V1beta1/GetWorkspaceRequest.php index a3c47482a6b8..e4142c4e3257 100644 --- a/Dataform/src/V1beta1/GetWorkspaceRequest.php +++ b/Dataform/src/V1beta1/GetWorkspaceRequest.php @@ -20,7 +20,7 @@ class GetWorkspaceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The workspace's name. Please see diff --git a/Dataform/src/V1beta1/InstallNpmPackagesRequest.php b/Dataform/src/V1beta1/InstallNpmPackagesRequest.php index 9cfce57c0252..a4f1c0cb7dd3 100644 --- a/Dataform/src/V1beta1/InstallNpmPackagesRequest.php +++ b/Dataform/src/V1beta1/InstallNpmPackagesRequest.php @@ -20,7 +20,7 @@ class InstallNpmPackagesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $workspace = ''; + protected $workspace = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/InvocationConfig.php b/Dataform/src/V1beta1/InvocationConfig.php index 53d83065dcbf..211b217da5cc 100644 --- a/Dataform/src/V1beta1/InvocationConfig.php +++ b/Dataform/src/V1beta1/InvocationConfig.php @@ -35,26 +35,26 @@ class InvocationConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool transitive_dependencies_included = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $transitive_dependencies_included = false; + protected $transitive_dependencies_included = false; /** * Optional. When set to true, transitive dependents of included actions will * be executed. * * Generated from protobuf field bool transitive_dependents_included = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $transitive_dependents_included = false; + protected $transitive_dependents_included = false; /** * Optional. When set to true, any incremental tables will be fully refreshed. * * Generated from protobuf field bool fully_refresh_incremental_tables_enabled = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $fully_refresh_incremental_tables_enabled = false; + protected $fully_refresh_incremental_tables_enabled = false; /** * Optional. The service account to run workflow invocations under. * * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $service_account = ''; + protected $service_account = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/ListCompilationResultsRequest.php b/Dataform/src/V1beta1/ListCompilationResultsRequest.php index 4b393d8f23c5..a8e1ef25e9e5 100644 --- a/Dataform/src/V1beta1/ListCompilationResultsRequest.php +++ b/Dataform/src/V1beta1/ListCompilationResultsRequest.php @@ -21,7 +21,7 @@ class ListCompilationResultsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of compilation results to return. The server may * return fewer items than requested. If unspecified, the server will pick an @@ -29,7 +29,7 @@ class ListCompilationResultsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListCompilationResults` * call. Provide this to retrieve the subsequent page. @@ -38,7 +38,7 @@ class ListCompilationResultsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The repository in which to list compilation results. Must be in diff --git a/Dataform/src/V1beta1/ListCompilationResultsResponse.php b/Dataform/src/V1beta1/ListCompilationResultsResponse.php index 0eba0631d6db..047d9705ca8e 100644 --- a/Dataform/src/V1beta1/ListCompilationResultsResponse.php +++ b/Dataform/src/V1beta1/ListCompilationResultsResponse.php @@ -27,7 +27,7 @@ class ListCompilationResultsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations which could not be reached. * diff --git a/Dataform/src/V1beta1/ListReleaseConfigsRequest.php b/Dataform/src/V1beta1/ListReleaseConfigsRequest.php index 2b3c9ce6a93a..fa586a665868 100644 --- a/Dataform/src/V1beta1/ListReleaseConfigsRequest.php +++ b/Dataform/src/V1beta1/ListReleaseConfigsRequest.php @@ -21,7 +21,7 @@ class ListReleaseConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of release configs to return. The server may * return fewer items than requested. If unspecified, the server will pick an @@ -29,7 +29,7 @@ class ListReleaseConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListReleaseConfigs` call. * Provide this to retrieve the subsequent page. @@ -38,7 +38,7 @@ class ListReleaseConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The repository in which to list release configs. Must be in the diff --git a/Dataform/src/V1beta1/ListReleaseConfigsResponse.php b/Dataform/src/V1beta1/ListReleaseConfigsResponse.php index 580affe17667..4fb328ec2607 100644 --- a/Dataform/src/V1beta1/ListReleaseConfigsResponse.php +++ b/Dataform/src/V1beta1/ListReleaseConfigsResponse.php @@ -27,7 +27,7 @@ class ListReleaseConfigsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations which could not be reached. * diff --git a/Dataform/src/V1beta1/ListRepositoriesRequest.php b/Dataform/src/V1beta1/ListRepositoriesRequest.php index 1cf797eeecce..a5dae8e4b379 100644 --- a/Dataform/src/V1beta1/ListRepositoriesRequest.php +++ b/Dataform/src/V1beta1/ListRepositoriesRequest.php @@ -21,7 +21,7 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of repositories to return. The server may return * fewer items than requested. If unspecified, the server will pick an @@ -29,7 +29,7 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListRepositories` call. * Provide this to retrieve the subsequent page. @@ -38,7 +38,7 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. This field only supports ordering by `name`. If unspecified, the * server will choose the ordering. If specified, the default order is @@ -46,13 +46,13 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * Optional. Filter for the returned list. * * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The location in which to list repositories. Must be in the format diff --git a/Dataform/src/V1beta1/ListRepositoriesResponse.php b/Dataform/src/V1beta1/ListRepositoriesResponse.php index 09bc3fda3b3b..7852d0e1266a 100644 --- a/Dataform/src/V1beta1/ListRepositoriesResponse.php +++ b/Dataform/src/V1beta1/ListRepositoriesResponse.php @@ -27,7 +27,7 @@ class ListRepositoriesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations which could not be reached. * diff --git a/Dataform/src/V1beta1/ListWorkflowConfigsRequest.php b/Dataform/src/V1beta1/ListWorkflowConfigsRequest.php index c847e4a6c024..fa56a0696478 100644 --- a/Dataform/src/V1beta1/ListWorkflowConfigsRequest.php +++ b/Dataform/src/V1beta1/ListWorkflowConfigsRequest.php @@ -21,7 +21,7 @@ class ListWorkflowConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of workflow configs to return. The server may * return fewer items than requested. If unspecified, the server will pick an @@ -29,7 +29,7 @@ class ListWorkflowConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListWorkflowConfigs` call. * Provide this to retrieve the subsequent page. @@ -38,7 +38,7 @@ class ListWorkflowConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The repository in which to list workflow configs. Must be in the diff --git a/Dataform/src/V1beta1/ListWorkflowConfigsResponse.php b/Dataform/src/V1beta1/ListWorkflowConfigsResponse.php index ce1ad359e21a..249a8ff65b5a 100644 --- a/Dataform/src/V1beta1/ListWorkflowConfigsResponse.php +++ b/Dataform/src/V1beta1/ListWorkflowConfigsResponse.php @@ -27,7 +27,7 @@ class ListWorkflowConfigsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations which could not be reached. * diff --git a/Dataform/src/V1beta1/ListWorkflowInvocationsRequest.php b/Dataform/src/V1beta1/ListWorkflowInvocationsRequest.php index d14d46d0ced1..d15e22f557d4 100644 --- a/Dataform/src/V1beta1/ListWorkflowInvocationsRequest.php +++ b/Dataform/src/V1beta1/ListWorkflowInvocationsRequest.php @@ -21,7 +21,7 @@ class ListWorkflowInvocationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of workflow invocations to return. The server may * return fewer items than requested. If unspecified, the server will pick an @@ -29,7 +29,7 @@ class ListWorkflowInvocationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListWorkflowInvocations` * call. Provide this to retrieve the subsequent page. @@ -38,7 +38,7 @@ class ListWorkflowInvocationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. This field only supports ordering by `name`. If unspecified, the * server will choose the ordering. If specified, the default order is @@ -46,13 +46,13 @@ class ListWorkflowInvocationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * Optional. Filter for the returned list. * * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The parent resource of the WorkflowInvocation type. Must be in diff --git a/Dataform/src/V1beta1/ListWorkflowInvocationsResponse.php b/Dataform/src/V1beta1/ListWorkflowInvocationsResponse.php index 9e9888c21868..d9fcb85b2e33 100644 --- a/Dataform/src/V1beta1/ListWorkflowInvocationsResponse.php +++ b/Dataform/src/V1beta1/ListWorkflowInvocationsResponse.php @@ -27,7 +27,7 @@ class ListWorkflowInvocationsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations which could not be reached. * diff --git a/Dataform/src/V1beta1/ListWorkspacesRequest.php b/Dataform/src/V1beta1/ListWorkspacesRequest.php index 459378d72030..37db998b788b 100644 --- a/Dataform/src/V1beta1/ListWorkspacesRequest.php +++ b/Dataform/src/V1beta1/ListWorkspacesRequest.php @@ -21,7 +21,7 @@ class ListWorkspacesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Maximum number of workspaces to return. The server may return * fewer items than requested. If unspecified, the server will pick an @@ -29,7 +29,7 @@ class ListWorkspacesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `ListWorkspaces` call. * Provide this to retrieve the subsequent page. @@ -38,7 +38,7 @@ class ListWorkspacesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. This field only supports ordering by `name`. If unspecified, the * server will choose the ordering. If specified, the default order is @@ -46,13 +46,13 @@ class ListWorkspacesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * Optional. Filter for the returned list. * * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The repository in which to list workspaces. Must be in the diff --git a/Dataform/src/V1beta1/ListWorkspacesResponse.php b/Dataform/src/V1beta1/ListWorkspacesResponse.php index 634437c833e9..54ef94dd2164 100644 --- a/Dataform/src/V1beta1/ListWorkspacesResponse.php +++ b/Dataform/src/V1beta1/ListWorkspacesResponse.php @@ -27,7 +27,7 @@ class ListWorkspacesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations which could not be reached. * diff --git a/Dataform/src/V1beta1/MakeDirectoryRequest.php b/Dataform/src/V1beta1/MakeDirectoryRequest.php index ee203f500333..1be1ded44314 100644 --- a/Dataform/src/V1beta1/MakeDirectoryRequest.php +++ b/Dataform/src/V1beta1/MakeDirectoryRequest.php @@ -20,14 +20,14 @@ class MakeDirectoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $workspace = ''; + protected $workspace = ''; /** * Required. The directory's full path including directory name, relative to * the workspace root. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $path = ''; + protected $path = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/MoveDirectoryRequest.php b/Dataform/src/V1beta1/MoveDirectoryRequest.php index 73e5e7147dd8..df67c6664f69 100644 --- a/Dataform/src/V1beta1/MoveDirectoryRequest.php +++ b/Dataform/src/V1beta1/MoveDirectoryRequest.php @@ -20,21 +20,21 @@ class MoveDirectoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $workspace = ''; + protected $workspace = ''; /** * Required. The directory's full path including directory name, relative to * the workspace root. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $path = ''; + protected $path = ''; /** * Required. The new path for the directory including directory name, rooted * at workspace root. * * Generated from protobuf field string new_path = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $new_path = ''; + protected $new_path = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/MoveFileRequest.php b/Dataform/src/V1beta1/MoveFileRequest.php index b121987a8b36..062b2edca74d 100644 --- a/Dataform/src/V1beta1/MoveFileRequest.php +++ b/Dataform/src/V1beta1/MoveFileRequest.php @@ -20,21 +20,21 @@ class MoveFileRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $workspace = ''; + protected $workspace = ''; /** * Required. The file's full path including filename, relative to the * workspace root. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $path = ''; + protected $path = ''; /** * Required. The file's new path including filename, relative to the workspace * root. * * Generated from protobuf field string new_path = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $new_path = ''; + protected $new_path = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/PullGitCommitsRequest.php b/Dataform/src/V1beta1/PullGitCommitsRequest.php index c8579adf9b14..703bfc89a07e 100644 --- a/Dataform/src/V1beta1/PullGitCommitsRequest.php +++ b/Dataform/src/V1beta1/PullGitCommitsRequest.php @@ -20,21 +20,21 @@ class PullGitCommitsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * 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. * * Generated from protobuf field string remote_branch = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $remote_branch = ''; + protected $remote_branch = ''; /** * Required. The author of any merge commit which may be created as a result * of merging fetched Git commits into this workspace. * * Generated from protobuf field .google.cloud.dataform.v1beta1.CommitAuthor author = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $author = null; + protected $author = null; /** * Constructor. diff --git a/Dataform/src/V1beta1/PushGitCommitsRequest.php b/Dataform/src/V1beta1/PushGitCommitsRequest.php index 330745f284fd..8e781babfedc 100644 --- a/Dataform/src/V1beta1/PushGitCommitsRequest.php +++ b/Dataform/src/V1beta1/PushGitCommitsRequest.php @@ -20,7 +20,7 @@ class PushGitCommitsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * 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 @@ -28,7 +28,7 @@ class PushGitCommitsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string remote_branch = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $remote_branch = ''; + protected $remote_branch = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/QueryCompilationResultActionsRequest.php b/Dataform/src/V1beta1/QueryCompilationResultActionsRequest.php index 851e49b8e04e..ede83f90205b 100644 --- a/Dataform/src/V1beta1/QueryCompilationResultActionsRequest.php +++ b/Dataform/src/V1beta1/QueryCompilationResultActionsRequest.php @@ -20,7 +20,7 @@ class QueryCompilationResultActionsRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. Maximum number of compilation results to return. The server may * return fewer items than requested. If unspecified, the server will pick an @@ -28,7 +28,7 @@ class QueryCompilationResultActionsRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous * `QueryCompilationResultActions` call. Provide this to retrieve the @@ -39,14 +39,14 @@ class QueryCompilationResultActionsRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. Optional filter for the returned list. Filtering is only * currently supported on the `file_path` field. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/QueryCompilationResultActionsResponse.php b/Dataform/src/V1beta1/QueryCompilationResultActionsResponse.php index d1e73f79ac34..b21b880933e5 100644 --- a/Dataform/src/V1beta1/QueryCompilationResultActionsResponse.php +++ b/Dataform/src/V1beta1/QueryCompilationResultActionsResponse.php @@ -27,7 +27,7 @@ class QueryCompilationResultActionsResponse extends \Google\Protobuf\Internal\Me * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/QueryDirectoryContentsRequest.php b/Dataform/src/V1beta1/QueryDirectoryContentsRequest.php index 2bf294765887..a64a1b999780 100644 --- a/Dataform/src/V1beta1/QueryDirectoryContentsRequest.php +++ b/Dataform/src/V1beta1/QueryDirectoryContentsRequest.php @@ -20,14 +20,14 @@ class QueryDirectoryContentsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $workspace = ''; + protected $workspace = ''; /** * Optional. The directory's full path including directory name, relative to * the workspace root. If left unset, the workspace root is used. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $path = ''; + protected $path = ''; /** * Optional. Maximum number of paths to return. The server may return fewer * items than requested. If unspecified, the server will pick an appropriate @@ -35,7 +35,7 @@ class QueryDirectoryContentsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous `QueryDirectoryContents` * call. Provide this to retrieve the subsequent page. @@ -45,7 +45,7 @@ class QueryDirectoryContentsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/QueryDirectoryContentsResponse.php b/Dataform/src/V1beta1/QueryDirectoryContentsResponse.php index ececca616a9e..bc90bc97b0d9 100644 --- a/Dataform/src/V1beta1/QueryDirectoryContentsResponse.php +++ b/Dataform/src/V1beta1/QueryDirectoryContentsResponse.php @@ -27,7 +27,7 @@ class QueryDirectoryContentsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/QueryDirectoryContentsResponse/DirectoryEntry.php b/Dataform/src/V1beta1/QueryDirectoryContentsResponse/DirectoryEntry.php deleted file mode 100644 index 5b1d32cec5e1..000000000000 --- a/Dataform/src/V1beta1/QueryDirectoryContentsResponse/DirectoryEntry.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry - */ -class DirectoryEntry extends \Google\Protobuf\Internal\Message -{ - protected $entry; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $file - * A file in the directory. - * @type string $directory - * A child directory in the directory. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dataform\V1Beta1\Dataform::initOnce(); - parent::__construct($data); - } - - /** - * A file in the directory. - * - * Generated from protobuf field string file = 1; - * @return string - */ - public function getFile() - { - return $this->readOneof(1); - } - - public function hasFile() - { - return $this->hasOneof(1); - } - - /** - * A file in the directory. - * - * Generated from protobuf field string file = 1; - * @param string $var - * @return $this - */ - public function setFile($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * A child directory in the directory. - * - * Generated from protobuf field string directory = 2; - * @return string - */ - public function getDirectory() - { - return $this->readOneof(2); - } - - public function hasDirectory() - { - return $this->hasOneof(2); - } - - /** - * A child directory in the directory. - * - * Generated from protobuf field string directory = 2; - * @param string $var - * @return $this - */ - public function setDirectory($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getEntry() - { - return $this->whichOneof("entry"); - } - -} - - diff --git a/Dataform/src/V1beta1/QueryRepositoryDirectoryContentsRequest.php b/Dataform/src/V1beta1/QueryRepositoryDirectoryContentsRequest.php index a334c34534d7..339d38d10e2d 100644 --- a/Dataform/src/V1beta1/QueryRepositoryDirectoryContentsRequest.php +++ b/Dataform/src/V1beta1/QueryRepositoryDirectoryContentsRequest.php @@ -20,21 +20,21 @@ class QueryRepositoryDirectoryContentsRequest extends \Google\Protobuf\Internal\ * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The Commit SHA for the commit to query from. If unset, the * directory will be queried from HEAD. * * Generated from protobuf field string commit_sha = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $commit_sha = ''; + protected $commit_sha = ''; /** * Optional. The directory's full path including directory name, relative to * root. If left unset, the root is used. * * Generated from protobuf field string path = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $path = ''; + protected $path = ''; /** * Optional. Maximum number of paths to return. The server may return fewer * items than requested. If unspecified, the server will pick an appropriate @@ -42,7 +42,7 @@ class QueryRepositoryDirectoryContentsRequest extends \Google\Protobuf\Internal\ * * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous * `QueryRepositoryDirectoryContents` call. Provide this to retrieve the @@ -53,7 +53,7 @@ class QueryRepositoryDirectoryContentsRequest extends \Google\Protobuf\Internal\ * * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/QueryRepositoryDirectoryContentsResponse.php b/Dataform/src/V1beta1/QueryRepositoryDirectoryContentsResponse.php index 7555290da595..3b9d93ca014f 100644 --- a/Dataform/src/V1beta1/QueryRepositoryDirectoryContentsResponse.php +++ b/Dataform/src/V1beta1/QueryRepositoryDirectoryContentsResponse.php @@ -27,7 +27,7 @@ class QueryRepositoryDirectoryContentsResponse extends \Google\Protobuf\Internal * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/QueryWorkflowInvocationActionsRequest.php b/Dataform/src/V1beta1/QueryWorkflowInvocationActionsRequest.php index fe518c2d9218..251bcb175adf 100644 --- a/Dataform/src/V1beta1/QueryWorkflowInvocationActionsRequest.php +++ b/Dataform/src/V1beta1/QueryWorkflowInvocationActionsRequest.php @@ -20,7 +20,7 @@ class QueryWorkflowInvocationActionsRequest extends \Google\Protobuf\Internal\Me * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. Maximum number of workflow invocations to return. The server may * return fewer items than requested. If unspecified, the server will pick an @@ -28,7 +28,7 @@ class QueryWorkflowInvocationActionsRequest extends \Google\Protobuf\Internal\Me * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token received from a previous * `QueryWorkflowInvocationActions` call. Provide this to retrieve the @@ -39,7 +39,7 @@ class QueryWorkflowInvocationActionsRequest extends \Google\Protobuf\Internal\Me * * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/QueryWorkflowInvocationActionsResponse.php b/Dataform/src/V1beta1/QueryWorkflowInvocationActionsResponse.php index e98b415345f3..0c7779e7964f 100644 --- a/Dataform/src/V1beta1/QueryWorkflowInvocationActionsResponse.php +++ b/Dataform/src/V1beta1/QueryWorkflowInvocationActionsResponse.php @@ -27,7 +27,7 @@ class QueryWorkflowInvocationActionsResponse extends \Google\Protobuf\Internal\M * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/ReadFileRequest.php b/Dataform/src/V1beta1/ReadFileRequest.php index 237f77abe1b0..97f37ac8f661 100644 --- a/Dataform/src/V1beta1/ReadFileRequest.php +++ b/Dataform/src/V1beta1/ReadFileRequest.php @@ -20,14 +20,14 @@ class ReadFileRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $workspace = ''; + protected $workspace = ''; /** * Required. The file's full path including filename, relative to the * workspace root. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $path = ''; + protected $path = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/ReadFileResponse.php b/Dataform/src/V1beta1/ReadFileResponse.php index 94ccfaba9549..f9978e7e33d8 100644 --- a/Dataform/src/V1beta1/ReadFileResponse.php +++ b/Dataform/src/V1beta1/ReadFileResponse.php @@ -20,7 +20,7 @@ class ReadFileResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes file_contents = 1; */ - private $file_contents = ''; + protected $file_contents = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/ReadRepositoryFileRequest.php b/Dataform/src/V1beta1/ReadRepositoryFileRequest.php index bc385a58a0c7..0c85bc21ca50 100644 --- a/Dataform/src/V1beta1/ReadRepositoryFileRequest.php +++ b/Dataform/src/V1beta1/ReadRepositoryFileRequest.php @@ -20,20 +20,20 @@ class ReadRepositoryFileRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The commit SHA for the commit to read from. If unset, the file * will be read from HEAD. * * Generated from protobuf field string commit_sha = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $commit_sha = ''; + protected $commit_sha = ''; /** * Required. Full file path to read including filename, from repository root. * * Generated from protobuf field string path = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $path = ''; + protected $path = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/ReadRepositoryFileResponse.php b/Dataform/src/V1beta1/ReadRepositoryFileResponse.php index e325b8fc7e85..8d655a20857a 100644 --- a/Dataform/src/V1beta1/ReadRepositoryFileResponse.php +++ b/Dataform/src/V1beta1/ReadRepositoryFileResponse.php @@ -20,7 +20,7 @@ class ReadRepositoryFileResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes contents = 1; */ - private $contents = ''; + protected $contents = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/RelationDescriptor.php b/Dataform/src/V1beta1/RelationDescriptor.php index e20711c682ac..eaa53f555348 100644 --- a/Dataform/src/V1beta1/RelationDescriptor.php +++ b/Dataform/src/V1beta1/RelationDescriptor.php @@ -20,7 +20,7 @@ class RelationDescriptor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 1; */ - private $description = ''; + protected $description = ''; /** * A list of descriptions of columns within the relation. * diff --git a/Dataform/src/V1beta1/RelationDescriptor/ColumnDescriptor.php b/Dataform/src/V1beta1/RelationDescriptor/ColumnDescriptor.php index 0557ac9813dc..6992f60cec3f 100644 --- a/Dataform/src/V1beta1/RelationDescriptor/ColumnDescriptor.php +++ b/Dataform/src/V1beta1/RelationDescriptor/ColumnDescriptor.php @@ -27,7 +27,7 @@ class ColumnDescriptor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 2; */ - private $description = ''; + protected $description = ''; /** * A list of BigQuery policy tags that will be applied to the column. * diff --git a/Dataform/src/V1beta1/ReleaseConfig.php b/Dataform/src/V1beta1/ReleaseConfig.php index 330862899538..ca35a08c163f 100644 --- a/Dataform/src/V1beta1/ReleaseConfig.php +++ b/Dataform/src/V1beta1/ReleaseConfig.php @@ -20,7 +20,7 @@ class ReleaseConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. Git commit/tag/branch name at which the repository should be * compiled. Must exist in the remote repository. Examples: @@ -30,21 +30,21 @@ class ReleaseConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string git_commitish = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $git_commitish = ''; + protected $git_commitish = ''; /** * Optional. If set, fields of `code_compilation_config` override the default * compilation settings that are specified in dataform.json. * * Generated from protobuf field .google.cloud.dataform.v1beta1.CodeCompilationConfig code_compilation_config = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $code_compilation_config = null; + protected $code_compilation_config = null; /** * Optional. Optional schedule (in cron format) for automatic creation of * compilation results. * * Generated from protobuf field string cron_schedule = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $cron_schedule = ''; + protected $cron_schedule = ''; /** * Optional. Specifies the time zone to be used when interpreting * cron_schedule. Must be a time zone name from the time zone database @@ -53,7 +53,7 @@ class ReleaseConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string time_zone = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $time_zone = ''; + protected $time_zone = ''; /** * Output only. Records of the 10 most recent scheduled release attempts, * ordered in in descending order of `release_time`. Updated whenever @@ -72,7 +72,7 @@ class ReleaseConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string release_compilation_result = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $release_compilation_result = ''; + protected $release_compilation_result = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/ReleaseConfig/ScheduledReleaseRecord.php b/Dataform/src/V1beta1/ReleaseConfig/ScheduledReleaseRecord.php index f16e6ea57891..c03fa7752b85 100644 --- a/Dataform/src/V1beta1/ReleaseConfig/ScheduledReleaseRecord.php +++ b/Dataform/src/V1beta1/ReleaseConfig/ScheduledReleaseRecord.php @@ -21,7 +21,7 @@ class ScheduledReleaseRecord extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp release_time = 1; */ - private $release_time = null; + protected $release_time = null; protected $result; /** diff --git a/Dataform/src/V1beta1/RemoveDirectoryRequest.php b/Dataform/src/V1beta1/RemoveDirectoryRequest.php index 25edfcc2e382..afbafa696306 100644 --- a/Dataform/src/V1beta1/RemoveDirectoryRequest.php +++ b/Dataform/src/V1beta1/RemoveDirectoryRequest.php @@ -20,14 +20,14 @@ class RemoveDirectoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $workspace = ''; + protected $workspace = ''; /** * Required. The directory's full path including directory name, relative to * the workspace root. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $path = ''; + protected $path = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/RemoveFileRequest.php b/Dataform/src/V1beta1/RemoveFileRequest.php index faa24819b330..146eb32c334d 100644 --- a/Dataform/src/V1beta1/RemoveFileRequest.php +++ b/Dataform/src/V1beta1/RemoveFileRequest.php @@ -20,14 +20,14 @@ class RemoveFileRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $workspace = ''; + protected $workspace = ''; /** * Required. The file's full path including filename, relative to the * workspace root. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $path = ''; + protected $path = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/Repository.php b/Dataform/src/V1beta1/Repository.php index f303dc0c12bb..9e142dbef694 100644 --- a/Dataform/src/V1beta1/Repository.php +++ b/Dataform/src/V1beta1/Repository.php @@ -20,19 +20,19 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Optional. The repository's user-friendly name. * * Generated from protobuf field string display_name = 8 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. If set, configures this repository to be linked to a Git remote. * * Generated from protobuf field .google.cloud.dataform.v1beta1.Repository.GitRemoteSettings git_remote_settings = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $git_remote_settings = null; + protected $git_remote_settings = null; /** * Optional. The name of the Secret Manager secret version to be used to * interpolate variables into the .npmrc file for package installation @@ -41,7 +41,7 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string npmrc_environment_variables_secret_version = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $npmrc_environment_variables_secret_version = ''; + protected $npmrc_environment_variables_secret_version = ''; /** * Optional. If set, fields of `workspace_compilation_overrides` override the * default compilation settings that are specified in dataform.json when @@ -50,7 +50,7 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataform.v1beta1.Repository.WorkspaceCompilationOverrides workspace_compilation_overrides = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $workspace_compilation_overrides = null; + protected $workspace_compilation_overrides = null; /** * Optional. Repository user labels. * @@ -65,13 +65,13 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool set_authenticated_user_admin = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; */ - private $set_authenticated_user_admin = false; + protected $set_authenticated_user_admin = false; /** * Optional. The service account to run workflow invocations under. * * Generated from protobuf field string service_account = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $service_account = ''; + protected $service_account = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/Repository/GitRemoteSettings.php b/Dataform/src/V1beta1/Repository/GitRemoteSettings.php index 86da40f7e27a..606879be2fc0 100644 --- a/Dataform/src/V1beta1/Repository/GitRemoteSettings.php +++ b/Dataform/src/V1beta1/Repository/GitRemoteSettings.php @@ -20,13 +20,13 @@ class GitRemoteSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $url = ''; + protected $url = ''; /** * Required. The Git remote's default branch name. * * Generated from protobuf field string default_branch = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $default_branch = ''; + protected $default_branch = ''; /** * Optional. The name of the Secret Manager secret version to use as an * authentication token for Git operations. Must be in the format @@ -34,13 +34,13 @@ class GitRemoteSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string authentication_token_secret_version = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ - private $authentication_token_secret_version = ''; + protected $authentication_token_secret_version = ''; /** * Optional. Authentication fields for remote uris using SSH protocol. * * Generated from protobuf field .google.cloud.dataform.v1beta1.Repository.GitRemoteSettings.SshAuthenticationConfig ssh_authentication_config = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $ssh_authentication_config = null; + protected $ssh_authentication_config = null; /** * Output only. Deprecated: The field does not contain any token status * information. Instead use diff --git a/Dataform/src/V1beta1/Repository/GitRemoteSettings/SshAuthenticationConfig.php b/Dataform/src/V1beta1/Repository/GitRemoteSettings/SshAuthenticationConfig.php index 68c0af946a08..7437960cb567 100644 --- a/Dataform/src/V1beta1/Repository/GitRemoteSettings/SshAuthenticationConfig.php +++ b/Dataform/src/V1beta1/Repository/GitRemoteSettings/SshAuthenticationConfig.php @@ -22,14 +22,14 @@ class SshAuthenticationConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string user_private_key_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $user_private_key_secret_version = ''; + protected $user_private_key_secret_version = ''; /** * Required. Content of a public SSH key to verify an identity of a remote * Git host. * * Generated from protobuf field string host_public_key = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $host_public_key = ''; + protected $host_public_key = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/Repository/WorkspaceCompilationOverrides.php b/Dataform/src/V1beta1/Repository/WorkspaceCompilationOverrides.php index e3aea0a1cdd3..a3d7fe3f771a 100644 --- a/Dataform/src/V1beta1/Repository/WorkspaceCompilationOverrides.php +++ b/Dataform/src/V1beta1/Repository/WorkspaceCompilationOverrides.php @@ -28,20 +28,20 @@ class WorkspaceCompilationOverrides extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string default_database = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $default_database = ''; + protected $default_database = ''; /** * Optional. The suffix that should be appended to all schema (BigQuery * dataset ID) names. * * Generated from protobuf field string schema_suffix = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $schema_suffix = ''; + protected $schema_suffix = ''; /** * Optional. The prefix that should be prepended to all table names. * * Generated from protobuf field string table_prefix = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $table_prefix = ''; + protected $table_prefix = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/ResetWorkspaceChangesRequest.php b/Dataform/src/V1beta1/ResetWorkspaceChangesRequest.php index 300c9b517a97..1c7de3d1047f 100644 --- a/Dataform/src/V1beta1/ResetWorkspaceChangesRequest.php +++ b/Dataform/src/V1beta1/ResetWorkspaceChangesRequest.php @@ -20,7 +20,7 @@ class ResetWorkspaceChangesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * 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. @@ -33,7 +33,7 @@ class ResetWorkspaceChangesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool clean = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $clean = false; + protected $clean = false; /** * Constructor. diff --git a/Dataform/src/V1beta1/Target.php b/Dataform/src/V1beta1/Target.php index 64fc2d2f9085..2b0c0a40cdf1 100644 --- a/Dataform/src/V1beta1/Target.php +++ b/Dataform/src/V1beta1/Target.php @@ -21,19 +21,19 @@ class Target extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string database = 1; */ - private $database = ''; + protected $database = ''; /** * The action's schema (BigQuery dataset ID), within `database`. * * Generated from protobuf field string schema = 2; */ - private $schema = ''; + protected $schema = ''; /** * The action's name, within `database` and `schema`. * * Generated from protobuf field string name = 3; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/UpdateReleaseConfigRequest.php b/Dataform/src/V1beta1/UpdateReleaseConfigRequest.php index ac7f3cce571c..c835d001e602 100644 --- a/Dataform/src/V1beta1/UpdateReleaseConfigRequest.php +++ b/Dataform/src/V1beta1/UpdateReleaseConfigRequest.php @@ -21,13 +21,13 @@ class UpdateReleaseConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The release config to update. * * Generated from protobuf field .google.cloud.dataform.v1beta1.ReleaseConfig release_config = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $release_config = null; + protected $release_config = null; /** * @param \Google\Cloud\Dataform\V1beta1\ReleaseConfig $releaseConfig Required. The release config to update. diff --git a/Dataform/src/V1beta1/UpdateRepositoryRequest.php b/Dataform/src/V1beta1/UpdateRepositoryRequest.php index 22c62a8a0d9c..23e3f2870bf5 100644 --- a/Dataform/src/V1beta1/UpdateRepositoryRequest.php +++ b/Dataform/src/V1beta1/UpdateRepositoryRequest.php @@ -21,13 +21,13 @@ class UpdateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The repository to update. * * Generated from protobuf field .google.cloud.dataform.v1beta1.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository = null; + protected $repository = null; /** * @param \Google\Cloud\Dataform\V1beta1\Repository $repository Required. The repository to update. diff --git a/Dataform/src/V1beta1/UpdateWorkflowConfigRequest.php b/Dataform/src/V1beta1/UpdateWorkflowConfigRequest.php index 4b43acde70bd..26f603739387 100644 --- a/Dataform/src/V1beta1/UpdateWorkflowConfigRequest.php +++ b/Dataform/src/V1beta1/UpdateWorkflowConfigRequest.php @@ -21,13 +21,13 @@ class UpdateWorkflowConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The workflow config to update. * * Generated from protobuf field .google.cloud.dataform.v1beta1.WorkflowConfig workflow_config = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $workflow_config = null; + protected $workflow_config = null; /** * @param \Google\Cloud\Dataform\V1beta1\WorkflowConfig $workflowConfig Required. The workflow config to update. diff --git a/Dataform/src/V1beta1/WorkflowConfig.php b/Dataform/src/V1beta1/WorkflowConfig.php index 907f610cc4e6..4b9ea1bc973b 100644 --- a/Dataform/src/V1beta1/WorkflowConfig.php +++ b/Dataform/src/V1beta1/WorkflowConfig.php @@ -20,7 +20,7 @@ class WorkflowConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Required. The name of the release config whose release_compilation_result * should be executed. Must be in the format @@ -28,20 +28,20 @@ class WorkflowConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string release_config = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $release_config = ''; + protected $release_config = ''; /** * Optional. If left unset, a default InvocationConfig will be used. * * Generated from protobuf field .google.cloud.dataform.v1beta1.InvocationConfig invocation_config = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $invocation_config = null; + protected $invocation_config = null; /** * Optional. Optional schedule (in cron format) for automatic execution of * this workflow config. * * Generated from protobuf field string cron_schedule = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $cron_schedule = ''; + protected $cron_schedule = ''; /** * Optional. Specifies the time zone to be used when interpreting * cron_schedule. Must be a time zone name from the time zone database @@ -50,7 +50,7 @@ class WorkflowConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string time_zone = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $time_zone = ''; + protected $time_zone = ''; /** * Output only. Records of the 10 most recent scheduled execution attempts, * ordered in in descending order of `execution_time`. Updated whenever diff --git a/Dataform/src/V1beta1/WorkflowConfig/ScheduledExecutionRecord.php b/Dataform/src/V1beta1/WorkflowConfig/ScheduledExecutionRecord.php index 69a254d632ca..a7d8f13b70e9 100644 --- a/Dataform/src/V1beta1/WorkflowConfig/ScheduledExecutionRecord.php +++ b/Dataform/src/V1beta1/WorkflowConfig/ScheduledExecutionRecord.php @@ -21,7 +21,7 @@ class ScheduledExecutionRecord extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp execution_time = 1; */ - private $execution_time = null; + protected $execution_time = null; protected $result; /** diff --git a/Dataform/src/V1beta1/WorkflowInvocation.php b/Dataform/src/V1beta1/WorkflowInvocation.php index e03f1e024c4c..48f44e085ed5 100644 --- a/Dataform/src/V1beta1/WorkflowInvocation.php +++ b/Dataform/src/V1beta1/WorkflowInvocation.php @@ -20,25 +20,25 @@ class WorkflowInvocation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Immutable. If left unset, a default InvocationConfig will be used. * * Generated from protobuf field .google.cloud.dataform.v1beta1.InvocationConfig invocation_config = 3 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $invocation_config = null; + protected $invocation_config = null; /** * Output only. This workflow invocation's current state. * * Generated from protobuf field .google.cloud.dataform.v1beta1.WorkflowInvocation.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. This workflow invocation's timing details. * * Generated from protobuf field .google.type.Interval invocation_timing = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $invocation_timing = null; + protected $invocation_timing = null; protected $compilation_source; /** diff --git a/Dataform/src/V1beta1/WorkflowInvocation/InvocationConfig.php b/Dataform/src/V1beta1/WorkflowInvocation/InvocationConfig.php deleted file mode 100644 index 02d72ac3ef22..000000000000 --- a/Dataform/src/V1beta1/WorkflowInvocation/InvocationConfig.php +++ /dev/null @@ -1,214 +0,0 @@ -google.cloud.dataform.v1beta1.WorkflowInvocation.InvocationConfig - */ -class InvocationConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The set of action identifiers to include. - * - * Generated from protobuf field repeated .google.cloud.dataform.v1beta1.Target included_targets = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $included_targets; - /** - * Immutable. The set of tags to include. - * - * Generated from protobuf field repeated string included_tags = 2 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $included_tags; - /** - * Immutable. When set to true, transitive dependencies of included actions will be - * executed. - * - * Generated from protobuf field bool transitive_dependencies_included = 3 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $transitive_dependencies_included = false; - /** - * Immutable. When set to true, transitive dependents of included actions will be - * executed. - * - * Generated from protobuf field bool transitive_dependents_included = 4 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $transitive_dependents_included = false; - /** - * Immutable. When set to true, any incremental tables will be fully refreshed. - * - * Generated from protobuf field bool fully_refresh_incremental_tables_enabled = 5 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $fully_refresh_incremental_tables_enabled = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Dataform\V1beta1\Target>|\Google\Protobuf\Internal\RepeatedField $included_targets - * Immutable. The set of action identifiers to include. - * @type array|\Google\Protobuf\Internal\RepeatedField $included_tags - * Immutable. The set of tags to include. - * @type bool $transitive_dependencies_included - * Immutable. When set to true, transitive dependencies of included actions will be - * executed. - * @type bool $transitive_dependents_included - * Immutable. When set to true, transitive dependents of included actions will be - * executed. - * @type bool $fully_refresh_incremental_tables_enabled - * Immutable. When set to true, any incremental tables will be fully refreshed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dataform\V1Beta1\Dataform::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The set of action identifiers to include. - * - * Generated from protobuf field repeated .google.cloud.dataform.v1beta1.Target included_targets = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIncludedTargets() - { - return $this->included_targets; - } - - /** - * Immutable. The set of action identifiers to include. - * - * Generated from protobuf field repeated .google.cloud.dataform.v1beta1.Target included_targets = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param array<\Google\Cloud\Dataform\V1beta1\Target>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIncludedTargets($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dataform\V1beta1\Target::class); - $this->included_targets = $arr; - - return $this; - } - - /** - * Immutable. The set of tags to include. - * - * Generated from protobuf field repeated string included_tags = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIncludedTags() - { - return $this->included_tags; - } - - /** - * Immutable. The set of tags to include. - * - * Generated from protobuf field repeated string included_tags = 2 [(.google.api.field_behavior) = IMMUTABLE]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIncludedTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->included_tags = $arr; - - return $this; - } - - /** - * Immutable. When set to true, transitive dependencies of included actions will be - * executed. - * - * Generated from protobuf field bool transitive_dependencies_included = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @return bool - */ - public function getTransitiveDependenciesIncluded() - { - return $this->transitive_dependencies_included; - } - - /** - * Immutable. When set to true, transitive dependencies of included actions will be - * executed. - * - * Generated from protobuf field bool transitive_dependencies_included = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @param bool $var - * @return $this - */ - public function setTransitiveDependenciesIncluded($var) - { - GPBUtil::checkBool($var); - $this->transitive_dependencies_included = $var; - - return $this; - } - - /** - * Immutable. When set to true, transitive dependents of included actions will be - * executed. - * - * Generated from protobuf field bool transitive_dependents_included = 4 [(.google.api.field_behavior) = IMMUTABLE]; - * @return bool - */ - public function getTransitiveDependentsIncluded() - { - return $this->transitive_dependents_included; - } - - /** - * Immutable. When set to true, transitive dependents of included actions will be - * executed. - * - * Generated from protobuf field bool transitive_dependents_included = 4 [(.google.api.field_behavior) = IMMUTABLE]; - * @param bool $var - * @return $this - */ - public function setTransitiveDependentsIncluded($var) - { - GPBUtil::checkBool($var); - $this->transitive_dependents_included = $var; - - return $this; - } - - /** - * Immutable. When set to true, any incremental tables will be fully refreshed. - * - * Generated from protobuf field bool fully_refresh_incremental_tables_enabled = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * @return bool - */ - public function getFullyRefreshIncrementalTablesEnabled() - { - return $this->fully_refresh_incremental_tables_enabled; - } - - /** - * Immutable. When set to true, any incremental tables will be fully refreshed. - * - * Generated from protobuf field bool fully_refresh_incremental_tables_enabled = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * @param bool $var - * @return $this - */ - public function setFullyRefreshIncrementalTablesEnabled($var) - { - GPBUtil::checkBool($var); - $this->fully_refresh_incremental_tables_enabled = $var; - - return $this; - } - -} - - diff --git a/Dataform/src/V1beta1/WorkflowInvocationAction.php b/Dataform/src/V1beta1/WorkflowInvocationAction.php index 2660946a2479..4c6f4da43265 100644 --- a/Dataform/src/V1beta1/WorkflowInvocationAction.php +++ b/Dataform/src/V1beta1/WorkflowInvocationAction.php @@ -21,27 +21,27 @@ class WorkflowInvocationAction extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.dataform.v1beta1.Target target = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target = null; + protected $target = null; /** * Output only. The action's identifier if the project had been compiled * without any overrides configured. Unique within the compilation result. * * Generated from protobuf field .google.cloud.dataform.v1beta1.Target canonical_target = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $canonical_target = null; + protected $canonical_target = null; /** * Output only. This action's current state. * * Generated from protobuf field .google.cloud.dataform.v1beta1.WorkflowInvocationAction.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. If and only if action's state is FAILED a failure reason is * set. * * Generated from protobuf field string failure_reason = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $failure_reason = ''; + protected $failure_reason = ''; /** * Output only. This action's timing details. * `start_time` will be set if the action is in [RUNNING, SUCCEEDED, @@ -51,13 +51,13 @@ class WorkflowInvocationAction extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.type.Interval invocation_timing = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $invocation_timing = null; + protected $invocation_timing = null; /** * Output only. The workflow action's bigquery action details. * * Generated from protobuf field .google.cloud.dataform.v1beta1.WorkflowInvocationAction.BigQueryAction bigquery_action = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $bigquery_action = null; + protected $bigquery_action = null; /** * Constructor. diff --git a/Dataform/src/V1beta1/WorkflowInvocationAction/BigQueryAction.php b/Dataform/src/V1beta1/WorkflowInvocationAction/BigQueryAction.php index e57da5f54d9d..ef3dd84c2b0f 100644 --- a/Dataform/src/V1beta1/WorkflowInvocationAction/BigQueryAction.php +++ b/Dataform/src/V1beta1/WorkflowInvocationAction/BigQueryAction.php @@ -20,7 +20,7 @@ class BigQueryAction extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string sql_script = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $sql_script = ''; + protected $sql_script = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/Workspace.php b/Dataform/src/V1beta1/Workspace.php index f81afb20698c..23e856edc862 100644 --- a/Dataform/src/V1beta1/Workspace.php +++ b/Dataform/src/V1beta1/Workspace.php @@ -20,7 +20,7 @@ class Workspace extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Dataform/src/V1beta1/WriteFileRequest.php b/Dataform/src/V1beta1/WriteFileRequest.php index dab142158453..52c30bdc5692 100644 --- a/Dataform/src/V1beta1/WriteFileRequest.php +++ b/Dataform/src/V1beta1/WriteFileRequest.php @@ -20,19 +20,19 @@ class WriteFileRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $workspace = ''; + protected $workspace = ''; /** * Required. The file. * * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $path = ''; + protected $path = ''; /** * Required. The file's contents. * * Generated from protobuf field bytes contents = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $contents = ''; + protected $contents = ''; /** * Constructor. diff --git a/Dataform/tests/Unit/V1beta1/Client/DataformClientTest.php b/Dataform/tests/Unit/V1beta1/Client/DataformClientTest.php index 74cb7b01d7aa..684c7b321913 100644 --- a/Dataform/tests/Unit/V1beta1/Client/DataformClientTest.php +++ b/Dataform/tests/Unit/V1beta1/Client/DataformClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return DataformClient */ @@ -166,9 +168,13 @@ public function cancelWorkflowInvocationTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $request = (new CancelWorkflowInvocationRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowInvocationName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_INVOCATION]' + ); + $request = (new CancelWorkflowInvocationRequest())->setName($formattedName); $gapicClient->cancelWorkflowInvocation($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -191,17 +197,24 @@ public function cancelWorkflowInvocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $request = (new CancelWorkflowInvocationRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowInvocationName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_INVOCATION]' + ); + $request = (new CancelWorkflowInvocationRequest())->setName($formattedName); try { $gapicClient->cancelWorkflowInvocation($request); // If the $gapicClient method call did not throw, fail the test @@ -235,9 +248,7 @@ public function commitRepositoryChangesTest() $authorEmailAddress = 'authorEmailAddress-6398493'; $commitMetadataAuthor->setEmailAddress($authorEmailAddress); $commitMetadata->setAuthor($commitMetadataAuthor); - $request = (new CommitRepositoryChangesRequest()) - ->setName($formattedName) - ->setCommitMetadata($commitMetadata); + $request = (new CommitRepositoryChangesRequest())->setName($formattedName)->setCommitMetadata($commitMetadata); $gapicClient->commitRepositoryChanges($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -262,12 +273,15 @@ public function commitRepositoryChangesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); @@ -278,9 +292,7 @@ public function commitRepositoryChangesExceptionTest() $authorEmailAddress = 'authorEmailAddress-6398493'; $commitMetadataAuthor->setEmailAddress($authorEmailAddress); $commitMetadata->setAuthor($commitMetadataAuthor); - $request = (new CommitRepositoryChangesRequest()) - ->setName($formattedName) - ->setCommitMetadata($commitMetadata); + $request = (new CommitRepositoryChangesRequest())->setName($formattedName)->setCommitMetadata($commitMetadata); try { $gapicClient->commitRepositoryChanges($request); // If the $gapicClient method call did not throw, fail the test @@ -312,9 +324,7 @@ public function commitWorkspaceChangesTest() $author->setName($authorName); $authorEmailAddress = 'authorEmailAddress-6398493'; $author->setEmailAddress($authorEmailAddress); - $request = (new CommitWorkspaceChangesRequest()) - ->setName($formattedName) - ->setAuthor($author); + $request = (new CommitWorkspaceChangesRequest())->setName($formattedName)->setAuthor($author); $gapicClient->commitWorkspaceChanges($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -339,12 +349,15 @@ public function commitWorkspaceChangesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); @@ -353,9 +366,7 @@ public function commitWorkspaceChangesExceptionTest() $author->setName($authorName); $authorEmailAddress = 'authorEmailAddress-6398493'; $author->setEmailAddress($authorEmailAddress); - $request = (new CommitWorkspaceChangesRequest()) - ->setName($formattedName) - ->setAuthor($author); + $request = (new CommitWorkspaceChangesRequest())->setName($formattedName)->setAuthor($author); try { $gapicClient->commitWorkspaceChanges($request); // If the $gapicClient method call did not throw, fail the test @@ -382,15 +393,17 @@ public function computeRepositoryAccessTokenStatusTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ComputeRepositoryAccessTokenStatusRequest()) - ->setName($formattedName); + $request = (new ComputeRepositoryAccessTokenStatusRequest())->setName($formattedName); $response = $gapicClient->computeRepositoryAccessTokenStatus($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/ComputeRepositoryAccessTokenStatus', $actualFuncCall); + $this->assertSame( + '/google.cloud.dataform.v1beta1.Dataform/ComputeRepositoryAccessTokenStatus', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -407,17 +420,19 @@ public function computeRepositoryAccessTokenStatusExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ComputeRepositoryAccessTokenStatusRequest()) - ->setName($formattedName); + $request = (new ComputeRepositoryAccessTokenStatusRequest())->setName($formattedName); try { $gapicClient->computeRepositoryAccessTokenStatus($request); // If the $gapicClient method call did not throw, fail the test @@ -481,12 +496,15 @@ public function createCompilationResultExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); @@ -565,12 +583,15 @@ public function createReleaseConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); @@ -651,12 +672,15 @@ public function createRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -701,7 +725,12 @@ public function createWorkflowConfigTest() // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); $workflowConfig = new WorkflowConfig(); - $workflowConfigReleaseConfig = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); + $workflowConfigReleaseConfig = $gapicClient->releaseConfigName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[RELEASE_CONFIG]' + ); $workflowConfig->setReleaseConfig($workflowConfigReleaseConfig); $workflowConfigId = 'workflowConfigId-60129608'; $request = (new CreateWorkflowConfigRequest()) @@ -735,17 +764,25 @@ public function createWorkflowConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); $workflowConfig = new WorkflowConfig(); - $workflowConfigReleaseConfig = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); + $workflowConfigReleaseConfig = $gapicClient->releaseConfigName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[RELEASE_CONFIG]' + ); $workflowConfig->setReleaseConfig($workflowConfigReleaseConfig); $workflowConfigId = 'workflowConfigId-60129608'; $request = (new CreateWorkflowConfigRequest()) @@ -811,12 +848,15 @@ public function createWorkflowInvocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); @@ -885,12 +925,15 @@ public function createWorkspaceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); @@ -926,8 +969,7 @@ public function deleteReleaseConfigTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - $request = (new DeleteReleaseConfigRequest()) - ->setName($formattedName); + $request = (new DeleteReleaseConfigRequest())->setName($formattedName); $gapicClient->deleteReleaseConfig($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -950,17 +992,19 @@ public function deleteReleaseConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - $request = (new DeleteReleaseConfigRequest()) - ->setName($formattedName); + $request = (new DeleteReleaseConfigRequest())->setName($formattedName); try { $gapicClient->deleteReleaseConfig($request); // If the $gapicClient method call did not throw, fail the test @@ -987,8 +1031,7 @@ public function deleteRepositoryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new DeleteRepositoryRequest()) - ->setName($formattedName); + $request = (new DeleteRepositoryRequest())->setName($formattedName); $gapicClient->deleteRepository($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1011,17 +1054,19 @@ public function deleteRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new DeleteRepositoryRequest()) - ->setName($formattedName); + $request = (new DeleteRepositoryRequest())->setName($formattedName); try { $gapicClient->deleteRepository($request); // If the $gapicClient method call did not throw, fail the test @@ -1047,9 +1092,13 @@ public function deleteWorkflowConfigTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->workflowConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_CONFIG]'); - $request = (new DeleteWorkflowConfigRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowConfigName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_CONFIG]' + ); + $request = (new DeleteWorkflowConfigRequest())->setName($formattedName); $gapicClient->deleteWorkflowConfig($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1072,17 +1121,24 @@ public function deleteWorkflowConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->workflowConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_CONFIG]'); - $request = (new DeleteWorkflowConfigRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowConfigName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_CONFIG]' + ); + $request = (new DeleteWorkflowConfigRequest())->setName($formattedName); try { $gapicClient->deleteWorkflowConfig($request); // If the $gapicClient method call did not throw, fail the test @@ -1108,9 +1164,13 @@ public function deleteWorkflowInvocationTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $request = (new DeleteWorkflowInvocationRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowInvocationName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_INVOCATION]' + ); + $request = (new DeleteWorkflowInvocationRequest())->setName($formattedName); $gapicClient->deleteWorkflowInvocation($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1133,17 +1193,24 @@ public function deleteWorkflowInvocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $request = (new DeleteWorkflowInvocationRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowInvocationName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_INVOCATION]' + ); + $request = (new DeleteWorkflowInvocationRequest())->setName($formattedName); try { $gapicClient->deleteWorkflowInvocation($request); // If the $gapicClient method call did not throw, fail the test @@ -1170,8 +1237,7 @@ public function deleteWorkspaceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new DeleteWorkspaceRequest()) - ->setName($formattedName); + $request = (new DeleteWorkspaceRequest())->setName($formattedName); $gapicClient->deleteWorkspace($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1194,17 +1260,19 @@ public function deleteWorkspaceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new DeleteWorkspaceRequest()) - ->setName($formattedName); + $request = (new DeleteWorkspaceRequest())->setName($formattedName); try { $gapicClient->deleteWorkspace($request); // If the $gapicClient method call did not throw, fail the test @@ -1234,9 +1302,7 @@ public function fetchFileDiffTest() // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); $path = 'path3433509'; - $request = (new FetchFileDiffRequest()) - ->setWorkspace($formattedWorkspace) - ->setPath($path); + $request = (new FetchFileDiffRequest())->setWorkspace($formattedWorkspace)->setPath($path); $response = $gapicClient->fetchFileDiff($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1262,19 +1328,20 @@ public function fetchFileDiffExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); $path = 'path3433509'; - $request = (new FetchFileDiffRequest()) - ->setWorkspace($formattedWorkspace) - ->setPath($path); + $request = (new FetchFileDiffRequest())->setWorkspace($formattedWorkspace)->setPath($path); try { $gapicClient->fetchFileDiff($request); // If the $gapicClient method call did not throw, fail the test @@ -1301,8 +1368,7 @@ public function fetchFileGitStatusesTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new FetchFileGitStatusesRequest()) - ->setName($formattedName); + $request = (new FetchFileGitStatusesRequest())->setName($formattedName); $response = $gapicClient->fetchFileGitStatuses($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1326,17 +1392,19 @@ public function fetchFileGitStatusesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new FetchFileGitStatusesRequest()) - ->setName($formattedName); + $request = (new FetchFileGitStatusesRequest())->setName($formattedName); try { $gapicClient->fetchFileGitStatuses($request); // If the $gapicClient method call did not throw, fail the test @@ -1367,8 +1435,7 @@ public function fetchGitAheadBehindTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new FetchGitAheadBehindRequest()) - ->setName($formattedName); + $request = (new FetchGitAheadBehindRequest())->setName($formattedName); $response = $gapicClient->fetchGitAheadBehind($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1392,17 +1459,19 @@ public function fetchGitAheadBehindExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new FetchGitAheadBehindRequest()) - ->setName($formattedName); + $request = (new FetchGitAheadBehindRequest())->setName($formattedName); try { $gapicClient->fetchGitAheadBehind($request); // If the $gapicClient method call did not throw, fail the test @@ -1429,8 +1498,7 @@ public function fetchRemoteBranchesTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new FetchRemoteBranchesRequest()) - ->setName($formattedName); + $request = (new FetchRemoteBranchesRequest())->setName($formattedName); $response = $gapicClient->fetchRemoteBranches($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1454,17 +1522,19 @@ public function fetchRemoteBranchesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new FetchRemoteBranchesRequest()) - ->setName($formattedName); + $request = (new FetchRemoteBranchesRequest())->setName($formattedName); try { $gapicClient->fetchRemoteBranches($request); // If the $gapicClient method call did not throw, fail the test @@ -1489,17 +1559,14 @@ public function fetchRepositoryHistoryTest() // Mock response $nextPageToken = ''; $commitsElement = new CommitLogEntry(); - $commits = [ - $commitsElement, - ]; + $commits = [$commitsElement]; $expectedResponse = new FetchRepositoryHistoryResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setCommits($commits); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new FetchRepositoryHistoryRequest()) - ->setName($formattedName); + $request = (new FetchRepositoryHistoryRequest())->setName($formattedName); $response = $gapicClient->fetchRepositoryHistory($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1526,17 +1593,19 @@ public function fetchRepositoryHistoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new FetchRepositoryHistoryRequest()) - ->setName($formattedName); + $request = (new FetchRepositoryHistoryRequest())->setName($formattedName); try { $gapicClient->fetchRepositoryHistory($request); // If the $gapicClient method call did not throw, fail the test @@ -1570,9 +1639,13 @@ public function getCompilationResultTest() $expectedResponse->setDataformCoreVersion($dataformCoreVersion); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->compilationResultName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[COMPILATION_RESULT]'); - $request = (new GetCompilationResultRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->compilationResultName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[COMPILATION_RESULT]' + ); + $request = (new GetCompilationResultRequest())->setName($formattedName); $response = $gapicClient->getCompilationResult($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1596,17 +1669,24 @@ public function getCompilationResultExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->compilationResultName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[COMPILATION_RESULT]'); - $request = (new GetCompilationResultRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->compilationResultName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[COMPILATION_RESULT]' + ); + $request = (new GetCompilationResultRequest())->setName($formattedName); try { $gapicClient->getCompilationResult($request); // If the $gapicClient method call did not throw, fail the test @@ -1643,8 +1723,7 @@ public function getReleaseConfigTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - $request = (new GetReleaseConfigRequest()) - ->setName($formattedName); + $request = (new GetReleaseConfigRequest())->setName($formattedName); $response = $gapicClient->getReleaseConfig($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1668,17 +1747,19 @@ public function getReleaseConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - $request = (new GetReleaseConfigRequest()) - ->setName($formattedName); + $request = (new GetReleaseConfigRequest())->setName($formattedName); try { $gapicClient->getReleaseConfig($request); // If the $gapicClient method call did not throw, fail the test @@ -1715,8 +1796,7 @@ public function getRepositoryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new GetRepositoryRequest()) - ->setName($formattedName); + $request = (new GetRepositoryRequest())->setName($formattedName); $response = $gapicClient->getRepository($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1740,17 +1820,19 @@ public function getRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new GetRepositoryRequest()) - ->setName($formattedName); + $request = (new GetRepositoryRequest())->setName($formattedName); try { $gapicClient->getRepository($request); // If the $gapicClient method call did not throw, fail the test @@ -1784,9 +1866,13 @@ public function getWorkflowConfigTest() $expectedResponse->setTimeZone($timeZone); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->workflowConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_CONFIG]'); - $request = (new GetWorkflowConfigRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowConfigName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_CONFIG]' + ); + $request = (new GetWorkflowConfigRequest())->setName($formattedName); $response = $gapicClient->getWorkflowConfig($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1810,17 +1896,24 @@ public function getWorkflowConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->workflowConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_CONFIG]'); - $request = (new GetWorkflowConfigRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowConfigName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_CONFIG]' + ); + $request = (new GetWorkflowConfigRequest())->setName($formattedName); try { $gapicClient->getWorkflowConfig($request); // If the $gapicClient method call did not throw, fail the test @@ -1850,9 +1943,13 @@ public function getWorkflowInvocationTest() $expectedResponse->setCompilationResult($compilationResult); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $request = (new GetWorkflowInvocationRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowInvocationName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_INVOCATION]' + ); + $request = (new GetWorkflowInvocationRequest())->setName($formattedName); $response = $gapicClient->getWorkflowInvocation($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1876,17 +1973,24 @@ public function getWorkflowInvocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $request = (new GetWorkflowInvocationRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowInvocationName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_INVOCATION]' + ); + $request = (new GetWorkflowInvocationRequest())->setName($formattedName); try { $gapicClient->getWorkflowInvocation($request); // If the $gapicClient method call did not throw, fail the test @@ -1915,8 +2019,7 @@ public function getWorkspaceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new GetWorkspaceRequest()) - ->setName($formattedName); + $request = (new GetWorkspaceRequest())->setName($formattedName); $response = $gapicClient->getWorkspace($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1940,17 +2043,19 @@ public function getWorkspaceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new GetWorkspaceRequest()) - ->setName($formattedName); + $request = (new GetWorkspaceRequest())->setName($formattedName); try { $gapicClient->getWorkspace($request); // If the $gapicClient method call did not throw, fail the test @@ -1977,8 +2082,7 @@ public function installNpmPackagesTest() $transport->addResponse($expectedResponse); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new InstallNpmPackagesRequest()) - ->setWorkspace($formattedWorkspace); + $request = (new InstallNpmPackagesRequest())->setWorkspace($formattedWorkspace); $response = $gapicClient->installNpmPackages($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2002,17 +2106,19 @@ public function installNpmPackagesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new InstallNpmPackagesRequest()) - ->setWorkspace($formattedWorkspace); + $request = (new InstallNpmPackagesRequest())->setWorkspace($formattedWorkspace); try { $gapicClient->installNpmPackages($request); // If the $gapicClient method call did not throw, fail the test @@ -2037,17 +2143,14 @@ public function listCompilationResultsTest() // Mock response $nextPageToken = ''; $compilationResultsElement = new CompilationResult(); - $compilationResults = [ - $compilationResultsElement, - ]; + $compilationResults = [$compilationResultsElement]; $expectedResponse = new ListCompilationResultsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setCompilationResults($compilationResults); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListCompilationResultsRequest()) - ->setParent($formattedParent); + $request = (new ListCompilationResultsRequest())->setParent($formattedParent); $response = $gapicClient->listCompilationResults($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2074,17 +2177,19 @@ public function listCompilationResultsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListCompilationResultsRequest()) - ->setParent($formattedParent); + $request = (new ListCompilationResultsRequest())->setParent($formattedParent); try { $gapicClient->listCompilationResults($request); // If the $gapicClient method call did not throw, fail the test @@ -2109,17 +2214,14 @@ public function listReleaseConfigsTest() // Mock response $nextPageToken = ''; $releaseConfigsElement = new ReleaseConfig(); - $releaseConfigs = [ - $releaseConfigsElement, - ]; + $releaseConfigs = [$releaseConfigsElement]; $expectedResponse = new ListReleaseConfigsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setReleaseConfigs($releaseConfigs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListReleaseConfigsRequest()) - ->setParent($formattedParent); + $request = (new ListReleaseConfigsRequest())->setParent($formattedParent); $response = $gapicClient->listReleaseConfigs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2146,17 +2248,19 @@ public function listReleaseConfigsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListReleaseConfigsRequest()) - ->setParent($formattedParent); + $request = (new ListReleaseConfigsRequest())->setParent($formattedParent); try { $gapicClient->listReleaseConfigs($request); // If the $gapicClient method call did not throw, fail the test @@ -2181,17 +2285,14 @@ public function listRepositoriesTest() // Mock response $nextPageToken = ''; $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; + $repositories = [$repositoriesElement]; $expectedResponse = new ListRepositoriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setRepositories($repositories); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListRepositoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); $response = $gapicClient->listRepositories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2218,17 +2319,19 @@ public function listRepositoriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListRepositoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); try { $gapicClient->listRepositories($request); // If the $gapicClient method call did not throw, fail the test @@ -2253,17 +2356,14 @@ public function listWorkflowConfigsTest() // Mock response $nextPageToken = ''; $workflowConfigsElement = new WorkflowConfig(); - $workflowConfigs = [ - $workflowConfigsElement, - ]; + $workflowConfigs = [$workflowConfigsElement]; $expectedResponse = new ListWorkflowConfigsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setWorkflowConfigs($workflowConfigs); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListWorkflowConfigsRequest()) - ->setParent($formattedParent); + $request = (new ListWorkflowConfigsRequest())->setParent($formattedParent); $response = $gapicClient->listWorkflowConfigs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2290,17 +2390,19 @@ public function listWorkflowConfigsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListWorkflowConfigsRequest()) - ->setParent($formattedParent); + $request = (new ListWorkflowConfigsRequest())->setParent($formattedParent); try { $gapicClient->listWorkflowConfigs($request); // If the $gapicClient method call did not throw, fail the test @@ -2325,17 +2427,14 @@ public function listWorkflowInvocationsTest() // Mock response $nextPageToken = ''; $workflowInvocationsElement = new WorkflowInvocation(); - $workflowInvocations = [ - $workflowInvocationsElement, - ]; + $workflowInvocations = [$workflowInvocationsElement]; $expectedResponse = new ListWorkflowInvocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setWorkflowInvocations($workflowInvocations); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListWorkflowInvocationsRequest()) - ->setParent($formattedParent); + $request = (new ListWorkflowInvocationsRequest())->setParent($formattedParent); $response = $gapicClient->listWorkflowInvocations($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2362,17 +2461,19 @@ public function listWorkflowInvocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListWorkflowInvocationsRequest()) - ->setParent($formattedParent); + $request = (new ListWorkflowInvocationsRequest())->setParent($formattedParent); try { $gapicClient->listWorkflowInvocations($request); // If the $gapicClient method call did not throw, fail the test @@ -2397,17 +2498,14 @@ public function listWorkspacesTest() // Mock response $nextPageToken = ''; $workspacesElement = new Workspace(); - $workspaces = [ - $workspacesElement, - ]; + $workspaces = [$workspacesElement]; $expectedResponse = new ListWorkspacesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setWorkspaces($workspaces); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListWorkspacesRequest()) - ->setParent($formattedParent); + $request = (new ListWorkspacesRequest())->setParent($formattedParent); $response = $gapicClient->listWorkspaces($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2434,17 +2532,19 @@ public function listWorkspacesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListWorkspacesRequest()) - ->setParent($formattedParent); + $request = (new ListWorkspacesRequest())->setParent($formattedParent); try { $gapicClient->listWorkspaces($request); // If the $gapicClient method call did not throw, fail the test @@ -2472,9 +2572,7 @@ public function makeDirectoryTest() // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); $path = 'path3433509'; - $request = (new MakeDirectoryRequest()) - ->setWorkspace($formattedWorkspace) - ->setPath($path); + $request = (new MakeDirectoryRequest())->setWorkspace($formattedWorkspace)->setPath($path); $response = $gapicClient->makeDirectory($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2500,19 +2598,20 @@ public function makeDirectoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); $path = 'path3433509'; - $request = (new MakeDirectoryRequest()) - ->setWorkspace($formattedWorkspace) - ->setPath($path); + $request = (new MakeDirectoryRequest())->setWorkspace($formattedWorkspace)->setPath($path); try { $gapicClient->makeDirectory($request); // If the $gapicClient method call did not throw, fail the test @@ -2572,12 +2671,15 @@ public function moveDirectoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); @@ -2646,12 +2748,15 @@ public function moveFileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); @@ -2692,9 +2797,7 @@ public function pullGitCommitsTest() $author->setName($authorName); $authorEmailAddress = 'authorEmailAddress-6398493'; $author->setEmailAddress($authorEmailAddress); - $request = (new PullGitCommitsRequest()) - ->setName($formattedName) - ->setAuthor($author); + $request = (new PullGitCommitsRequest())->setName($formattedName)->setAuthor($author); $gapicClient->pullGitCommits($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -2719,12 +2822,15 @@ public function pullGitCommitsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); @@ -2733,9 +2839,7 @@ public function pullGitCommitsExceptionTest() $author->setName($authorName); $authorEmailAddress = 'authorEmailAddress-6398493'; $author->setEmailAddress($authorEmailAddress); - $request = (new PullGitCommitsRequest()) - ->setName($formattedName) - ->setAuthor($author); + $request = (new PullGitCommitsRequest())->setName($formattedName)->setAuthor($author); try { $gapicClient->pullGitCommits($request); // If the $gapicClient method call did not throw, fail the test @@ -2762,8 +2866,7 @@ public function pushGitCommitsTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new PushGitCommitsRequest()) - ->setName($formattedName); + $request = (new PushGitCommitsRequest())->setName($formattedName); $gapicClient->pushGitCommits($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -2786,17 +2889,19 @@ public function pushGitCommitsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new PushGitCommitsRequest()) - ->setName($formattedName); + $request = (new PushGitCommitsRequest())->setName($formattedName); try { $gapicClient->pushGitCommits($request); // If the $gapicClient method call did not throw, fail the test @@ -2821,17 +2926,19 @@ public function queryCompilationResultActionsTest() // Mock response $nextPageToken = ''; $compilationResultActionsElement = new CompilationResultAction(); - $compilationResultActions = [ - $compilationResultActionsElement, - ]; + $compilationResultActions = [$compilationResultActionsElement]; $expectedResponse = new QueryCompilationResultActionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setCompilationResultActions($compilationResultActions); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->compilationResultName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[COMPILATION_RESULT]'); - $request = (new QueryCompilationResultActionsRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->compilationResultName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[COMPILATION_RESULT]' + ); + $request = (new QueryCompilationResultActionsRequest())->setName($formattedName); $response = $gapicClient->queryCompilationResultActions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2858,17 +2965,24 @@ public function queryCompilationResultActionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->compilationResultName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[COMPILATION_RESULT]'); - $request = (new QueryCompilationResultActionsRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->compilationResultName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[COMPILATION_RESULT]' + ); + $request = (new QueryCompilationResultActionsRequest())->setName($formattedName); try { $gapicClient->queryCompilationResultActions($request); // If the $gapicClient method call did not throw, fail the test @@ -2893,17 +3007,14 @@ public function queryDirectoryContentsTest() // Mock response $nextPageToken = ''; $directoryEntriesElement = new DirectoryEntry(); - $directoryEntries = [ - $directoryEntriesElement, - ]; + $directoryEntries = [$directoryEntriesElement]; $expectedResponse = new QueryDirectoryContentsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDirectoryEntries($directoryEntries); $transport->addResponse($expectedResponse); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new QueryDirectoryContentsRequest()) - ->setWorkspace($formattedWorkspace); + $request = (new QueryDirectoryContentsRequest())->setWorkspace($formattedWorkspace); $response = $gapicClient->queryDirectoryContents($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2930,17 +3041,19 @@ public function queryDirectoryContentsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new QueryDirectoryContentsRequest()) - ->setWorkspace($formattedWorkspace); + $request = (new QueryDirectoryContentsRequest())->setWorkspace($formattedWorkspace); try { $gapicClient->queryDirectoryContents($request); // If the $gapicClient method call did not throw, fail the test @@ -2965,17 +3078,14 @@ public function queryRepositoryDirectoryContentsTest() // Mock response $nextPageToken = ''; $directoryEntriesElement = new DirectoryEntry(); - $directoryEntries = [ - $directoryEntriesElement, - ]; + $directoryEntries = [$directoryEntriesElement]; $expectedResponse = new QueryRepositoryDirectoryContentsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDirectoryEntries($directoryEntries); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new QueryRepositoryDirectoryContentsRequest()) - ->setName($formattedName); + $request = (new QueryRepositoryDirectoryContentsRequest())->setName($formattedName); $response = $gapicClient->queryRepositoryDirectoryContents($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3002,17 +3112,19 @@ public function queryRepositoryDirectoryContentsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new QueryRepositoryDirectoryContentsRequest()) - ->setName($formattedName); + $request = (new QueryRepositoryDirectoryContentsRequest())->setName($formattedName); try { $gapicClient->queryRepositoryDirectoryContents($request); // If the $gapicClient method call did not throw, fail the test @@ -3037,17 +3149,19 @@ public function queryWorkflowInvocationActionsTest() // Mock response $nextPageToken = ''; $workflowInvocationActionsElement = new WorkflowInvocationAction(); - $workflowInvocationActions = [ - $workflowInvocationActionsElement, - ]; + $workflowInvocationActions = [$workflowInvocationActionsElement]; $expectedResponse = new QueryWorkflowInvocationActionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setWorkflowInvocationActions($workflowInvocationActions); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $request = (new QueryWorkflowInvocationActionsRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowInvocationName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_INVOCATION]' + ); + $request = (new QueryWorkflowInvocationActionsRequest())->setName($formattedName); $response = $gapicClient->queryWorkflowInvocationActions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -3074,17 +3188,24 @@ public function queryWorkflowInvocationActionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $request = (new QueryWorkflowInvocationActionsRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowInvocationName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_INVOCATION]' + ); + $request = (new QueryWorkflowInvocationActionsRequest())->setName($formattedName); try { $gapicClient->queryWorkflowInvocationActions($request); // If the $gapicClient method call did not throw, fail the test @@ -3114,9 +3235,7 @@ public function readFileTest() // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); $path = 'path3433509'; - $request = (new ReadFileRequest()) - ->setWorkspace($formattedWorkspace) - ->setPath($path); + $request = (new ReadFileRequest())->setWorkspace($formattedWorkspace)->setPath($path); $response = $gapicClient->readFile($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3142,19 +3261,20 @@ public function readFileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); $path = 'path3433509'; - $request = (new ReadFileRequest()) - ->setWorkspace($formattedWorkspace) - ->setPath($path); + $request = (new ReadFileRequest())->setWorkspace($formattedWorkspace)->setPath($path); try { $gapicClient->readFile($request); // If the $gapicClient method call did not throw, fail the test @@ -3184,9 +3304,7 @@ public function readRepositoryFileTest() // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); $path = 'path3433509'; - $request = (new ReadRepositoryFileRequest()) - ->setName($formattedName) - ->setPath($path); + $request = (new ReadRepositoryFileRequest())->setName($formattedName)->setPath($path); $response = $gapicClient->readRepositoryFile($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3212,19 +3330,20 @@ public function readRepositoryFileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); $path = 'path3433509'; - $request = (new ReadRepositoryFileRequest()) - ->setName($formattedName) - ->setPath($path); + $request = (new ReadRepositoryFileRequest())->setName($formattedName)->setPath($path); try { $gapicClient->readRepositoryFile($request); // If the $gapicClient method call did not throw, fail the test @@ -3252,9 +3371,7 @@ public function removeDirectoryTest() // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); $path = 'path3433509'; - $request = (new RemoveDirectoryRequest()) - ->setWorkspace($formattedWorkspace) - ->setPath($path); + $request = (new RemoveDirectoryRequest())->setWorkspace($formattedWorkspace)->setPath($path); $gapicClient->removeDirectory($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -3279,19 +3396,20 @@ public function removeDirectoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); $path = 'path3433509'; - $request = (new RemoveDirectoryRequest()) - ->setWorkspace($formattedWorkspace) - ->setPath($path); + $request = (new RemoveDirectoryRequest())->setWorkspace($formattedWorkspace)->setPath($path); try { $gapicClient->removeDirectory($request); // If the $gapicClient method call did not throw, fail the test @@ -3319,9 +3437,7 @@ public function removeFileTest() // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); $path = 'path3433509'; - $request = (new RemoveFileRequest()) - ->setWorkspace($formattedWorkspace) - ->setPath($path); + $request = (new RemoveFileRequest())->setWorkspace($formattedWorkspace)->setPath($path); $gapicClient->removeFile($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -3346,19 +3462,20 @@ public function removeFileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); $path = 'path3433509'; - $request = (new RemoveFileRequest()) - ->setWorkspace($formattedWorkspace) - ->setPath($path); + $request = (new RemoveFileRequest())->setWorkspace($formattedWorkspace)->setPath($path); try { $gapicClient->removeFile($request); // If the $gapicClient method call did not throw, fail the test @@ -3385,8 +3502,7 @@ public function resetWorkspaceChangesTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new ResetWorkspaceChangesRequest()) - ->setName($formattedName); + $request = (new ResetWorkspaceChangesRequest())->setName($formattedName); $gapicClient->resetWorkspaceChanges($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -3409,17 +3525,19 @@ public function resetWorkspaceChangesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $request = (new ResetWorkspaceChangesRequest()) - ->setName($formattedName); + $request = (new ResetWorkspaceChangesRequest())->setName($formattedName); try { $gapicClient->resetWorkspaceChanges($request); // If the $gapicClient method call did not throw, fail the test @@ -3458,8 +3576,7 @@ public function updateReleaseConfigTest() $releaseConfig = new ReleaseConfig(); $releaseConfigGitCommitish = 'releaseConfigGitCommitish1714987262'; $releaseConfig->setGitCommitish($releaseConfigGitCommitish); - $request = (new UpdateReleaseConfigRequest()) - ->setReleaseConfig($releaseConfig); + $request = (new UpdateReleaseConfigRequest())->setReleaseConfig($releaseConfig); $response = $gapicClient->updateReleaseConfig($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3483,19 +3600,21 @@ public function updateReleaseConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $releaseConfig = new ReleaseConfig(); $releaseConfigGitCommitish = 'releaseConfigGitCommitish1714987262'; $releaseConfig->setGitCommitish($releaseConfigGitCommitish); - $request = (new UpdateReleaseConfigRequest()) - ->setReleaseConfig($releaseConfig); + $request = (new UpdateReleaseConfigRequest())->setReleaseConfig($releaseConfig); try { $gapicClient->updateReleaseConfig($request); // If the $gapicClient method call did not throw, fail the test @@ -3532,8 +3651,7 @@ public function updateRepositoryTest() $transport->addResponse($expectedResponse); // Mock request $repository = new Repository(); - $request = (new UpdateRepositoryRequest()) - ->setRepository($repository); + $request = (new UpdateRepositoryRequest())->setRepository($repository); $response = $gapicClient->updateRepository($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3557,17 +3675,19 @@ public function updateRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $repository = new Repository(); - $request = (new UpdateRepositoryRequest()) - ->setRepository($repository); + $request = (new UpdateRepositoryRequest())->setRepository($repository); try { $gapicClient->updateRepository($request); // If the $gapicClient method call did not throw, fail the test @@ -3602,10 +3722,14 @@ public function updateWorkflowConfigTest() $transport->addResponse($expectedResponse); // Mock request $workflowConfig = new WorkflowConfig(); - $workflowConfigReleaseConfig = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); + $workflowConfigReleaseConfig = $gapicClient->releaseConfigName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[RELEASE_CONFIG]' + ); $workflowConfig->setReleaseConfig($workflowConfigReleaseConfig); - $request = (new UpdateWorkflowConfigRequest()) - ->setWorkflowConfig($workflowConfig); + $request = (new UpdateWorkflowConfigRequest())->setWorkflowConfig($workflowConfig); $response = $gapicClient->updateWorkflowConfig($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3629,19 +3753,26 @@ public function updateWorkflowConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $workflowConfig = new WorkflowConfig(); - $workflowConfigReleaseConfig = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); + $workflowConfigReleaseConfig = $gapicClient->releaseConfigName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[RELEASE_CONFIG]' + ); $workflowConfig->setReleaseConfig($workflowConfigReleaseConfig); - $request = (new UpdateWorkflowConfigRequest()) - ->setWorkflowConfig($workflowConfig); + $request = (new UpdateWorkflowConfigRequest())->setWorkflowConfig($workflowConfig); try { $gapicClient->updateWorkflowConfig($request); // If the $gapicClient method call did not throw, fail the test @@ -3701,12 +3832,15 @@ public function writeFileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); @@ -3768,12 +3902,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -3800,9 +3937,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -3832,12 +3967,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { @@ -3870,8 +4008,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3895,17 +4032,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -3937,9 +4076,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -3965,19 +4102,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -4005,9 +4143,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -4033,19 +4169,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -4071,9 +4208,13 @@ public function cancelWorkflowInvocationAsyncTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $request = (new CancelWorkflowInvocationRequest()) - ->setName($formattedName); + $formattedName = $gapicClient->workflowInvocationName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[WORKFLOW_INVOCATION]' + ); + $request = (new CancelWorkflowInvocationRequest())->setName($formattedName); $gapicClient->cancelWorkflowInvocationAsync($request)->wait(); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); diff --git a/Dataform/tests/Unit/V1beta1/DataformClientTest.php b/Dataform/tests/Unit/V1beta1/DataformClientTest.php deleted file mode 100644 index 5925809e4eb0..000000000000 --- a/Dataform/tests/Unit/V1beta1/DataformClientTest.php +++ /dev/null @@ -1,3731 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataformClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataformClient($options); - } - - /** @test */ - public function cancelWorkflowInvocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $gapicClient->cancelWorkflowInvocation($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/CancelWorkflowInvocation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelWorkflowInvocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - try { - $gapicClient->cancelWorkflowInvocation($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitRepositoryChangesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $commitMetadata = new CommitMetadata(); - $commitMetadataAuthor = new CommitAuthor(); - $authorName = 'authorName-1501539658'; - $commitMetadataAuthor->setName($authorName); - $authorEmailAddress = 'authorEmailAddress-6398493'; - $commitMetadataAuthor->setEmailAddress($authorEmailAddress); - $commitMetadata->setAuthor($commitMetadataAuthor); - $gapicClient->commitRepositoryChanges($formattedName, $commitMetadata); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/CommitRepositoryChanges', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getCommitMetadata(); - $this->assertProtobufEquals($commitMetadata, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitRepositoryChangesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $commitMetadata = new CommitMetadata(); - $commitMetadataAuthor = new CommitAuthor(); - $authorName = 'authorName-1501539658'; - $commitMetadataAuthor->setName($authorName); - $authorEmailAddress = 'authorEmailAddress-6398493'; - $commitMetadataAuthor->setEmailAddress($authorEmailAddress); - $commitMetadata->setAuthor($commitMetadataAuthor); - try { - $gapicClient->commitRepositoryChanges($formattedName, $commitMetadata); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitWorkspaceChangesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $author = new CommitAuthor(); - $authorName = 'authorName-1501539658'; - $author->setName($authorName); - $authorEmailAddress = 'authorEmailAddress-6398493'; - $author->setEmailAddress($authorEmailAddress); - $gapicClient->commitWorkspaceChanges($formattedName, $author); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/CommitWorkspaceChanges', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getAuthor(); - $this->assertProtobufEquals($author, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitWorkspaceChangesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $author = new CommitAuthor(); - $authorName = 'authorName-1501539658'; - $author->setName($authorName); - $authorEmailAddress = 'authorEmailAddress-6398493'; - $author->setEmailAddress($authorEmailAddress); - try { - $gapicClient->commitWorkspaceChanges($formattedName, $author); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function computeRepositoryAccessTokenStatusTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ComputeRepositoryAccessTokenStatusResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->computeRepositoryAccessTokenStatus($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/ComputeRepositoryAccessTokenStatus', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function computeRepositoryAccessTokenStatusExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->computeRepositoryAccessTokenStatus($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createCompilationResultTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $gitCommitish = 'gitCommitish-459981894'; - $resolvedGitCommitSha = 'resolvedGitCommitSha-1974209704'; - $dataformCoreVersion = 'dataformCoreVersion1918089577'; - $expectedResponse = new CompilationResult(); - $expectedResponse->setName($name); - $expectedResponse->setGitCommitish($gitCommitish); - $expectedResponse->setResolvedGitCommitSha($resolvedGitCommitSha); - $expectedResponse->setDataformCoreVersion($dataformCoreVersion); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $compilationResult = new CompilationResult(); - $response = $gapicClient->createCompilationResult($formattedParent, $compilationResult); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/CreateCompilationResult', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getCompilationResult(); - $this->assertProtobufEquals($compilationResult, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createCompilationResultExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $compilationResult = new CompilationResult(); - try { - $gapicClient->createCompilationResult($formattedParent, $compilationResult); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createReleaseConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $gitCommitish = 'gitCommitish-459981894'; - $cronSchedule = 'cronSchedule206244136'; - $timeZone = 'timeZone36848094'; - $releaseCompilationResult = 'releaseCompilationResult1831489873'; - $expectedResponse = new ReleaseConfig(); - $expectedResponse->setName($name); - $expectedResponse->setGitCommitish($gitCommitish); - $expectedResponse->setCronSchedule($cronSchedule); - $expectedResponse->setTimeZone($timeZone); - $expectedResponse->setReleaseCompilationResult($releaseCompilationResult); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $releaseConfig = new ReleaseConfig(); - $releaseConfigGitCommitish = 'releaseConfigGitCommitish1714987262'; - $releaseConfig->setGitCommitish($releaseConfigGitCommitish); - $releaseConfigId = 'releaseConfigId-113371904'; - $response = $gapicClient->createReleaseConfig($formattedParent, $releaseConfig, $releaseConfigId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/CreateReleaseConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getReleaseConfig(); - $this->assertProtobufEquals($releaseConfig, $actualValue); - $actualValue = $actualRequestObject->getReleaseConfigId(); - $this->assertProtobufEquals($releaseConfigId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createReleaseConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $releaseConfig = new ReleaseConfig(); - $releaseConfigGitCommitish = 'releaseConfigGitCommitish1714987262'; - $releaseConfig->setGitCommitish($releaseConfigGitCommitish); - $releaseConfigId = 'releaseConfigId-113371904'; - try { - $gapicClient->createReleaseConfig($formattedParent, $releaseConfig, $releaseConfigId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createRepositoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $npmrcEnvironmentVariablesSecretVersion = 'npmrcEnvironmentVariablesSecretVersion-2118517056'; - $setAuthenticatedUserAdmin = true; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setNpmrcEnvironmentVariablesSecretVersion($npmrcEnvironmentVariablesSecretVersion); - $expectedResponse->setSetAuthenticatedUserAdmin($setAuthenticatedUserAdmin); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $repository = new Repository(); - $repositoryId = 'repositoryId1101683248'; - $response = $gapicClient->createRepository($formattedParent, $repository, $repositoryId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/CreateRepository', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getRepository(); - $this->assertProtobufEquals($repository, $actualValue); - $actualValue = $actualRequestObject->getRepositoryId(); - $this->assertProtobufEquals($repositoryId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createRepositoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $repository = new Repository(); - $repositoryId = 'repositoryId1101683248'; - try { - $gapicClient->createRepository($formattedParent, $repository, $repositoryId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createWorkflowConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $releaseConfig = 'releaseConfig582587002'; - $cronSchedule = 'cronSchedule206244136'; - $timeZone = 'timeZone36848094'; - $expectedResponse = new WorkflowConfig(); - $expectedResponse->setName($name); - $expectedResponse->setReleaseConfig($releaseConfig); - $expectedResponse->setCronSchedule($cronSchedule); - $expectedResponse->setTimeZone($timeZone); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $workflowConfig = new WorkflowConfig(); - $workflowConfigReleaseConfig = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - $workflowConfig->setReleaseConfig($workflowConfigReleaseConfig); - $workflowConfigId = 'workflowConfigId-60129608'; - $response = $gapicClient->createWorkflowConfig($formattedParent, $workflowConfig, $workflowConfigId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/CreateWorkflowConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getWorkflowConfig(); - $this->assertProtobufEquals($workflowConfig, $actualValue); - $actualValue = $actualRequestObject->getWorkflowConfigId(); - $this->assertProtobufEquals($workflowConfigId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createWorkflowConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $workflowConfig = new WorkflowConfig(); - $workflowConfigReleaseConfig = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - $workflowConfig->setReleaseConfig($workflowConfigReleaseConfig); - $workflowConfigId = 'workflowConfigId-60129608'; - try { - $gapicClient->createWorkflowConfig($formattedParent, $workflowConfig, $workflowConfigId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createWorkflowInvocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $compilationResult = 'compilationResult-2035984871'; - $expectedResponse = new WorkflowInvocation(); - $expectedResponse->setName($name); - $expectedResponse->setCompilationResult($compilationResult); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $workflowInvocation = new WorkflowInvocation(); - $response = $gapicClient->createWorkflowInvocation($formattedParent, $workflowInvocation); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/CreateWorkflowInvocation', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getWorkflowInvocation(); - $this->assertProtobufEquals($workflowInvocation, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createWorkflowInvocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $workflowInvocation = new WorkflowInvocation(); - try { - $gapicClient->createWorkflowInvocation($formattedParent, $workflowInvocation); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createWorkspaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Workspace(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $workspace = new Workspace(); - $workspaceId = 'workspaceId1578483973'; - $response = $gapicClient->createWorkspace($formattedParent, $workspace, $workspaceId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/CreateWorkspace', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getWorkspace(); - $this->assertProtobufEquals($workspace, $actualValue); - $actualValue = $actualRequestObject->getWorkspaceId(); - $this->assertProtobufEquals($workspaceId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createWorkspaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $workspace = new Workspace(); - $workspaceId = 'workspaceId1578483973'; - try { - $gapicClient->createWorkspace($formattedParent, $workspace, $workspaceId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteReleaseConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - $gapicClient->deleteReleaseConfig($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/DeleteReleaseConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteReleaseConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - try { - $gapicClient->deleteReleaseConfig($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteRepositoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $gapicClient->deleteRepository($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/DeleteRepository', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteRepositoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->deleteRepository($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteWorkflowConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workflowConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_CONFIG]'); - $gapicClient->deleteWorkflowConfig($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/DeleteWorkflowConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteWorkflowConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workflowConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_CONFIG]'); - try { - $gapicClient->deleteWorkflowConfig($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteWorkflowInvocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $gapicClient->deleteWorkflowInvocation($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/DeleteWorkflowInvocation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteWorkflowInvocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - try { - $gapicClient->deleteWorkflowInvocation($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteWorkspaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $gapicClient->deleteWorkspace($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/DeleteWorkspace', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteWorkspaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - try { - $gapicClient->deleteWorkspace($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchFileDiffTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $formattedDiff = 'formattedDiff-1687410264'; - $expectedResponse = new FetchFileDiffResponse(); - $expectedResponse->setFormattedDiff($formattedDiff); - $transport->addResponse($expectedResponse); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - $response = $gapicClient->fetchFileDiff($formattedWorkspace, $path); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/FetchFileDiff', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkspace(); - $this->assertProtobufEquals($formattedWorkspace, $actualValue); - $actualValue = $actualRequestObject->getPath(); - $this->assertProtobufEquals($path, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchFileDiffExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - try { - $gapicClient->fetchFileDiff($formattedWorkspace, $path); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchFileGitStatusesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new FetchFileGitStatusesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $response = $gapicClient->fetchFileGitStatuses($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/FetchFileGitStatuses', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchFileGitStatusesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - try { - $gapicClient->fetchFileGitStatuses($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchGitAheadBehindTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $commitsAhead = 1216483806; - $commitsBehind = 917751619; - $expectedResponse = new FetchGitAheadBehindResponse(); - $expectedResponse->setCommitsAhead($commitsAhead); - $expectedResponse->setCommitsBehind($commitsBehind); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $response = $gapicClient->fetchGitAheadBehind($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/FetchGitAheadBehind', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchGitAheadBehindExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - try { - $gapicClient->fetchGitAheadBehind($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchRemoteBranchesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new FetchRemoteBranchesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->fetchRemoteBranches($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/FetchRemoteBranches', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchRemoteBranchesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->fetchRemoteBranches($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchRepositoryHistoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $commitsElement = new CommitLogEntry(); - $commits = [ - $commitsElement, - ]; - $expectedResponse = new FetchRepositoryHistoryResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCommits($commits); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->fetchRepositoryHistory($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCommits()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/FetchRepositoryHistory', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchRepositoryHistoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->fetchRepositoryHistory($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCompilationResultTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $gitCommitish = 'gitCommitish-459981894'; - $resolvedGitCommitSha = 'resolvedGitCommitSha-1974209704'; - $dataformCoreVersion = 'dataformCoreVersion1918089577'; - $expectedResponse = new CompilationResult(); - $expectedResponse->setName($name2); - $expectedResponse->setGitCommitish($gitCommitish); - $expectedResponse->setResolvedGitCommitSha($resolvedGitCommitSha); - $expectedResponse->setDataformCoreVersion($dataformCoreVersion); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->compilationResultName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[COMPILATION_RESULT]'); - $response = $gapicClient->getCompilationResult($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/GetCompilationResult', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCompilationResultExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->compilationResultName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[COMPILATION_RESULT]'); - try { - $gapicClient->getCompilationResult($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getReleaseConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $gitCommitish = 'gitCommitish-459981894'; - $cronSchedule = 'cronSchedule206244136'; - $timeZone = 'timeZone36848094'; - $releaseCompilationResult = 'releaseCompilationResult1831489873'; - $expectedResponse = new ReleaseConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setGitCommitish($gitCommitish); - $expectedResponse->setCronSchedule($cronSchedule); - $expectedResponse->setTimeZone($timeZone); - $expectedResponse->setReleaseCompilationResult($releaseCompilationResult); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - $response = $gapicClient->getReleaseConfig($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/GetReleaseConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getReleaseConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - try { - $gapicClient->getReleaseConfig($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRepositoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $npmrcEnvironmentVariablesSecretVersion = 'npmrcEnvironmentVariablesSecretVersion-2118517056'; - $setAuthenticatedUserAdmin = true; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setNpmrcEnvironmentVariablesSecretVersion($npmrcEnvironmentVariablesSecretVersion); - $expectedResponse->setSetAuthenticatedUserAdmin($setAuthenticatedUserAdmin); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->getRepository($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/GetRepository', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRepositoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->getRepository($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkflowConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $releaseConfig = 'releaseConfig582587002'; - $cronSchedule = 'cronSchedule206244136'; - $timeZone = 'timeZone36848094'; - $expectedResponse = new WorkflowConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setReleaseConfig($releaseConfig); - $expectedResponse->setCronSchedule($cronSchedule); - $expectedResponse->setTimeZone($timeZone); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workflowConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_CONFIG]'); - $response = $gapicClient->getWorkflowConfig($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/GetWorkflowConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkflowConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workflowConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_CONFIG]'); - try { - $gapicClient->getWorkflowConfig($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkflowInvocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $compilationResult = 'compilationResult-2035984871'; - $expectedResponse = new WorkflowInvocation(); - $expectedResponse->setName($name2); - $expectedResponse->setCompilationResult($compilationResult); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $response = $gapicClient->getWorkflowInvocation($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/GetWorkflowInvocation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkflowInvocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - try { - $gapicClient->getWorkflowInvocation($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkspaceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Workspace(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $response = $gapicClient->getWorkspace($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/GetWorkspace', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkspaceExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - try { - $gapicClient->getWorkspace($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function installNpmPackagesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new InstallNpmPackagesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $response = $gapicClient->installNpmPackages($formattedWorkspace); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/InstallNpmPackages', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkspace(); - $this->assertProtobufEquals($formattedWorkspace, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function installNpmPackagesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - try { - $gapicClient->installNpmPackages($formattedWorkspace); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCompilationResultsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $compilationResultsElement = new CompilationResult(); - $compilationResults = [ - $compilationResultsElement, - ]; - $expectedResponse = new ListCompilationResultsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCompilationResults($compilationResults); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->listCompilationResults($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCompilationResults()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/ListCompilationResults', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCompilationResultsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->listCompilationResults($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listReleaseConfigsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $releaseConfigsElement = new ReleaseConfig(); - $releaseConfigs = [ - $releaseConfigsElement, - ]; - $expectedResponse = new ListReleaseConfigsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setReleaseConfigs($releaseConfigs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->listReleaseConfigs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getReleaseConfigs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/ListReleaseConfigs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listReleaseConfigsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->listReleaseConfigs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRepositoriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; - $expectedResponse = new ListRepositoriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRepositories($repositories); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listRepositories($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRepositories()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/ListRepositories', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRepositoriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listRepositories($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkflowConfigsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $workflowConfigsElement = new WorkflowConfig(); - $workflowConfigs = [ - $workflowConfigsElement, - ]; - $expectedResponse = new ListWorkflowConfigsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setWorkflowConfigs($workflowConfigs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->listWorkflowConfigs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getWorkflowConfigs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/ListWorkflowConfigs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkflowConfigsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->listWorkflowConfigs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkflowInvocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $workflowInvocationsElement = new WorkflowInvocation(); - $workflowInvocations = [ - $workflowInvocationsElement, - ]; - $expectedResponse = new ListWorkflowInvocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setWorkflowInvocations($workflowInvocations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->listWorkflowInvocations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getWorkflowInvocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/ListWorkflowInvocations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkflowInvocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->listWorkflowInvocations($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkspacesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $workspacesElement = new Workspace(); - $workspaces = [ - $workspacesElement, - ]; - $expectedResponse = new ListWorkspacesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setWorkspaces($workspaces); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->listWorkspaces($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getWorkspaces()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/ListWorkspaces', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkspacesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->listWorkspaces($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function makeDirectoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new MakeDirectoryResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - $response = $gapicClient->makeDirectory($formattedWorkspace, $path); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/MakeDirectory', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkspace(); - $this->assertProtobufEquals($formattedWorkspace, $actualValue); - $actualValue = $actualRequestObject->getPath(); - $this->assertProtobufEquals($path, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function makeDirectoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - try { - $gapicClient->makeDirectory($formattedWorkspace, $path); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function moveDirectoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new MoveDirectoryResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - $newPath = 'newPath1377204068'; - $response = $gapicClient->moveDirectory($formattedWorkspace, $path, $newPath); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/MoveDirectory', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkspace(); - $this->assertProtobufEquals($formattedWorkspace, $actualValue); - $actualValue = $actualRequestObject->getPath(); - $this->assertProtobufEquals($path, $actualValue); - $actualValue = $actualRequestObject->getNewPath(); - $this->assertProtobufEquals($newPath, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function moveDirectoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - $newPath = 'newPath1377204068'; - try { - $gapicClient->moveDirectory($formattedWorkspace, $path, $newPath); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function moveFileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new MoveFileResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - $newPath = 'newPath1377204068'; - $response = $gapicClient->moveFile($formattedWorkspace, $path, $newPath); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/MoveFile', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkspace(); - $this->assertProtobufEquals($formattedWorkspace, $actualValue); - $actualValue = $actualRequestObject->getPath(); - $this->assertProtobufEquals($path, $actualValue); - $actualValue = $actualRequestObject->getNewPath(); - $this->assertProtobufEquals($newPath, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function moveFileExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - $newPath = 'newPath1377204068'; - try { - $gapicClient->moveFile($formattedWorkspace, $path, $newPath); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pullGitCommitsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $author = new CommitAuthor(); - $authorName = 'authorName-1501539658'; - $author->setName($authorName); - $authorEmailAddress = 'authorEmailAddress-6398493'; - $author->setEmailAddress($authorEmailAddress); - $gapicClient->pullGitCommits($formattedName, $author); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/PullGitCommits', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getAuthor(); - $this->assertProtobufEquals($author, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pullGitCommitsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $author = new CommitAuthor(); - $authorName = 'authorName-1501539658'; - $author->setName($authorName); - $authorEmailAddress = 'authorEmailAddress-6398493'; - $author->setEmailAddress($authorEmailAddress); - try { - $gapicClient->pullGitCommits($formattedName, $author); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pushGitCommitsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $gapicClient->pushGitCommits($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/PushGitCommits', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pushGitCommitsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - try { - $gapicClient->pushGitCommits($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryCompilationResultActionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $compilationResultActionsElement = new CompilationResultAction(); - $compilationResultActions = [ - $compilationResultActionsElement, - ]; - $expectedResponse = new QueryCompilationResultActionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCompilationResultActions($compilationResultActions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->compilationResultName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[COMPILATION_RESULT]'); - $response = $gapicClient->queryCompilationResultActions($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCompilationResultActions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/QueryCompilationResultActions', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryCompilationResultActionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->compilationResultName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[COMPILATION_RESULT]'); - try { - $gapicClient->queryCompilationResultActions($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryDirectoryContentsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $directoryEntriesElement = new DirectoryEntry(); - $directoryEntries = [ - $directoryEntriesElement, - ]; - $expectedResponse = new QueryDirectoryContentsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDirectoryEntries($directoryEntries); - $transport->addResponse($expectedResponse); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $response = $gapicClient->queryDirectoryContents($formattedWorkspace); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDirectoryEntries()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/QueryDirectoryContents', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkspace(); - $this->assertProtobufEquals($formattedWorkspace, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryDirectoryContentsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - try { - $gapicClient->queryDirectoryContents($formattedWorkspace); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryRepositoryDirectoryContentsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $directoryEntriesElement = new DirectoryEntry(); - $directoryEntries = [ - $directoryEntriesElement, - ]; - $expectedResponse = new QueryRepositoryDirectoryContentsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDirectoryEntries($directoryEntries); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->queryRepositoryDirectoryContents($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDirectoryEntries()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/QueryRepositoryDirectoryContents', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryRepositoryDirectoryContentsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->queryRepositoryDirectoryContents($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryWorkflowInvocationActionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $workflowInvocationActionsElement = new WorkflowInvocationAction(); - $workflowInvocationActions = [ - $workflowInvocationActionsElement, - ]; - $expectedResponse = new QueryWorkflowInvocationActionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setWorkflowInvocationActions($workflowInvocationActions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - $response = $gapicClient->queryWorkflowInvocationActions($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getWorkflowInvocationActions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/QueryWorkflowInvocationActions', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function queryWorkflowInvocationActionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workflowInvocationName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKFLOW_INVOCATION]'); - try { - $gapicClient->queryWorkflowInvocationActions($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readFileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $fileContents = '125'; - $expectedResponse = new ReadFileResponse(); - $expectedResponse->setFileContents($fileContents); - $transport->addResponse($expectedResponse); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - $response = $gapicClient->readFile($formattedWorkspace, $path); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/ReadFile', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkspace(); - $this->assertProtobufEquals($formattedWorkspace, $actualValue); - $actualValue = $actualRequestObject->getPath(); - $this->assertProtobufEquals($path, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readFileExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - try { - $gapicClient->readFile($formattedWorkspace, $path); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readRepositoryFileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $contents = '26'; - $expectedResponse = new ReadRepositoryFileResponse(); - $expectedResponse->setContents($contents); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $path = 'path3433509'; - $response = $gapicClient->readRepositoryFile($formattedName, $path); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/ReadRepositoryFile', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getPath(); - $this->assertProtobufEquals($path, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function readRepositoryFileExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $path = 'path3433509'; - try { - $gapicClient->readRepositoryFile($formattedName, $path); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeDirectoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - $gapicClient->removeDirectory($formattedWorkspace, $path); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/RemoveDirectory', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkspace(); - $this->assertProtobufEquals($formattedWorkspace, $actualValue); - $actualValue = $actualRequestObject->getPath(); - $this->assertProtobufEquals($path, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeDirectoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - try { - $gapicClient->removeDirectory($formattedWorkspace, $path); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeFileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - $gapicClient->removeFile($formattedWorkspace, $path); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/RemoveFile', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkspace(); - $this->assertProtobufEquals($formattedWorkspace, $actualValue); - $actualValue = $actualRequestObject->getPath(); - $this->assertProtobufEquals($path, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeFileExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - try { - $gapicClient->removeFile($formattedWorkspace, $path); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resetWorkspaceChangesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $gapicClient->resetWorkspaceChanges($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/ResetWorkspaceChanges', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resetWorkspaceChangesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - try { - $gapicClient->resetWorkspaceChanges($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateReleaseConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $gitCommitish = 'gitCommitish-459981894'; - $cronSchedule = 'cronSchedule206244136'; - $timeZone = 'timeZone36848094'; - $releaseCompilationResult = 'releaseCompilationResult1831489873'; - $expectedResponse = new ReleaseConfig(); - $expectedResponse->setName($name); - $expectedResponse->setGitCommitish($gitCommitish); - $expectedResponse->setCronSchedule($cronSchedule); - $expectedResponse->setTimeZone($timeZone); - $expectedResponse->setReleaseCompilationResult($releaseCompilationResult); - $transport->addResponse($expectedResponse); - // Mock request - $releaseConfig = new ReleaseConfig(); - $releaseConfigGitCommitish = 'releaseConfigGitCommitish1714987262'; - $releaseConfig->setGitCommitish($releaseConfigGitCommitish); - $response = $gapicClient->updateReleaseConfig($releaseConfig); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/UpdateReleaseConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getReleaseConfig(); - $this->assertProtobufEquals($releaseConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateReleaseConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $releaseConfig = new ReleaseConfig(); - $releaseConfigGitCommitish = 'releaseConfigGitCommitish1714987262'; - $releaseConfig->setGitCommitish($releaseConfigGitCommitish); - try { - $gapicClient->updateReleaseConfig($releaseConfig); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRepositoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $npmrcEnvironmentVariablesSecretVersion = 'npmrcEnvironmentVariablesSecretVersion-2118517056'; - $setAuthenticatedUserAdmin = true; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setNpmrcEnvironmentVariablesSecretVersion($npmrcEnvironmentVariablesSecretVersion); - $expectedResponse->setSetAuthenticatedUserAdmin($setAuthenticatedUserAdmin); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $repository = new Repository(); - $response = $gapicClient->updateRepository($repository); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/UpdateRepository', $actualFuncCall); - $actualValue = $actualRequestObject->getRepository(); - $this->assertProtobufEquals($repository, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRepositoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $repository = new Repository(); - try { - $gapicClient->updateRepository($repository); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateWorkflowConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $releaseConfig = 'releaseConfig582587002'; - $cronSchedule = 'cronSchedule206244136'; - $timeZone = 'timeZone36848094'; - $expectedResponse = new WorkflowConfig(); - $expectedResponse->setName($name); - $expectedResponse->setReleaseConfig($releaseConfig); - $expectedResponse->setCronSchedule($cronSchedule); - $expectedResponse->setTimeZone($timeZone); - $transport->addResponse($expectedResponse); - // Mock request - $workflowConfig = new WorkflowConfig(); - $workflowConfigReleaseConfig = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - $workflowConfig->setReleaseConfig($workflowConfigReleaseConfig); - $response = $gapicClient->updateWorkflowConfig($workflowConfig); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/UpdateWorkflowConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkflowConfig(); - $this->assertProtobufEquals($workflowConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateWorkflowConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $workflowConfig = new WorkflowConfig(); - $workflowConfigReleaseConfig = $gapicClient->releaseConfigName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RELEASE_CONFIG]'); - $workflowConfig->setReleaseConfig($workflowConfigReleaseConfig); - try { - $gapicClient->updateWorkflowConfig($workflowConfig); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeFileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new WriteFileResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - $contents = '26'; - $response = $gapicClient->writeFile($formattedWorkspace, $path, $contents); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dataform.v1beta1.Dataform/WriteFile', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkspace(); - $this->assertProtobufEquals($formattedWorkspace, $actualValue); - $actualValue = $actualRequestObject->getPath(); - $this->assertProtobufEquals($path, $actualValue); - $actualValue = $actualRequestObject->getContents(); - $this->assertProtobufEquals($contents, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeFileExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedWorkspace = $gapicClient->workspaceName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[WORKSPACE]'); - $path = 'path3433509'; - $contents = '26'; - try { - $gapicClient->writeFile($formattedWorkspace, $path, $contents); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}