diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index aee9e2dd1bd..05a2423da92 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -512,7 +512,7 @@ "DataprocMetastore": { "language": "php", "distribution_name": "google/cloud-dataproc-metastore", - "release_level": "preview", + "release_level": "stable", "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataproc-metastore/latest", "library_type": "GAPIC_AUTO", "api_shortname": "metastore" diff --git a/DataprocMetastore/.OwlBot.yaml b/DataprocMetastore/.OwlBot.yaml index f02ac808c17..4483418334b 100644 --- a/DataprocMetastore/.OwlBot.yaml +++ b/DataprocMetastore/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/metastore/(.*)/.*-php/(.*) + - source: /google/cloud/metastore/(v1)/.*-php/(.*) dest: /owl-bot-staging/DataprocMetastore/$1/$2 api-name: DataprocMetastore diff --git a/DataprocMetastore/README.md b/DataprocMetastore/README.md index 736ce753e08..21262c935be 100644 --- a/DataprocMetastore/README.md +++ b/DataprocMetastore/README.md @@ -31,9 +31,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/DataprocMetastore/metadata/V1Alpha/Metastore.php b/DataprocMetastore/metadata/V1Alpha/Metastore.php deleted file mode 100644 index f9a994e9230..00000000000 Binary files a/DataprocMetastore/metadata/V1Alpha/Metastore.php and /dev/null differ diff --git a/DataprocMetastore/metadata/V1Alpha/MetastoreFederation.php b/DataprocMetastore/metadata/V1Alpha/MetastoreFederation.php deleted file mode 100644 index aecfb10338b..00000000000 Binary files a/DataprocMetastore/metadata/V1Alpha/MetastoreFederation.php and /dev/null differ diff --git a/DataprocMetastore/metadata/V1Beta/Metastore.php b/DataprocMetastore/metadata/V1Beta/Metastore.php deleted file mode 100644 index fcb0d46fe42..00000000000 Binary files a/DataprocMetastore/metadata/V1Beta/Metastore.php and /dev/null differ diff --git a/DataprocMetastore/metadata/V1Beta/MetastoreFederation.php b/DataprocMetastore/metadata/V1Beta/MetastoreFederation.php deleted file mode 100644 index 7d146c599bd..00000000000 Binary files a/DataprocMetastore/metadata/V1Beta/MetastoreFederation.php and /dev/null differ diff --git a/DataprocMetastore/owlbot.py b/DataprocMetastore/owlbot.py index 1681b97bf6c..7d16d1233b7 100644 --- a/DataprocMetastore/owlbot.py +++ b/DataprocMetastore/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,34 +32,25 @@ php.owlbot_main(src=src, dest=dest) -# Change the wording for the deprecation warning. +# remove class_alias code s.replace( - 'src/*/*_*.php', - r'will be removed in the next major release', - 'will be removed in a future release') - -### [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)" -) + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/DataprocMetastore/src/V1/AlterMetadataResourceLocationRequest.php b/DataprocMetastore/src/V1/AlterMetadataResourceLocationRequest.php index affcd033b6e..1ac3c96a5ae 100644 --- a/DataprocMetastore/src/V1/AlterMetadataResourceLocationRequest.php +++ b/DataprocMetastore/src/V1/AlterMetadataResourceLocationRequest.php @@ -23,7 +23,7 @@ class AlterMetadataResourceLocationRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Required. The relative metadata resource name in the following format. * `databases/{database_id}` @@ -34,13 +34,13 @@ class AlterMetadataResourceLocationRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $resource_name = ''; + protected $resource_name = ''; /** * Required. The new location URI for the metadata resource. * * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $location_uri = ''; + protected $location_uri = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/AuxiliaryVersionConfig.php b/DataprocMetastore/src/V1/AuxiliaryVersionConfig.php index 67f9b93ccd0..f140b4c7661 100644 --- a/DataprocMetastore/src/V1/AuxiliaryVersionConfig.php +++ b/DataprocMetastore/src/V1/AuxiliaryVersionConfig.php @@ -21,7 +21,7 @@ class AuxiliaryVersionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 1; */ - private $version = ''; + protected $version = ''; /** * A mapping of Hive metastore configuration key-value pairs to apply to the * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to @@ -38,7 +38,7 @@ class AuxiliaryVersionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $network_config = null; + protected $network_config = null; /** * Constructor. diff --git a/DataprocMetastore/src/V1/BackendMetastore.php b/DataprocMetastore/src/V1/BackendMetastore.php index b3c3eeaeda9..ec94c364d40 100644 --- a/DataprocMetastore/src/V1/BackendMetastore.php +++ b/DataprocMetastore/src/V1/BackendMetastore.php @@ -26,13 +26,13 @@ class BackendMetastore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The type of the backend metastore. * * Generated from protobuf field .google.cloud.metastore.v1.BackendMetastore.MetastoreType metastore_type = 2; */ - private $metastore_type = 0; + protected $metastore_type = 0; /** * Constructor. diff --git a/DataprocMetastore/src/V1/BackendMetastore/MetastoreType.php b/DataprocMetastore/src/V1/BackendMetastore/MetastoreType.php index afb63721d03..3ba00a37be9 100644 --- a/DataprocMetastore/src/V1/BackendMetastore/MetastoreType.php +++ b/DataprocMetastore/src/V1/BackendMetastore/MetastoreType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MetastoreType::class, \Google\Cloud\Metastore\V1\BackendMetastore_MetastoreType::class); diff --git a/DataprocMetastore/src/V1/BackendMetastore_MetastoreType.php b/DataprocMetastore/src/V1/BackendMetastore_MetastoreType.php deleted file mode 100644 index 3518a6ccf19..00000000000 --- a/DataprocMetastore/src/V1/BackendMetastore_MetastoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Output only. The time when the backup was started. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the backup finished creating. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The current state of the backup. * * Generated from protobuf field .google.cloud.metastore.v1.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The revision of the service at the time of backup. * * Generated from protobuf field .google.cloud.metastore.v1.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $service_revision = null; + protected $service_revision = null; /** * The description of the backup. * * Generated from protobuf field string description = 6; */ - private $description = ''; + protected $description = ''; /** * Output only. Services that are restoring from the backup. * diff --git a/DataprocMetastore/src/V1/Backup/State.php b/DataprocMetastore/src/V1/Backup/State.php index 22fbd2881e2..45636635b4a 100644 --- a/DataprocMetastore/src/V1/Backup/State.php +++ b/DataprocMetastore/src/V1/Backup/State.php @@ -80,6 +80,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\Backup_State::class); diff --git a/DataprocMetastore/src/V1/Backup_State.php b/DataprocMetastore/src/V1/Backup_State.php deleted file mode 100644 index 7462ccdc0ed..00000000000 --- a/DataprocMetastore/src/V1/Backup_State.php +++ /dev/null @@ -1,16 +0,0 @@ -descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a backup * resource. @@ -247,8 +266,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted metadata_import resource. */ - public static function metadataImportName(string $project, string $location, string $service, string $metadataImport): string - { + public static function metadataImportName( + string $project, + string $location, + string $service, + string $metadataImport + ): string { return self::getPathTemplate('metadataImport')->render([ 'project' => $project, 'location' => $location, @@ -438,8 +461,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function alterMetadataResourceLocation(AlterMetadataResourceLocationRequest $request, array $callOptions = []): OperationResponse - { + public function alterMetadataResourceLocation( + AlterMetadataResourceLocationRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('AlterMetadataResourceLocation', $request, $callOptions)->wait(); } @@ -491,8 +516,10 @@ public function createBackup(CreateBackupRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function createMetadataImport(CreateMetadataImportRequest $request, array $callOptions = []): OperationResponse - { + public function createMetadataImport( + CreateMetadataImportRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateMetadataImport', $request, $callOptions)->wait(); } @@ -859,8 +886,10 @@ public function restoreService(RestoreServiceRequest $request, array $callOption * * @throws ApiException Thrown if the API call fails. */ - public function updateMetadataImport(UpdateMetadataImportRequest $request, array $callOptions = []): OperationResponse - { + public function updateMetadataImport( + UpdateMetadataImportRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateMetadataImport', $request, $callOptions)->wait(); } @@ -1026,8 +1055,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - 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/DataprocMetastore/src/V1/Client/DataprocMetastoreFederationClient.php b/DataprocMetastore/src/V1/Client/DataprocMetastoreFederationClient.php index bd8f5d296fc..ac90828d88a 100644 --- a/DataprocMetastore/src/V1/Client/DataprocMetastoreFederationClient.php +++ b/DataprocMetastore/src/V1/Client/DataprocMetastoreFederationClient.php @@ -1,6 +1,6 @@ [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/dataproc_metastore_federation_rest_client_config.php', ], ], ]; @@ -159,12 +158,33 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a federation * resource. @@ -574,8 +594,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - 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/DataprocMetastore/src/V1/CreateBackupRequest.php b/DataprocMetastore/src/V1/CreateBackupRequest.php index 17fcc678aac..f94f371f109 100644 --- a/DataprocMetastore/src/V1/CreateBackupRequest.php +++ b/DataprocMetastore/src/V1/CreateBackupRequest.php @@ -23,7 +23,7 @@ class CreateBackupRequest 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 ID of the backup, which is used as the final component of the * backup's name. @@ -33,14 +33,14 @@ class CreateBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $backup_id = ''; + protected $backup_id = ''; /** * Required. The backup to create. The `name` field is ignored. The ID of the * created backup must be provided in the request's `backup_id` field. * * Generated from protobuf field .google.cloud.metastore.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $backup = null; + protected $backup = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -55,7 +55,7 @@ class CreateBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The relative resource name of the service in which to create a diff --git a/DataprocMetastore/src/V1/CreateFederationRequest.php b/DataprocMetastore/src/V1/CreateFederationRequest.php index 0d8c855ff91..3b708f70866 100644 --- a/DataprocMetastore/src/V1/CreateFederationRequest.php +++ b/DataprocMetastore/src/V1/CreateFederationRequest.php @@ -22,7 +22,7 @@ class CreateFederationRequest 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 ID of the metastore federation, which is used as the final * component of the metastore federation's name. @@ -32,7 +32,7 @@ class CreateFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $federation_id = ''; + protected $federation_id = ''; /** * Required. The Metastore Federation to create. The `name` field is * ignored. The ID of the created metastore federation must be @@ -40,7 +40,7 @@ class CreateFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $federation = null; + protected $federation = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -55,7 +55,7 @@ class CreateFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The relative resource name of the location in which to create a diff --git a/DataprocMetastore/src/V1/CreateMetadataImportRequest.php b/DataprocMetastore/src/V1/CreateMetadataImportRequest.php index 0684c436278..abffe4c45a8 100644 --- a/DataprocMetastore/src/V1/CreateMetadataImportRequest.php +++ b/DataprocMetastore/src/V1/CreateMetadataImportRequest.php @@ -23,7 +23,7 @@ class CreateMetadataImportRequest 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 ID of the metadata import, which is used as the final * component of the metadata import's name. @@ -33,7 +33,7 @@ class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $metadata_import_id = ''; + protected $metadata_import_id = ''; /** * Required. The metadata import to create. The `name` field is ignored. The * ID of the created metadata import must be provided in the request's @@ -41,7 +41,7 @@ class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $metadata_import = null; + protected $metadata_import = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -56,7 +56,7 @@ class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The relative resource name of the service in which to create a diff --git a/DataprocMetastore/src/V1/CreateServiceRequest.php b/DataprocMetastore/src/V1/CreateServiceRequest.php index ad624625ef7..b762fd7142f 100644 --- a/DataprocMetastore/src/V1/CreateServiceRequest.php +++ b/DataprocMetastore/src/V1/CreateServiceRequest.php @@ -23,7 +23,7 @@ class CreateServiceRequest 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 ID of the metastore service, which is used as the final * component of the metastore service's name. @@ -33,7 +33,7 @@ class CreateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $service_id = ''; + protected $service_id = ''; /** * Required. The Metastore service to create. The `name` field is * ignored. The ID of the created metastore service must be provided in @@ -41,7 +41,7 @@ class CreateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $service = null; + protected $service = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -56,7 +56,7 @@ class CreateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $parent Required. The relative resource name of the location in which to create a diff --git a/DataprocMetastore/src/V1/DatabaseDumpSpec/Type.php b/DataprocMetastore/src/V1/DatabaseDumpSpec/Type.php index 2fdb77518f4..2a7e906d932 100644 --- a/DataprocMetastore/src/V1/DatabaseDumpSpec/Type.php +++ b/DataprocMetastore/src/V1/DatabaseDumpSpec/Type.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Metastore\V1\DatabaseDumpSpec_Type::class); diff --git a/DataprocMetastore/src/V1/DatabaseDumpSpec_Type.php b/DataprocMetastore/src/V1/DatabaseDumpSpec_Type.php deleted file mode 100644 index 70a010b3212..00000000000 --- a/DataprocMetastore/src/V1/DatabaseDumpSpec_Type.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1.DataprocMetastoreFederation/ListFederations', - $argument, - ['\Google\Cloud\Metastore\V1\ListFederationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single federation. - * @param \Google\Cloud\Metastore\V1\GetFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFederation(\Google\Cloud\Metastore\V1\GetFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastoreFederation/GetFederation', - $argument, - ['\Google\Cloud\Metastore\V1\Federation', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore federation in a project and location. - * @param \Google\Cloud\Metastore\V1\CreateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateFederation(\Google\Cloud\Metastore\V1\CreateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the fields of a federation. - * @param \Google\Cloud\Metastore\V1\UpdateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateFederation(\Google\Cloud\Metastore\V1\UpdateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastoreFederation/UpdateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single federation. - * @param \Google\Cloud\Metastore\V1\DeleteFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteFederation(\Google\Cloud\Metastore\V1\DeleteFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastoreFederation/DeleteFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1/DataprocMetastoreGrpcClient.php b/DataprocMetastore/src/V1/DataprocMetastoreGrpcClient.php deleted file mode 100644 index acae6de26be..00000000000 --- a/DataprocMetastore/src/V1/DataprocMetastoreGrpcClient.php +++ /dev/null @@ -1,277 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/ListServices', - $argument, - ['\Google\Cloud\Metastore\V1\ListServicesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single service. - * @param \Google\Cloud\Metastore\V1\GetServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetService(\Google\Cloud\Metastore\V1\GetServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/GetService', - $argument, - ['\Google\Cloud\Metastore\V1\Service', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore service in a project and location. - * @param \Google\Cloud\Metastore\V1\CreateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateService(\Google\Cloud\Metastore\V1\CreateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/CreateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single service. - * @param \Google\Cloud\Metastore\V1\UpdateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateService(\Google\Cloud\Metastore\V1\UpdateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/UpdateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single service. - * @param \Google\Cloud\Metastore\V1\DeleteServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteService(\Google\Cloud\Metastore\V1\DeleteServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/DeleteService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists imports in a service. - * @param \Google\Cloud\Metastore\V1\ListMetadataImportsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMetadataImports(\Google\Cloud\Metastore\V1\ListMetadataImportsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/ListMetadataImports', - $argument, - ['\Google\Cloud\Metastore\V1\ListMetadataImportsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single import. - * @param \Google\Cloud\Metastore\V1\GetMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMetadataImport(\Google\Cloud\Metastore\V1\GetMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/GetMetadataImport', - $argument, - ['\Google\Cloud\Metastore\V1\MetadataImport', 'decode'], - $metadata, $options); - } - - /** - * Creates a new MetadataImport in a given project and location. - * @param \Google\Cloud\Metastore\V1\CreateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateMetadataImport(\Google\Cloud\Metastore\V1\CreateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/CreateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * @param \Google\Cloud\Metastore\V1\UpdateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateMetadataImport(\Google\Cloud\Metastore\V1\UpdateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/UpdateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Exports metadata from a service. - * @param \Google\Cloud\Metastore\V1\ExportMetadataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ExportMetadata(\Google\Cloud\Metastore\V1\ExportMetadataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/ExportMetadata', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Restores a service from a backup. - * @param \Google\Cloud\Metastore\V1\RestoreServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestoreService(\Google\Cloud\Metastore\V1\RestoreServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/RestoreService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists backups in a service. - * @param \Google\Cloud\Metastore\V1\ListBackupsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListBackups(\Google\Cloud\Metastore\V1\ListBackupsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/ListBackups', - $argument, - ['\Google\Cloud\Metastore\V1\ListBackupsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single backup. - * @param \Google\Cloud\Metastore\V1\GetBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetBackup(\Google\Cloud\Metastore\V1\GetBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/GetBackup', - $argument, - ['\Google\Cloud\Metastore\V1\Backup', 'decode'], - $metadata, $options); - } - - /** - * Creates a new backup in a given project and location. - * @param \Google\Cloud\Metastore\V1\CreateBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateBackup(\Google\Cloud\Metastore\V1\CreateBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/CreateBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single backup. - * @param \Google\Cloud\Metastore\V1\DeleteBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteBackup(\Google\Cloud\Metastore\V1\DeleteBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1.DataprocMetastore/DeleteBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1/DeleteBackupRequest.php b/DataprocMetastore/src/V1/DeleteBackupRequest.php index 003d2ad6414..5b641755320 100644 --- a/DataprocMetastore/src/V1/DeleteBackupRequest.php +++ b/DataprocMetastore/src/V1/DeleteBackupRequest.php @@ -23,7 +23,7 @@ class DeleteBackupRequest 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. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -38,7 +38,7 @@ class DeleteBackupRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The relative resource name of the backup to delete, in the diff --git a/DataprocMetastore/src/V1/DeleteFederationRequest.php b/DataprocMetastore/src/V1/DeleteFederationRequest.php index 86c453e4495..5492072ac7b 100644 --- a/DataprocMetastore/src/V1/DeleteFederationRequest.php +++ b/DataprocMetastore/src/V1/DeleteFederationRequest.php @@ -22,7 +22,7 @@ class DeleteFederationRequest 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. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -37,7 +37,7 @@ class DeleteFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The relative resource name of the metastore federation to delete, diff --git a/DataprocMetastore/src/V1/DeleteServiceRequest.php b/DataprocMetastore/src/V1/DeleteServiceRequest.php index 0c0af0792ba..971257d0b8f 100644 --- a/DataprocMetastore/src/V1/DeleteServiceRequest.php +++ b/DataprocMetastore/src/V1/DeleteServiceRequest.php @@ -23,7 +23,7 @@ class DeleteServiceRequest 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. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -38,7 +38,7 @@ class DeleteServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $name Required. The relative resource name of the metastore service to delete, in diff --git a/DataprocMetastore/src/V1/EncryptionConfig.php b/DataprocMetastore/src/V1/EncryptionConfig.php index 41fd063d746..d88c0dcc6ac 100644 --- a/DataprocMetastore/src/V1/EncryptionConfig.php +++ b/DataprocMetastore/src/V1/EncryptionConfig.php @@ -22,7 +22,7 @@ class EncryptionConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kms_key = 1; */ - private $kms_key = ''; + protected $kms_key = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/ExportMetadataRequest.php b/DataprocMetastore/src/V1/ExportMetadataRequest.php index 6fe65734dbe..68b1e61c213 100644 --- a/DataprocMetastore/src/V1/ExportMetadataRequest.php +++ b/DataprocMetastore/src/V1/ExportMetadataRequest.php @@ -23,7 +23,7 @@ class ExportMetadataRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -38,14 +38,14 @@ class ExportMetadataRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * Optional. The type of the database dump. If unspecified, defaults to * `MYSQL`. * * Generated from protobuf field .google.cloud.metastore.v1.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $database_dump_type = 0; + protected $database_dump_type = 0; protected $destination; /** diff --git a/DataprocMetastore/src/V1/Federation.php b/DataprocMetastore/src/V1/Federation.php index 1c71ce9344e..d4f3fbfa895 100644 --- a/DataprocMetastore/src/V1/Federation.php +++ b/DataprocMetastore/src/V1/Federation.php @@ -22,19 +22,19 @@ class Federation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Output only. The time when the metastore federation was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the metastore federation was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * User-defined labels for the metastore federation. * @@ -47,7 +47,7 @@ class Federation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $version = ''; + protected $version = ''; /** * A map from `BackendMetastore` rank to `BackendMetastore`s from which the * federation service serves metadata at query time. The map key represents @@ -64,27 +64,27 @@ class Federation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $endpoint_uri = ''; + protected $endpoint_uri = ''; /** * Output only. The current state of the federation. * * Generated from protobuf field .google.cloud.metastore.v1.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Additional information about the current state of the * metastore federation, if available. * * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_message = ''; + protected $state_message = ''; /** * Output only. The globally unique resource identifier of the metastore * federation. * * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/Federation/State.php b/DataprocMetastore/src/V1/Federation/State.php index b1fe841ab58..5da5230e50f 100644 --- a/DataprocMetastore/src/V1/Federation/State.php +++ b/DataprocMetastore/src/V1/Federation/State.php @@ -82,6 +82,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\Federation_State::class); diff --git a/DataprocMetastore/src/V1/Federation_State.php b/DataprocMetastore/src/V1/Federation_State.php deleted file mode 100644 index 7bfea1ad897..00000000000 --- a/DataprocMetastore/src/V1/Federation_State.php +++ /dev/null @@ -1,16 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Metastore\V1\Client\DataprocMetastoreFederationClient}. - */ -class DataprocMetastoreFederationGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1.DataprocMetastoreFederation'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.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 $federationNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_federation_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_rest_client_config.php', - ], - ], - ]; - } - - private static function getFederationNameTemplate() - { - if (self::$federationNameTemplate == null) { - self::$federationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/federations/{federation}'); - } - - return self::$federationNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'federation' => self::getFederationNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a federation - * resource. - * - * @param string $project - * @param string $location - * @param string $federation - * - * @return string The formatted federation resource. - */ - public static function federationName($project, $location, $federation) - { - return self::getFederationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'federation' => $federation, - ]); - } - - /** - * 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. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - federation: projects/{project}/locations/{location}/federations/{federation} - * - location: projects/{project}/locations/{location} - * - * 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. - */ - 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'metastore.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 - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a metastore federation in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $federationId Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Federation $federation Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createFederation($parent, $federationId, $federation, array $optionalArgs = []) - { - $request = new CreateFederationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFederationId($federationId); - $request->setFederation($federation); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'deleteFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to delete, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteFederation($name, array $optionalArgs = []) - { - $request = new DeleteFederationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets the details of a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $response = $dataprocMetastoreFederationClient->getFederation($formattedName); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @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\Metastore\V1\Federation - * - * @throws ApiException if the remote call fails - */ - public function getFederation($name, array $optionalArgs = []) - { - $request = new GetFederationRequest(); - $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('GetFederation', Federation::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists federations in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 - */ - public function listFederations($parent, array $optionalArgs = []) - { - $request = new ListFederationsRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListFederations', $optionalArgs, ListFederationsResponse::class, $request); - } - - /** - * Updates the fields of a federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $updateMask = new FieldMask(); - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'updateFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Federation $federation Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateFederation($updateMask, $federation, array $optionalArgs = []) - { - $request = new UpdateFederationRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setFederation($federation); - $requestParamHeaders['federation.name'] = $federation->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $response = $dataprocMetastoreFederationClient->getLocation(); - * } finally { - * $dataprocMetastoreFederationClient->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 - */ - 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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->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 - */ - 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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreFederationClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreFederationClient->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 - */ - 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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreFederationClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreFederationClient->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 - */ - 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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreFederationClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreFederationClient->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 - */ - 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/DataprocMetastore/src/V1/Gapic/DataprocMetastoreGapicClient.php b/DataprocMetastore/src/V1/Gapic/DataprocMetastoreGapicClient.php deleted file mode 100644 index c4af9dedf73..00000000000 --- a/DataprocMetastore/src/V1/Gapic/DataprocMetastoreGapicClient.php +++ /dev/null @@ -1,2249 +0,0 @@ -serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Metastore\V1\Client\DataprocMetastoreClient}. - */ -class DataprocMetastoreGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1.DataprocMetastore'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.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 $backupNameTemplate; - - private static $locationNameTemplate; - - private static $metadataImportNameTemplate; - - private static $networkNameTemplate; - - private static $serviceNameTemplate; - - private static $subnetworkNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_rest_client_config.php', - ], - ], - ]; - } - - private static function getBackupNameTemplate() - { - if (self::$backupNameTemplate == null) { - self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/backups/{backup}'); - } - - return self::$backupNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getMetadataImportNameTemplate() - { - if (self::$metadataImportNameTemplate == null) { - self::$metadataImportNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import}'); - } - - return self::$metadataImportNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getSubnetworkNameTemplate() - { - if (self::$subnetworkNameTemplate == null) { - self::$subnetworkNameTemplate = new PathTemplate('projects/{project}/regions/{region}/subnetworks/{subnetwork}'); - } - - return self::$subnetworkNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'backup' => self::getBackupNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'metadataImport' => self::getMetadataImportNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'service' => self::getServiceNameTemplate(), - 'subnetwork' => self::getSubnetworkNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $backup - * - * @return string The formatted backup resource. - */ - public static function backupName($project, $location, $service, $backup) - { - return self::getBackupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'backup' => $backup, - ]); - } - - /** - * 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. - */ - 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 - * metadata_import resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $metadataImport - * - * @return string The formatted metadata_import resource. - */ - public static function metadataImportName($project, $location, $service, $metadataImport) - { - return self::getMetadataImportNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'metadata_import' => $metadataImport, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName($project, $location, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a subnetwork - * resource. - * - * @param string $project - * @param string $region - * @param string $subnetwork - * - * @return string The formatted subnetwork resource. - */ - public static function subnetworkName($project, $region, $subnetwork) - { - return self::getSubnetworkNameTemplate()->render([ - 'project' => $project, - 'region' => $region, - 'subnetwork' => $subnetwork, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - backup: projects/{project}/locations/{location}/services/{service}/backups/{backup} - * - location: projects/{project}/locations/{location} - * - metadataImport: projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import} - * - network: projects/{project}/global/networks/{network} - * - service: projects/{project}/locations/{location}/services/{service} - * - subnetwork: projects/{project}/regions/{region}/subnetworks/{subnetwork} - * - * 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. - */ - 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'metastore.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 - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Alter metadata resource location. The metadata resource can be a database, - * table, or partition. This functionality only updates the parent directory - * for the respective metadata resource and does not transfer any existing - * data to the new location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $resourceName Required. The relative metadata resource name in the following format. - * - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * @param string $locationUri Required. The new location URI for the metadata resource. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function alterMetadataResourceLocation($service, $resourceName, $locationUri, array $optionalArgs = []) - { - $request = new AlterMetadataResourceLocationRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setResourceName($resourceName); - $request->setLocationUri($locationUri); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('AlterMetadataResourceLocation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new backup in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $backupId = 'backup_id'; - * $backup = new Backup(); - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * backup of the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $backupId Required. The ID of the backup, which is used as the final component of the - * backup's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param Backup $backup Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) - { - $request = new CreateBackupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupId($backupId); - $request->setBackup($backup); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new MetadataImport in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $metadataImportId = 'metadata_import_id'; - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $metadataImportId Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param MetadataImport $metadataImport Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createMetadataImport($parent, $metadataImportId, $metadataImport, array $optionalArgs = []) - { - $request = new CreateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMetadataImportId($metadataImportId); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a metastore service in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * $serviceId = 'service_id'; - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $serviceId Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Service $service Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createService($parent, $serviceId, $service, array $optionalArgs = []) - { - $request = new CreateServiceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setServiceId($serviceId); - $request->setService($service); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to delete, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteBackup($name, array $optionalArgs = []) - { - $request = new DeleteBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to delete, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteService($name, array $optionalArgs = []) - { - $request = new DeleteServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Exports metadata from a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'exportMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * export, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $destinationGcsFolder - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type int $databaseDumpType - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1\DatabaseDumpSpec\Type} - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function exportMetadata($service, array $optionalArgs = []) - { - $request = new ExportMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['destinationGcsFolder'])) { - $request->setDestinationGcsFolder($optionalArgs['destinationGcsFolder']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['databaseDumpType'])) { - $request->setDatabaseDumpType($optionalArgs['databaseDumpType']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ExportMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets details of a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $response = $dataprocMetastoreClient->getBackup($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to retrieve, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @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\Metastore\V1\Backup - * - * @throws ApiException if the remote call fails - */ - public function getBackup($name, array $optionalArgs = []) - { - $request = new GetBackupRequest(); - $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('GetBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single import. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - * $response = $dataprocMetastoreClient->getMetadataImport($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * @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\Metastore\V1\MetadataImport - * - * @throws ApiException if the remote call fails - */ - public function getMetadataImport($name, array $optionalArgs = []) - { - $request = new GetMetadataImportRequest(); - $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('GetMetadataImport', MetadataImport::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the details of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $response = $dataprocMetastoreClient->getService($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @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\Metastore\V1\Service - * - * @throws ApiException if the remote call fails - */ - public function getService($name, array $optionalArgs = []) - { - $request = new GetServiceRequest(); - $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('GetService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists backups in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose backups to - * list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 - */ - public function listBackups($parent, array $optionalArgs = []) - { - $request = new ListBackupsRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); - } - - /** - * Lists imports in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 - */ - public function listMetadataImports($parent, array $optionalArgs = []) - { - $request = new ListMetadataImportsRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListMetadataImports', $optionalArgs, ListMetadataImportsResponse::class, $request); - } - - /** - * Lists services in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore services - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 - */ - public function listServices($parent, array $optionalArgs = []) - { - $request = new ListServicesRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); - } - - /** - * Move a table to another database. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $tableName = 'table_name'; - * $dbName = 'db_name'; - * $destinationDbName = 'destination_db_name'; - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'moveTableToDatabase'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $tableName Required. The name of the table to be moved. - * @param string $dbName Required. The name of the database where the table resides. - * @param string $destinationDbName Required. The name of the database where the table should be moved. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function moveTableToDatabase($service, $tableName, $dbName, $destinationDbName, array $optionalArgs = []) - { - $request = new MoveTableToDatabaseRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setTableName($tableName); - $request->setDbName($dbName); - $request->setDestinationDbName($destinationDbName); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('MoveTableToDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Query DPMS metadata. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $query = 'query'; - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'queryMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $query Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function queryMetadata($service, $query, array $optionalArgs = []) - { - $request = new QueryMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setQuery($query); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('QueryMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Restores a service from a backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $formattedBackup = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'restoreService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * restore, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $backup Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $restoreType - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1\Restore\RestoreType} - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function restoreService($service, $backup, array $optionalArgs = []) - { - $request = new RestoreServiceRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setBackup($backup); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['restoreType'])) { - $request->setRestoreType($optionalArgs['restoreType']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param MetadataImport $metadataImport Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateMetadataImport($updateMask, $metadataImport, array $optionalArgs = []) - { - $request = new UpdateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['metadata_import.name'] = $metadataImport->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Service $service Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateService($updateMask, $service, array $optionalArgs = []) - { - $request = new UpdateServiceRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setService($service); - $requestParamHeaders['service.name'] = $service->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $response = $dataprocMetastoreClient->getLocation(); - * } finally { - * $dataprocMetastoreClient->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 - */ - 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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->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 - */ - 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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreClient->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 - */ - 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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreClient->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 - */ - 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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreClient->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 - */ - 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/DataprocMetastore/src/V1/GetBackupRequest.php b/DataprocMetastore/src/V1/GetBackupRequest.php index e87bf62fd7d..01791735196 100644 --- a/DataprocMetastore/src/V1/GetBackupRequest.php +++ b/DataprocMetastore/src/V1/GetBackupRequest.php @@ -23,7 +23,7 @@ class GetBackupRequest 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 relative resource name of the backup to retrieve, in the diff --git a/DataprocMetastore/src/V1/GetFederationRequest.php b/DataprocMetastore/src/V1/GetFederationRequest.php index 1dea2ac3c85..d0676d640ec 100644 --- a/DataprocMetastore/src/V1/GetFederationRequest.php +++ b/DataprocMetastore/src/V1/GetFederationRequest.php @@ -22,7 +22,7 @@ class GetFederationRequest 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 relative resource name of the metastore federation to diff --git a/DataprocMetastore/src/V1/GetMetadataImportRequest.php b/DataprocMetastore/src/V1/GetMetadataImportRequest.php index 846571ef905..461911cb0d1 100644 --- a/DataprocMetastore/src/V1/GetMetadataImportRequest.php +++ b/DataprocMetastore/src/V1/GetMetadataImportRequest.php @@ -23,7 +23,7 @@ class GetMetadataImportRequest 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 relative resource name of the metadata import to retrieve, in diff --git a/DataprocMetastore/src/V1/GetServiceRequest.php b/DataprocMetastore/src/V1/GetServiceRequest.php index a9c90044733..23a082ef569 100644 --- a/DataprocMetastore/src/V1/GetServiceRequest.php +++ b/DataprocMetastore/src/V1/GetServiceRequest.php @@ -23,7 +23,7 @@ class GetServiceRequest 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 relative resource name of the metastore service to retrieve, diff --git a/DataprocMetastore/src/V1/HiveMetastoreConfig.php b/DataprocMetastore/src/V1/HiveMetastoreConfig.php index 78fa6777887..9325b320e61 100644 --- a/DataprocMetastore/src/V1/HiveMetastoreConfig.php +++ b/DataprocMetastore/src/V1/HiveMetastoreConfig.php @@ -21,7 +21,7 @@ class HiveMetastoreConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $version = ''; + protected $version = ''; /** * A mapping of Hive metastore configuration key-value pairs to apply to the * Hive metastore (configured in `hive-site.xml`). The mappings @@ -41,14 +41,14 @@ class HiveMetastoreConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.KerberosConfig kerberos_config = 3; */ - private $kerberos_config = null; + protected $kerberos_config = null; /** * The protocol to use for the metastore service endpoint. If unspecified, * defaults to `THRIFT`. * * Generated from protobuf field .google.cloud.metastore.v1.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; */ - private $endpoint_protocol = 0; + protected $endpoint_protocol = 0; /** * A mapping of Hive metastore version to the auxiliary version * configuration. When specified, a secondary Hive metastore service is diff --git a/DataprocMetastore/src/V1/HiveMetastoreConfig/EndpointProtocol.php b/DataprocMetastore/src/V1/HiveMetastoreConfig/EndpointProtocol.php index 7546b641a64..e7bc7e788fb 100644 --- a/DataprocMetastore/src/V1/HiveMetastoreConfig/EndpointProtocol.php +++ b/DataprocMetastore/src/V1/HiveMetastoreConfig/EndpointProtocol.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EndpointProtocol::class, \Google\Cloud\Metastore\V1\HiveMetastoreConfig_EndpointProtocol::class); diff --git a/DataprocMetastore/src/V1/KerberosConfig.php b/DataprocMetastore/src/V1/KerberosConfig.php index 14d8d3a6385..df4b6eb6fc3 100644 --- a/DataprocMetastore/src/V1/KerberosConfig.php +++ b/DataprocMetastore/src/V1/KerberosConfig.php @@ -21,7 +21,7 @@ class KerberosConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.Secret keytab = 1; */ - private $keytab = null; + protected $keytab = null; /** * A Kerberos principal that exists in the both the keytab the KDC * to authenticate as. A typical principal is of the form @@ -29,7 +29,7 @@ class KerberosConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string principal = 2; */ - private $principal = ''; + protected $principal = ''; /** * A Cloud Storage URI that specifies the path to a * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, @@ -37,7 +37,7 @@ class KerberosConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string krb5_config_gcs_uri = 3; */ - private $krb5_config_gcs_uri = ''; + protected $krb5_config_gcs_uri = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/ListBackupsRequest.php b/DataprocMetastore/src/V1/ListBackupsRequest.php index b372b70a917..b73891dd55c 100644 --- a/DataprocMetastore/src/V1/ListBackupsRequest.php +++ b/DataprocMetastore/src/V1/ListBackupsRequest.php @@ -23,7 +23,7 @@ class ListBackupsRequest 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. The maximum number of backups to return. The response may contain * less than the maximum number. If unspecified, no more than 500 backups are @@ -31,7 +31,7 @@ class ListBackupsRequest 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. A page token, received from a previous * [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups] @@ -43,13 +43,13 @@ class ListBackupsRequest 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. The filter to apply to list results. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Specify the ordering of results as described in [Sorting * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). @@ -57,7 +57,7 @@ class ListBackupsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The relative resource name of the service whose backups to diff --git a/DataprocMetastore/src/V1/ListBackupsResponse.php b/DataprocMetastore/src/V1/ListBackupsResponse.php index 4f16d1261b1..d4c62d5e2a3 100644 --- a/DataprocMetastore/src/V1/ListBackupsResponse.php +++ b/DataprocMetastore/src/V1/ListBackupsResponse.php @@ -28,7 +28,7 @@ class ListBackupsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/DataprocMetastore/src/V1/ListFederationsRequest.php b/DataprocMetastore/src/V1/ListFederationsRequest.php index 8bcb97d635e..0113d75b199 100644 --- a/DataprocMetastore/src/V1/ListFederationsRequest.php +++ b/DataprocMetastore/src/V1/ListFederationsRequest.php @@ -22,7 +22,7 @@ class ListFederationsRequest 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. The maximum number of federations to return. The response may * contain less than the maximum number. If unspecified, no more than 500 @@ -31,7 +31,7 @@ class ListFederationsRequest 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. A page token, received from a previous ListFederationServices * call. Provide this token to retrieve the subsequent page. @@ -42,13 +42,13 @@ class ListFederationsRequest 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. The filter to apply to list results. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Specify the ordering of results as described in [Sorting * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). @@ -56,7 +56,7 @@ class ListFederationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The relative resource name of the location of metastore diff --git a/DataprocMetastore/src/V1/ListFederationsResponse.php b/DataprocMetastore/src/V1/ListFederationsResponse.php index e93b6d6a82d..6b9e36e583c 100644 --- a/DataprocMetastore/src/V1/ListFederationsResponse.php +++ b/DataprocMetastore/src/V1/ListFederationsResponse.php @@ -27,7 +27,7 @@ class ListFederationsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/DataprocMetastore/src/V1/ListMetadataImportsRequest.php b/DataprocMetastore/src/V1/ListMetadataImportsRequest.php index 894d0ba2c55..582bf247953 100644 --- a/DataprocMetastore/src/V1/ListMetadataImportsRequest.php +++ b/DataprocMetastore/src/V1/ListMetadataImportsRequest.php @@ -23,7 +23,7 @@ class ListMetadataImportsRequest 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. The maximum number of imports to return. The response may contain * less than the maximum number. If unspecified, no more than 500 imports are @@ -31,7 +31,7 @@ class ListMetadataImportsRequest 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. A page token, received from a previous * [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices] @@ -43,13 +43,13 @@ class ListMetadataImportsRequest 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. The filter to apply to list results. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Specify the ordering of results as described in [Sorting * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). @@ -57,7 +57,7 @@ class ListMetadataImportsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The relative resource name of the service whose metadata imports diff --git a/DataprocMetastore/src/V1/ListMetadataImportsResponse.php b/DataprocMetastore/src/V1/ListMetadataImportsResponse.php index a3dbd6b563b..361360dd731 100644 --- a/DataprocMetastore/src/V1/ListMetadataImportsResponse.php +++ b/DataprocMetastore/src/V1/ListMetadataImportsResponse.php @@ -28,7 +28,7 @@ class ListMetadataImportsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/DataprocMetastore/src/V1/ListServicesRequest.php b/DataprocMetastore/src/V1/ListServicesRequest.php index 163ff6277be..3821776ec78 100644 --- a/DataprocMetastore/src/V1/ListServicesRequest.php +++ b/DataprocMetastore/src/V1/ListServicesRequest.php @@ -23,7 +23,7 @@ class ListServicesRequest 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. The maximum number of services to return. The response may * contain less than the maximum number. If unspecified, no more than 500 @@ -32,7 +32,7 @@ class ListServicesRequest 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. A page token, received from a previous * [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices] @@ -44,13 +44,13 @@ class ListServicesRequest 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. The filter to apply to list results. * * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * Optional. Specify the ordering of results as described in [Sorting * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). @@ -58,7 +58,7 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The relative resource name of the location of metastore services diff --git a/DataprocMetastore/src/V1/ListServicesResponse.php b/DataprocMetastore/src/V1/ListServicesResponse.php index 5555877b7cb..40a31f47a15 100644 --- a/DataprocMetastore/src/V1/ListServicesResponse.php +++ b/DataprocMetastore/src/V1/ListServicesResponse.php @@ -28,7 +28,7 @@ class ListServicesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Locations that could not be reached. * diff --git a/DataprocMetastore/src/V1/LocationMetadata/HiveMetastoreVersion.php b/DataprocMetastore/src/V1/LocationMetadata/HiveMetastoreVersion.php index 0b2dd521741..8e4fd426d2b 100644 --- a/DataprocMetastore/src/V1/LocationMetadata/HiveMetastoreVersion.php +++ b/DataprocMetastore/src/V1/LocationMetadata/HiveMetastoreVersion.php @@ -20,14 +20,14 @@ class HiveMetastoreVersion extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 1; */ - private $version = ''; + protected $version = ''; /** * Whether `version` will be chosen by the server if a metastore service is * created with a `HiveMetastoreConfig` that omits the `version`. * * Generated from protobuf field bool is_default = 2; */ - private $is_default = false; + protected $is_default = false; /** * Constructor. @@ -103,6 +103,4 @@ public function setIsDefault($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HiveMetastoreVersion::class, \Google\Cloud\Metastore\V1\LocationMetadata_HiveMetastoreVersion::class); diff --git a/DataprocMetastore/src/V1/LocationMetadata_HiveMetastoreVersion.php b/DataprocMetastore/src/V1/LocationMetadata_HiveMetastoreVersion.php deleted file mode 100644 index 994176f24a3..00000000000 --- a/DataprocMetastore/src/V1/LocationMetadata_HiveMetastoreVersion.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.protobuf.Int32Value hour_of_day = 1; */ - private $hour_of_day = null; + protected $hour_of_day = null; /** * The day of week, when the window starts. * * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; */ - private $day_of_week = 0; + protected $day_of_week = 0; /** * Constructor. @@ -75,7 +75,7 @@ public function clearHourOfDay() * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; * @return int|null */ - public function getHourOfDayValue() + public function getHourOfDayUnwrapped() { return $this->readWrapperValue("hour_of_day"); } @@ -104,7 +104,7 @@ public function setHourOfDay($var) * @param int|null $var * @return $this */ - public function setHourOfDayValue($var) + public function setHourOfDayUnwrapped($var) { $this->writeWrapperValue("hour_of_day", $var); return $this;} diff --git a/DataprocMetastore/src/V1/MetadataExport.php b/DataprocMetastore/src/V1/MetadataExport.php index db491f3ba2c..b8d76e8d94d 100644 --- a/DataprocMetastore/src/V1/MetadataExport.php +++ b/DataprocMetastore/src/V1/MetadataExport.php @@ -20,25 +20,25 @@ class MetadataExport extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. The time when the export ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The current state of the export. * * Generated from protobuf field .google.cloud.metastore.v1.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The type of the database dump. * * Generated from protobuf field .google.cloud.metastore.v1.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $database_dump_type = 0; + protected $database_dump_type = 0; protected $destination; /** diff --git a/DataprocMetastore/src/V1/MetadataExport/State.php b/DataprocMetastore/src/V1/MetadataExport/State.php index 9edc49059ec..c11f67106ef 100644 --- a/DataprocMetastore/src/V1/MetadataExport/State.php +++ b/DataprocMetastore/src/V1/MetadataExport/State.php @@ -73,6 +73,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\MetadataExport_State::class); diff --git a/DataprocMetastore/src/V1/MetadataExport_State.php b/DataprocMetastore/src/V1/MetadataExport_State.php deleted file mode 100644 index 63f4f02e36c..00000000000 --- a/DataprocMetastore/src/V1/MetadataExport_State.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * The description of the metadata import. * * Generated from protobuf field string description = 2; */ - private $description = ''; + protected $description = ''; /** * Output only. The time when the metadata import was started. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the metadata import was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. The time when the metadata import finished. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The current state of the metadata import. * * Generated from protobuf field .google.cloud.metastore.v1.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; protected $metadata; /** diff --git a/DataprocMetastore/src/V1/MetadataImport/DatabaseDump.php b/DataprocMetastore/src/V1/MetadataImport/DatabaseDump.php index af4f7b1256c..d7ffcbed89b 100644 --- a/DataprocMetastore/src/V1/MetadataImport/DatabaseDump.php +++ b/DataprocMetastore/src/V1/MetadataImport/DatabaseDump.php @@ -29,7 +29,7 @@ class DatabaseDump extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string gcs_uri = 2; */ - private $gcs_uri = ''; + protected $gcs_uri = ''; /** * The name of the source database. * @@ -43,7 +43,7 @@ class DatabaseDump extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $type = 0; + protected $type = 0; /** * Constructor. @@ -186,6 +186,4 @@ public function setType($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseDump::class, \Google\Cloud\Metastore\V1\MetadataImport_DatabaseDump::class); diff --git a/DataprocMetastore/src/V1/MetadataImport/DatabaseDump/DatabaseType.php b/DataprocMetastore/src/V1/MetadataImport/DatabaseDump/DatabaseType.php index c5d6380893d..71bbe9170c2 100644 --- a/DataprocMetastore/src/V1/MetadataImport/DatabaseDump/DatabaseType.php +++ b/DataprocMetastore/src/V1/MetadataImport/DatabaseDump/DatabaseType.php @@ -52,6 +52,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1\MetadataImport_DatabaseDump_DatabaseType::class); diff --git a/DataprocMetastore/src/V1/MetadataImport/State.php b/DataprocMetastore/src/V1/MetadataImport/State.php index 627621ca37c..92f4ca27323 100644 --- a/DataprocMetastore/src/V1/MetadataImport/State.php +++ b/DataprocMetastore/src/V1/MetadataImport/State.php @@ -74,6 +74,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\MetadataImport_State::class); diff --git a/DataprocMetastore/src/V1/MetadataImport_DatabaseDump.php b/DataprocMetastore/src/V1/MetadataImport_DatabaseDump.php deleted file mode 100644 index 1bb1a36d043..00000000000 --- a/DataprocMetastore/src/V1/MetadataImport_DatabaseDump.php +++ /dev/null @@ -1,16 +0,0 @@ -string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Required. The name of the table to be moved. * * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $table_name = ''; + protected $table_name = ''; /** * Required. The name of the database where the table resides. * * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $db_name = ''; + protected $db_name = ''; /** * Required. The name of the database where the table should be moved. * * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $destination_db_name = ''; + protected $destination_db_name = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/NetworkConfig/Consumer.php b/DataprocMetastore/src/V1/NetworkConfig/Consumer.php index 16fdd15d68a..453cd57831f 100644 --- a/DataprocMetastore/src/V1/NetworkConfig/Consumer.php +++ b/DataprocMetastore/src/V1/NetworkConfig/Consumer.php @@ -22,14 +22,14 @@ class Consumer extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $endpoint_uri = ''; + protected $endpoint_uri = ''; /** * Output only. The location of the endpoint URI. Format: * `projects/{project}/locations/{location}`. * * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $endpoint_location = ''; + protected $endpoint_location = ''; protected $vpc_resource; /** @@ -168,6 +168,4 @@ public function getVpcResource() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Consumer::class, \Google\Cloud\Metastore\V1\NetworkConfig_Consumer::class); diff --git a/DataprocMetastore/src/V1/NetworkConfig_Consumer.php b/DataprocMetastore/src/V1/NetworkConfig_Consumer.php deleted file mode 100644 index 61b9d2e4b17..00000000000 --- a/DataprocMetastore/src/V1/NetworkConfig_Consumer.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target = ''; + protected $target = ''; /** * Output only. Name of the verb executed by the operation. * * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $verb = ''; + protected $verb = ''; /** * Output only. Human-readable status of the operation, if any. * * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $status_message = ''; + protected $status_message = ''; /** * Output only. Identifies whether the caller has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -54,13 +54,13 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * Output only. API version used to start the operation. * * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $api_version = ''; + protected $api_version = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/QueryMetadataRequest.php b/DataprocMetastore/src/V1/QueryMetadataRequest.php index 036b4b54742..337201d6f6d 100644 --- a/DataprocMetastore/src/V1/QueryMetadataRequest.php +++ b/DataprocMetastore/src/V1/QueryMetadataRequest.php @@ -23,14 +23,14 @@ class QueryMetadataRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Required. A read-only SQL query to execute against the metadata database. * The query cannot change or mutate the data. * * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $query = ''; + protected $query = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/QueryMetadataResponse.php b/DataprocMetastore/src/V1/QueryMetadataResponse.php index a8f1723f7d6..11e35e46da0 100644 --- a/DataprocMetastore/src/V1/QueryMetadataResponse.php +++ b/DataprocMetastore/src/V1/QueryMetadataResponse.php @@ -24,7 +24,7 @@ class QueryMetadataResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string result_manifest_uri = 1; */ - private $result_manifest_uri = ''; + protected $result_manifest_uri = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/Restore.php b/DataprocMetastore/src/V1/Restore.php index d2dde8afcb9..40f6b3f7dfa 100644 --- a/DataprocMetastore/src/V1/Restore.php +++ b/DataprocMetastore/src/V1/Restore.php @@ -20,19 +20,19 @@ class Restore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $start_time = null; + protected $start_time = null; /** * Output only. The time when the restore ended. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The current state of the restore. * * Generated from protobuf field .google.cloud.metastore.v1.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. The relative resource name of the metastore service backup to * restore from, in the following form: @@ -40,20 +40,20 @@ class Restore extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ - private $backup = ''; + protected $backup = ''; /** * Output only. The type of restore. * * Generated from protobuf field .google.cloud.metastore.v1.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $type = 0; + protected $type = 0; /** * Output only. The restore details containing the revision of the service to * be restored to, in format of JSON. * * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $details = ''; + protected $details = ''; /** * Constructor. diff --git a/DataprocMetastore/src/V1/Restore/RestoreType.php b/DataprocMetastore/src/V1/Restore/RestoreType.php index 1dbf9a631af..44eac3e4e89 100644 --- a/DataprocMetastore/src/V1/Restore/RestoreType.php +++ b/DataprocMetastore/src/V1/Restore/RestoreType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RestoreType::class, \Google\Cloud\Metastore\V1\Restore_RestoreType::class); diff --git a/DataprocMetastore/src/V1/Restore/State.php b/DataprocMetastore/src/V1/Restore/State.php index e0001654980..bf986d92962 100644 --- a/DataprocMetastore/src/V1/Restore/State.php +++ b/DataprocMetastore/src/V1/Restore/State.php @@ -73,6 +73,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\Restore_State::class); diff --git a/DataprocMetastore/src/V1/RestoreServiceRequest.php b/DataprocMetastore/src/V1/RestoreServiceRequest.php index e659f8a96f6..b55b901f0c8 100644 --- a/DataprocMetastore/src/V1/RestoreServiceRequest.php +++ b/DataprocMetastore/src/V1/RestoreServiceRequest.php @@ -22,7 +22,7 @@ class RestoreServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Required. The relative resource name of the metastore service backup to * restore from, in the following form: @@ -30,13 +30,13 @@ class RestoreServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $backup = ''; + protected $backup = ''; /** * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. * * Generated from protobuf field .google.cloud.metastore.v1.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $restore_type = 0; + protected $restore_type = 0; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -51,7 +51,7 @@ class RestoreServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param string $service Required. The relative resource name of the metastore service to run diff --git a/DataprocMetastore/src/V1/Restore_RestoreType.php b/DataprocMetastore/src/V1/Restore_RestoreType.php deleted file mode 100644 index 27fe199ac67..00000000000 --- a/DataprocMetastore/src/V1/Restore_RestoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Output only. The time when the metastore service was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the metastore service was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * User-defined labels for the metastore service. * @@ -48,45 +48,45 @@ class Service extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { */ - private $network = ''; + protected $network = ''; /** * Output only. The URI of the endpoint used to access the metastore service. * * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $endpoint_uri = ''; + protected $endpoint_uri = ''; /** * The TCP port at which the metastore service is reached. Default: 9083. * * Generated from protobuf field int32 port = 9; */ - private $port = 0; + protected $port = 0; /** * Output only. The current state of the metastore service. * * Generated from protobuf field .google.cloud.metastore.v1.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Additional information about the current state of the * metastore service, if available. * * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state_message = ''; + protected $state_message = ''; /** * Output only. A Cloud Storage URI (starting with `gs://`) that specifies * where artifacts related to the metastore service are stored. * * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $artifact_gcs_uri = ''; + protected $artifact_gcs_uri = ''; /** * The tier of the service. * * Generated from protobuf field .google.cloud.metastore.v1.Service.Tier tier = 13; */ - private $tier = 0; + protected $tier = 0; /** * The one hour maintenance window of the metastore service. This specifies * when the service can be restarted for maintenance purposes in UTC time. @@ -95,60 +95,60 @@ class Service extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.MaintenanceWindow maintenance_window = 15; */ - private $maintenance_window = null; + protected $maintenance_window = null; /** * Output only. The globally unique resource identifier of the metastore * service. * * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $uid = ''; + protected $uid = ''; /** * Output only. The metadata management activities of the metastore service. * * Generated from protobuf field .google.cloud.metastore.v1.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metadata_management_activity = null; + protected $metadata_management_activity = null; /** * Immutable. The release channel of the service. * If unspecified, defaults to `STABLE`. * * Generated from protobuf field .google.cloud.metastore.v1.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $release_channel = 0; + protected $release_channel = 0; /** * Immutable. Information used to configure the Dataproc Metastore service to * encrypt customer data at rest. Cannot be updated. * * Generated from protobuf field .google.cloud.metastore.v1.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $encryption_config = null; + protected $encryption_config = null; /** * The configuration specifying the network settings for the * Dataproc Metastore service. * * Generated from protobuf field .google.cloud.metastore.v1.NetworkConfig network_config = 21; */ - private $network_config = null; + protected $network_config = null; /** * Immutable. The database type that the Metastore service stores its data. * * Generated from protobuf field .google.cloud.metastore.v1.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $database_type = 0; + protected $database_type = 0; /** * The configuration specifying telemetry settings for the Dataproc Metastore * service. If unspecified defaults to `JSON`. * * Generated from protobuf field .google.cloud.metastore.v1.TelemetryConfig telemetry_config = 23; */ - private $telemetry_config = null; + protected $telemetry_config = null; /** * Scaling configuration of the metastore service. * * Generated from protobuf field .google.cloud.metastore.v1.ScalingConfig scaling_config = 24; */ - private $scaling_config = null; + protected $scaling_config = null; protected $metastore_config; /** diff --git a/DataprocMetastore/src/V1/Service/DatabaseType.php b/DataprocMetastore/src/V1/Service/DatabaseType.php index 825ddf6b0f4..6787a36a639 100644 --- a/DataprocMetastore/src/V1/Service/DatabaseType.php +++ b/DataprocMetastore/src/V1/Service/DatabaseType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1\Service_DatabaseType::class); diff --git a/DataprocMetastore/src/V1/Service/ReleaseChannel.php b/DataprocMetastore/src/V1/Service/ReleaseChannel.php index 5f79d822e3b..0128ee6e06f 100644 --- a/DataprocMetastore/src/V1/Service/ReleaseChannel.php +++ b/DataprocMetastore/src/V1/Service/ReleaseChannel.php @@ -64,6 +64,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReleaseChannel::class, \Google\Cloud\Metastore\V1\Service_ReleaseChannel::class); diff --git a/DataprocMetastore/src/V1/Service/State.php b/DataprocMetastore/src/V1/Service/State.php index 335f72a766a..23b211c337f 100644 --- a/DataprocMetastore/src/V1/Service/State.php +++ b/DataprocMetastore/src/V1/Service/State.php @@ -97,6 +97,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1\Service_State::class); diff --git a/DataprocMetastore/src/V1/Service/Tier.php b/DataprocMetastore/src/V1/Service/Tier.php index 6603ae6a701..ec3684080fe 100644 --- a/DataprocMetastore/src/V1/Service/Tier.php +++ b/DataprocMetastore/src/V1/Service/Tier.php @@ -61,6 +61,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Tier::class, \Google\Cloud\Metastore\V1\Service_Tier::class); diff --git a/DataprocMetastore/src/V1/Service_DatabaseType.php b/DataprocMetastore/src/V1/Service_DatabaseType.php deleted file mode 100644 index 9c1862ff86e..00000000000 --- a/DataprocMetastore/src/V1/Service_DatabaseType.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.cloud.metastore.v1.TelemetryConfig.LogFormat log_format = 1; */ - private $log_format = 0; + protected $log_format = 0; /** * Constructor. diff --git a/DataprocMetastore/src/V1/TelemetryConfig/LogFormat.php b/DataprocMetastore/src/V1/TelemetryConfig/LogFormat.php index 071414412d7..c13084d10f0 100644 --- a/DataprocMetastore/src/V1/TelemetryConfig/LogFormat.php +++ b/DataprocMetastore/src/V1/TelemetryConfig/LogFormat.php @@ -57,6 +57,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LogFormat::class, \Google\Cloud\Metastore\V1\TelemetryConfig_LogFormat::class); diff --git a/DataprocMetastore/src/V1/TelemetryConfig_LogFormat.php b/DataprocMetastore/src/V1/TelemetryConfig_LogFormat.php deleted file mode 100644 index bdf4a24eb0f..00000000000 --- a/DataprocMetastore/src/V1/TelemetryConfig_LogFormat.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The metastore federation to update. The server only merges fields * in the service if they are specified in `update_mask`. @@ -32,7 +32,7 @@ class UpdateFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $federation = null; + protected $federation = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -47,7 +47,7 @@ class UpdateFederationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\Metastore\V1\Federation $federation Required. The metastore federation to update. The server only merges fields diff --git a/DataprocMetastore/src/V1/UpdateMetadataImportRequest.php b/DataprocMetastore/src/V1/UpdateMetadataImportRequest.php index 397fbcf178c..0779fd76ed4 100644 --- a/DataprocMetastore/src/V1/UpdateMetadataImportRequest.php +++ b/DataprocMetastore/src/V1/UpdateMetadataImportRequest.php @@ -24,7 +24,7 @@ class UpdateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The metadata import to update. The server only merges fields * in the import if they are specified in `update_mask`. @@ -33,7 +33,7 @@ class UpdateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $metadata_import = null; + protected $metadata_import = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -48,7 +48,7 @@ class UpdateMetadataImportRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\Metastore\V1\MetadataImport $metadataImport Required. The metadata import to update. The server only merges fields diff --git a/DataprocMetastore/src/V1/UpdateServiceRequest.php b/DataprocMetastore/src/V1/UpdateServiceRequest.php index d72f4db8e44..c5723944ac7 100644 --- a/DataprocMetastore/src/V1/UpdateServiceRequest.php +++ b/DataprocMetastore/src/V1/UpdateServiceRequest.php @@ -24,7 +24,7 @@ class UpdateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * Required. The metastore service to update. The server only merges fields * in the service if they are specified in `update_mask`. @@ -33,7 +33,7 @@ class UpdateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.metastore.v1.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $service = null; + protected $service = null; /** * Optional. A request ID. Specify a unique request ID to allow the server to * ignore the request if it has completed. The server will ignore subsequent @@ -48,7 +48,7 @@ class UpdateServiceRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $request_id = ''; + protected $request_id = ''; /** * @param \Google\Cloud\Metastore\V1\Service $service Required. The metastore service to update. The server only merges fields diff --git a/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationRequest.php b/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationRequest.php deleted file mode 100644 index 390e7546d29..00000000000 --- a/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationRequest.php +++ /dev/null @@ -1,164 +0,0 @@ -google.cloud.metastore.v1alpha.AlterMetadataResourceLocationRequest - */ -class AlterMetadataResourceLocationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $resource_name = ''; - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $location_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $resource_name - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * @type string $location_uri - * Required. The new location URI for the metadata resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getResourceName() - { - return $this->resource_name; - } - - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setResourceName($var) - { - GPBUtil::checkString($var, True); - $this->resource_name = $var; - - return $this; - } - - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLocationUri() - { - return $this->location_uri; - } - - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLocationUri($var) - { - GPBUtil::checkString($var, True); - $this->location_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationResponse.php b/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationResponse.php deleted file mode 100644 index 3ee73fba1b8..00000000000 --- a/DataprocMetastore/src/V1alpha/AlterMetadataResourceLocationResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.metastore.v1alpha.AlterMetadataResourceLocationResponse - */ -class AlterMetadataResourceLocationResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/AuxiliaryVersionConfig.php b/DataprocMetastore/src/V1alpha/AuxiliaryVersionConfig.php deleted file mode 100644 index aa05e45a591..00000000000 --- a/DataprocMetastore/src/V1alpha/AuxiliaryVersionConfig.php +++ /dev/null @@ -1,169 +0,0 @@ -google.cloud.metastore.v1alpha.AuxiliaryVersionConfig - */ -class AuxiliaryVersionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - */ - private $version = ''; - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - */ - private $config_overrides; - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $network_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * @type array|\Google\Protobuf\Internal\MapField $config_overrides - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * @type \Google\Cloud\Metastore\V1alpha\NetworkConfig $network_config - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getConfigOverrides() - { - return $this->config_overrides; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setConfigOverrides($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->config_overrides = $arr; - - return $this; - } - - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1alpha\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1alpha\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/BackendMetastore.php b/DataprocMetastore/src/V1alpha/BackendMetastore.php deleted file mode 100644 index d8054fdee8f..00000000000 --- a/DataprocMetastore/src/V1alpha/BackendMetastore.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.metastore.v1alpha.BackendMetastore - */ -class BackendMetastore extends \Google\Protobuf\Internal\Message -{ - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.BackendMetastore.MetastoreType metastore_type = 2; - */ - private $metastore_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * @type int $metastore_type - * The type of the backend metastore. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.BackendMetastore.MetastoreType metastore_type = 2; - * @return int - */ - public function getMetastoreType() - { - return $this->metastore_type; - } - - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.BackendMetastore.MetastoreType metastore_type = 2; - * @param int $var - * @return $this - */ - public function setMetastoreType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\BackendMetastore\MetastoreType::class); - $this->metastore_type = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/BackendMetastore/MetastoreType.php b/DataprocMetastore/src/V1alpha/BackendMetastore/MetastoreType.php deleted file mode 100644 index 1c3e2acf3e6..00000000000 --- a/DataprocMetastore/src/V1alpha/BackendMetastore/MetastoreType.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.metastore.v1alpha.BackendMetastore.MetastoreType - */ -class MetastoreType -{ - /** - * The metastore type is not set. - * - * Generated from protobuf enum METASTORE_TYPE_UNSPECIFIED = 0; - */ - const METASTORE_TYPE_UNSPECIFIED = 0; - /** - * The backend metastore is Dataplex. - * - * Generated from protobuf enum DATAPLEX = 1; - */ - const DATAPLEX = 1; - /** - * The backend metastore is BigQuery. - * - * Generated from protobuf enum BIGQUERY = 2; - */ - const BIGQUERY = 2; - /** - * The backend metastore is Dataproc Metastore. - * - * Generated from protobuf enum DATAPROC_METASTORE = 3; - */ - const DATAPROC_METASTORE = 3; - - private static $valueToName = [ - self::METASTORE_TYPE_UNSPECIFIED => 'METASTORE_TYPE_UNSPECIFIED', - self::DATAPLEX => 'DATAPLEX', - self::BIGQUERY => 'BIGQUERY', - self::DATAPROC_METASTORE => 'DATAPROC_METASTORE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MetastoreType::class, \Google\Cloud\Metastore\V1alpha\BackendMetastore_MetastoreType::class); - diff --git a/DataprocMetastore/src/V1alpha/BackendMetastore_MetastoreType.php b/DataprocMetastore/src/V1alpha/BackendMetastore_MetastoreType.php deleted file mode 100644 index 4b4a8d510fb..00000000000 --- a/DataprocMetastore/src/V1alpha/BackendMetastore_MetastoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.Backup - */ -class Backup extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $service_revision = null; - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - */ - private $description = ''; - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $restoring_services; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the backup was started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the backup finished creating. - * @type int $state - * Output only. The current state of the backup. - * @type \Google\Cloud\Metastore\V1alpha\Service $service_revision - * Output only. The revision of the service at the time of backup. - * @type string $description - * The description of the backup. - * @type array|\Google\Protobuf\Internal\RepeatedField $restoring_services - * Output only. Services that are restoring from the backup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Backup\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1alpha\Service|null - */ - public function getServiceRevision() - { - return $this->service_revision; - } - - public function hasServiceRevision() - { - return isset($this->service_revision); - } - - public function clearServiceRevision() - { - unset($this->service_revision); - } - - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1alpha\Service $var - * @return $this - */ - public function setServiceRevision($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Service::class); - $this->service_revision = $var; - - return $this; - } - - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRestoringServices() - { - return $this->restoring_services; - } - - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRestoringServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->restoring_services = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Backup/State.php b/DataprocMetastore/src/V1alpha/Backup/State.php deleted file mode 100644 index d5770f420c4..00000000000 --- a/DataprocMetastore/src/V1alpha/Backup/State.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.metastore.v1alpha.Backup.State - */ -class State -{ - /** - * The state of the backup is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The backup is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The backup is being deleted. - * - * Generated from protobuf enum DELETING = 2; - */ - const DELETING = 2; - /** - * The backup is active and ready to use. - * - * Generated from protobuf enum ACTIVE = 3; - */ - const ACTIVE = 3; - /** - * The backup failed. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - /** - * The backup is being restored. - * - * Generated from protobuf enum RESTORING = 5; - */ - const RESTORING = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::ACTIVE => 'ACTIVE', - self::FAILED => 'FAILED', - self::RESTORING => 'RESTORING', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\Backup_State::class); - diff --git a/DataprocMetastore/src/V1alpha/Backup_State.php b/DataprocMetastore/src/V1alpha/Backup_State.php deleted file mode 100644 index a4605ecd27d..00000000000 --- a/DataprocMetastore/src/V1alpha/Backup_State.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.CreateBackupRequest - */ -class CreateBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $backup_id = ''; - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $backup = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $backup_id - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @type \Google\Cloud\Metastore\V1alpha\Backup $backup - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getBackupId() - { - return $this->backup_id; - } - - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setBackupId($var) - { - GPBUtil::checkString($var, True); - $this->backup_id = $var; - - return $this; - } - - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\Backup|null - */ - public function getBackup() - { - return $this->backup; - } - - public function hasBackup() - { - return isset($this->backup); - } - - public function clearBackup() - { - unset($this->backup); - } - - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\Backup $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Backup::class); - $this->backup = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/CreateFederationRequest.php b/DataprocMetastore/src/V1alpha/CreateFederationRequest.php deleted file mode 100644 index e234f75d169..00000000000 --- a/DataprocMetastore/src/V1alpha/CreateFederationRequest.php +++ /dev/null @@ -1,247 +0,0 @@ -google.cloud.metastore.v1alpha.CreateFederationRequest - */ -class CreateFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation_id = ''; - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type string $federation_id - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @type \Google\Cloud\Metastore\V1alpha\Federation $federation - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFederationId() - { - return $this->federation_id; - } - - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFederationId($var) - { - GPBUtil::checkString($var, True); - $this->federation_id = $var; - - return $this; - } - - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\Federation|null - */ - public function getFederation() - { - return $this->federation; - } - - public function hasFederation() - { - return isset($this->federation); - } - - public function clearFederation() - { - unset($this->federation); - } - - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\Federation $var - * @return $this - */ - public function setFederation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Federation::class); - $this->federation = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/CreateMetadataImportRequest.php b/DataprocMetastore/src/V1alpha/CreateMetadataImportRequest.php deleted file mode 100644 index 517bdd1f0d8..00000000000 --- a/DataprocMetastore/src/V1alpha/CreateMetadataImportRequest.php +++ /dev/null @@ -1,248 +0,0 @@ -google.cloud.metastore.v1alpha.CreateMetadataImportRequest - */ -class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import_id = ''; - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $metadata_import_id - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @type \Google\Cloud\Metastore\V1alpha\MetadataImport $metadata_import - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getMetadataImportId() - { - return $this->metadata_import_id; - } - - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setMetadataImportId($var) - { - GPBUtil::checkString($var, True); - $this->metadata_import_id = $var; - - return $this; - } - - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\MetadataImport|null - */ - public function getMetadataImport() - { - return $this->metadata_import; - } - - public function hasMetadataImport() - { - return isset($this->metadata_import); - } - - public function clearMetadataImport() - { - unset($this->metadata_import); - } - - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\MetadataImport $var - * @return $this - */ - public function setMetadataImport($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MetadataImport::class); - $this->metadata_import = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/CreateServiceRequest.php b/DataprocMetastore/src/V1alpha/CreateServiceRequest.php deleted file mode 100644 index 5bebc1180c8..00000000000 --- a/DataprocMetastore/src/V1alpha/CreateServiceRequest.php +++ /dev/null @@ -1,248 +0,0 @@ -google.cloud.metastore.v1alpha.CreateServiceRequest - */ -class CreateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service_id = ''; - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type string $service_id - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @type \Google\Cloud\Metastore\V1alpha\Service $service - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getServiceId() - { - return $this->service_id; - } - - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setServiceId($var) - { - GPBUtil::checkString($var, True); - $this->service_id = $var; - - return $this; - } - - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DataCatalogConfig.php b/DataprocMetastore/src/V1alpha/DataCatalogConfig.php deleted file mode 100644 index 9472d9fff56..00000000000 --- a/DataprocMetastore/src/V1alpha/DataCatalogConfig.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.metastore.v1alpha.DataCatalogConfig - */ -class DataCatalogConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - */ - private $enabled = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $enabled - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - * @return bool - */ - public function getEnabled() - { - return $this->enabled; - } - - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - * @param bool $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkBool($var); - $this->enabled = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec.php b/DataprocMetastore/src/V1alpha/DatabaseDumpSpec.php deleted file mode 100644 index 775ad2d5ca0..00000000000 --- a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.metastore.v1alpha.DatabaseDumpSpec - */ -class DatabaseDumpSpec extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec/Type.php b/DataprocMetastore/src/V1alpha/DatabaseDumpSpec/Type.php deleted file mode 100644 index 290359f1c19..00000000000 --- a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec/Type.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type - */ -class Type -{ - /** - * The type of the database dump is unknown. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * Database dump is a MySQL dump file. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - /** - * Database dump contains Avro files. - * - * Generated from protobuf enum AVRO = 2; - */ - const AVRO = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - self::AVRO => 'AVRO', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Metastore\V1alpha\DatabaseDumpSpec_Type::class); - diff --git a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec_Type.php b/DataprocMetastore/src/V1alpha/DatabaseDumpSpec_Type.php deleted file mode 100644 index 32604ee347f..00000000000 --- a/DataprocMetastore/src/V1alpha/DatabaseDumpSpec_Type.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.DataplexConfig - */ -class DataplexConfig extends \Google\Protobuf\Internal\Message -{ - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - */ - private $lake_resources; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $lake_resources - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLakeResources() - { - return $this->lake_resources; - } - - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLakeResources($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\Lake::class); - $this->lake_resources = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DataprocMetastoreClient.php b/DataprocMetastore/src/V1alpha/DataprocMetastoreClient.php deleted file mode 100644 index b3160ce7f20..00000000000 --- a/DataprocMetastore/src/V1alpha/DataprocMetastoreClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/ListFederations', - $argument, - ['\Google\Cloud\Metastore\V1alpha\ListFederationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single federation. - * @param \Google\Cloud\Metastore\V1alpha\GetFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFederation(\Google\Cloud\Metastore\V1alpha\GetFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/GetFederation', - $argument, - ['\Google\Cloud\Metastore\V1alpha\Federation', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore federation in a project and location. - * @param \Google\Cloud\Metastore\V1alpha\CreateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateFederation(\Google\Cloud\Metastore\V1alpha\CreateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/CreateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the fields of a federation. - * @param \Google\Cloud\Metastore\V1alpha\UpdateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateFederation(\Google\Cloud\Metastore\V1alpha\UpdateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/UpdateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single federation. - * @param \Google\Cloud\Metastore\V1alpha\DeleteFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteFederation(\Google\Cloud\Metastore\V1alpha\DeleteFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/DeleteFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1alpha/DataprocMetastoreGrpcClient.php b/DataprocMetastore/src/V1alpha/DataprocMetastoreGrpcClient.php deleted file mode 100644 index 0824aa45094..00000000000 --- a/DataprocMetastore/src/V1alpha/DataprocMetastoreGrpcClient.php +++ /dev/null @@ -1,340 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/ListServices', - $argument, - ['\Google\Cloud\Metastore\V1alpha\ListServicesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single service. - * @param \Google\Cloud\Metastore\V1alpha\GetServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetService(\Google\Cloud\Metastore\V1alpha\GetServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/GetService', - $argument, - ['\Google\Cloud\Metastore\V1alpha\Service', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore service in a project and location. - * @param \Google\Cloud\Metastore\V1alpha\CreateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateService(\Google\Cloud\Metastore\V1alpha\CreateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single service. - * @param \Google\Cloud\Metastore\V1alpha\UpdateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateService(\Google\Cloud\Metastore\V1alpha\UpdateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/UpdateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single service. - * @param \Google\Cloud\Metastore\V1alpha\DeleteServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteService(\Google\Cloud\Metastore\V1alpha\DeleteServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/DeleteService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists imports in a service. - * @param \Google\Cloud\Metastore\V1alpha\ListMetadataImportsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMetadataImports(\Google\Cloud\Metastore\V1alpha\ListMetadataImportsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/ListMetadataImports', - $argument, - ['\Google\Cloud\Metastore\V1alpha\ListMetadataImportsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single import. - * @param \Google\Cloud\Metastore\V1alpha\GetMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMetadataImport(\Google\Cloud\Metastore\V1alpha\GetMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/GetMetadataImport', - $argument, - ['\Google\Cloud\Metastore\V1alpha\MetadataImport', 'decode'], - $metadata, $options); - } - - /** - * Creates a new MetadataImport in a given project and location. - * @param \Google\Cloud\Metastore\V1alpha\CreateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateMetadataImport(\Google\Cloud\Metastore\V1alpha\CreateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * @param \Google\Cloud\Metastore\V1alpha\UpdateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateMetadataImport(\Google\Cloud\Metastore\V1alpha\UpdateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/UpdateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Exports metadata from a service. - * @param \Google\Cloud\Metastore\V1alpha\ExportMetadataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ExportMetadata(\Google\Cloud\Metastore\V1alpha\ExportMetadataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/ExportMetadata', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Restores a service from a backup. - * @param \Google\Cloud\Metastore\V1alpha\RestoreServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestoreService(\Google\Cloud\Metastore\V1alpha\RestoreServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/RestoreService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists backups in a service. - * @param \Google\Cloud\Metastore\V1alpha\ListBackupsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListBackups(\Google\Cloud\Metastore\V1alpha\ListBackupsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/ListBackups', - $argument, - ['\Google\Cloud\Metastore\V1alpha\ListBackupsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single backup. - * @param \Google\Cloud\Metastore\V1alpha\GetBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetBackup(\Google\Cloud\Metastore\V1alpha\GetBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/GetBackup', - $argument, - ['\Google\Cloud\Metastore\V1alpha\Backup', 'decode'], - $metadata, $options); - } - - /** - * Creates a new backup in a given project and location. - * @param \Google\Cloud\Metastore\V1alpha\CreateBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateBackup(\Google\Cloud\Metastore\V1alpha\CreateBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single backup. - * @param \Google\Cloud\Metastore\V1alpha\DeleteBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteBackup(\Google\Cloud\Metastore\V1alpha\DeleteBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/DeleteBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Removes the attached IAM policies for a resource - * @param \Google\Cloud\Metastore\V1alpha\RemoveIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RemoveIamPolicy(\Google\Cloud\Metastore\V1alpha\RemoveIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/RemoveIamPolicy', - $argument, - ['\Google\Cloud\Metastore\V1alpha\RemoveIamPolicyResponse', 'decode'], - $metadata, $options); - } - - /** - * Query DPMS metadata. - * @param \Google\Cloud\Metastore\V1alpha\QueryMetadataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function QueryMetadata(\Google\Cloud\Metastore\V1alpha\QueryMetadataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/QueryMetadata', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Move a table to another database. - * @param \Google\Cloud\Metastore\V1alpha\MoveTableToDatabaseRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function MoveTableToDatabase(\Google\Cloud\Metastore\V1alpha\MoveTableToDatabaseRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/MoveTableToDatabase', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Alter metadata resource location. The metadata resource can be a database, - * table, or partition. This functionality only updates the parent directory - * for the respective metadata resource and does not transfer any existing - * data to the new location. - * @param \Google\Cloud\Metastore\V1alpha\AlterMetadataResourceLocationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AlterMetadataResourceLocation(\Google\Cloud\Metastore\V1alpha\AlterMetadataResourceLocationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1alpha.DataprocMetastore/AlterMetadataResourceLocation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1alpha/DeleteBackupRequest.php b/DataprocMetastore/src/V1alpha/DeleteBackupRequest.php deleted file mode 100644 index 3c5c9c41c12..00000000000 --- a/DataprocMetastore/src/V1alpha/DeleteBackupRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.metastore.v1alpha.DeleteBackupRequest - */ -class DeleteBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DeleteFederationRequest.php b/DataprocMetastore/src/V1alpha/DeleteFederationRequest.php deleted file mode 100644 index e25fec4d5c2..00000000000 --- a/DataprocMetastore/src/V1alpha/DeleteFederationRequest.php +++ /dev/null @@ -1,145 +0,0 @@ -google.cloud.metastore.v1alpha.DeleteFederationRequest - */ -class DeleteFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/DeleteServiceRequest.php b/DataprocMetastore/src/V1alpha/DeleteServiceRequest.php deleted file mode 100644 index e4f3574afa3..00000000000 --- a/DataprocMetastore/src/V1alpha/DeleteServiceRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.metastore.v1alpha.DeleteServiceRequest - */ -class DeleteServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/EncryptionConfig.php b/DataprocMetastore/src/V1alpha/EncryptionConfig.php deleted file mode 100644 index 5d796e484eb..00000000000 --- a/DataprocMetastore/src/V1alpha/EncryptionConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1alpha.EncryptionConfig - */ -class EncryptionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - */ - private $kms_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kms_key - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - * @return string - */ - public function getKmsKey() - { - return $this->kms_key; - } - - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - * @param string $var - * @return $this - */ - public function setKmsKey($var) - { - GPBUtil::checkString($var, True); - $this->kms_key = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ErrorDetails.php b/DataprocMetastore/src/V1alpha/ErrorDetails.php deleted file mode 100644 index 3181286b80d..00000000000 --- a/DataprocMetastore/src/V1alpha/ErrorDetails.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1alpha.ErrorDetails - */ -class ErrorDetails extends \Google\Protobuf\Internal\Message -{ - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - */ - private $details; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $details - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getDetails() - { - return $this->details; - } - - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setDetails($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->details = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ExportMetadataRequest.php b/DataprocMetastore/src/V1alpha/ExportMetadataRequest.php deleted file mode 100644 index 59014ad675a..00000000000 --- a/DataprocMetastore/src/V1alpha/ExportMetadataRequest.php +++ /dev/null @@ -1,232 +0,0 @@ -google.cloud.metastore.v1alpha.ExportMetadataRequest - */ -class ExportMetadataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $database_dump_type = 0; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $destination_gcs_folder - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * @type string $service - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type int $database_dump_type - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * - * Generated from protobuf field string destination_gcs_folder = 2; - * @return string - */ - public function getDestinationGcsFolder() - { - return $this->readOneof(2); - } - - public function hasDestinationGcsFolder() - { - return $this->hasOneof(2); - } - - /** - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * - * Generated from protobuf field string destination_gcs_folder = 2; - * @param string $var - * @return $this - */ - public function setDestinationGcsFolder($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDatabaseDumpType() - { - return $this->database_dump_type; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDatabaseDumpType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\DatabaseDumpSpec\Type::class); - $this->database_dump_type = $var; - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Federation.php b/DataprocMetastore/src/V1alpha/Federation.php deleted file mode 100644 index 6880ed15c73..00000000000 --- a/DataprocMetastore/src/V1alpha/Federation.php +++ /dev/null @@ -1,433 +0,0 @@ -google.cloud.metastore.v1alpha.Federation - */ -class Federation extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $version = ''; - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - */ - private $backend_metastores; - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state_message = ''; - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metastore federation was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metastore federation was last updated. - * @type array|\Google\Protobuf\Internal\MapField $labels - * User-defined labels for the metastore federation. - * @type string $version - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * @type array|\Google\Protobuf\Internal\MapField $backend_metastores - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * @type string $endpoint_uri - * Output only. The federation endpoint. - * @type int $state - * Output only. The current state of the federation. - * @type string $state_message - * Output only. Additional information about the current state of the - * metastore federation, if available. - * @type string $uid - * Output only. The globally unique resource identifier of the metastore - * federation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getBackendMetastores() - { - return $this->backend_metastores; - } - - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setBackendMetastores($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\BackendMetastore::class); - $this->backend_metastores = $arr; - - return $this; - } - - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Federation\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Federation/State.php b/DataprocMetastore/src/V1alpha/Federation/State.php deleted file mode 100644 index 8282624f193..00000000000 --- a/DataprocMetastore/src/V1alpha/Federation/State.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.metastore.v1alpha.Federation.State - */ -class State -{ - /** - * The state of the metastore federation is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metastore federation is in the process of being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The metastore federation is running and ready to serve queries. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The metastore federation is being updated. It remains usable but cannot - * accept additional update requests or be deleted at this time. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * The metastore federation is undergoing deletion. It cannot be used. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * The metastore federation has encountered an error and cannot be used. The - * metastore federation should be deleted. - * - * Generated from protobuf enum ERROR = 5; - */ - const ERROR = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - self::ERROR => 'ERROR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\Federation_State::class); - diff --git a/DataprocMetastore/src/V1alpha/Federation_State.php b/DataprocMetastore/src/V1alpha/Federation_State.php deleted file mode 100644 index e4a593fbe60..00000000000 --- a/DataprocMetastore/src/V1alpha/Federation_State.php +++ /dev/null @@ -1,16 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->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 This class will be removed in the next major version update. - */ -class DataprocMetastoreFederationGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1alpha.DataprocMetastoreFederation'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.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 $federationNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_federation_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_rest_client_config.php', - ], - ], - ]; - } - - private static function getFederationNameTemplate() - { - if (self::$federationNameTemplate == null) { - self::$federationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/federations/{federation}'); - } - - return self::$federationNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'federation' => self::getFederationNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a federation - * resource. - * - * @param string $project - * @param string $location - * @param string $federation - * - * @return string The formatted federation resource. - * - * @experimental - */ - public static function federationName($project, $location, $federation) - { - return self::getFederationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'federation' => $federation, - ]); - } - - /** - * 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, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - federation: projects/{project}/locations/{location}/federations/{federation} - * - location: projects/{project}/locations/{location} - * - * 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'metastore.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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a metastore federation in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $federationId Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Federation $federation Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createFederation($parent, $federationId, $federation, array $optionalArgs = []) - { - $request = new CreateFederationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFederationId($federationId); - $request->setFederation($federation); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'deleteFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to delete, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteFederation($name, array $optionalArgs = []) - { - $request = new DeleteFederationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets the details of a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $response = $dataprocMetastoreFederationClient->getFederation($formattedName); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @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\Metastore\V1alpha\Federation - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getFederation($name, array $optionalArgs = []) - { - $request = new GetFederationRequest(); - $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('GetFederation', Federation::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists federations in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 listFederations($parent, array $optionalArgs = []) - { - $request = new ListFederationsRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListFederations', $optionalArgs, ListFederationsResponse::class, $request); - } - - /** - * Updates the fields of a federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $updateMask = new FieldMask(); - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'updateFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Federation $federation Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateFederation($updateMask, $federation, array $optionalArgs = []) - { - $request = new UpdateFederationRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setFederation($federation); - $requestParamHeaders['federation.name'] = $federation->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $response = $dataprocMetastoreFederationClient->getLocation(); - * } finally { - * $dataprocMetastoreFederationClient->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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreFederationClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreFederationClient->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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreFederationClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreFederationClient->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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreFederationClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreFederationClient->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/DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreGapicClient.php b/DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreGapicClient.php deleted file mode 100644 index b44f0b15698..00000000000 --- a/DataprocMetastore/src/V1alpha/Gapic/DataprocMetastoreGapicClient.php +++ /dev/null @@ -1,2408 +0,0 @@ -serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->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 This class will be removed in the next major version update. - */ -class DataprocMetastoreGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1alpha.DataprocMetastore'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.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 $backupNameTemplate; - - private static $lakeNameTemplate; - - private static $locationNameTemplate; - - private static $metadataImportNameTemplate; - - private static $networkNameTemplate; - - private static $serviceNameTemplate; - - private static $subnetworkNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_rest_client_config.php', - ], - ], - ]; - } - - private static function getBackupNameTemplate() - { - if (self::$backupNameTemplate == null) { - self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/backups/{backup}'); - } - - return self::$backupNameTemplate; - } - - private static function getLakeNameTemplate() - { - if (self::$lakeNameTemplate == null) { - self::$lakeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/lakes/{lake}'); - } - - return self::$lakeNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getMetadataImportNameTemplate() - { - if (self::$metadataImportNameTemplate == null) { - self::$metadataImportNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import}'); - } - - return self::$metadataImportNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getSubnetworkNameTemplate() - { - if (self::$subnetworkNameTemplate == null) { - self::$subnetworkNameTemplate = new PathTemplate('projects/{project}/regions/{region}/subnetworks/{subnetwork}'); - } - - return self::$subnetworkNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'backup' => self::getBackupNameTemplate(), - 'lake' => self::getLakeNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'metadataImport' => self::getMetadataImportNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'service' => self::getServiceNameTemplate(), - 'subnetwork' => self::getSubnetworkNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $backup - * - * @return string The formatted backup resource. - * - * @experimental - */ - public static function backupName($project, $location, $service, $backup) - { - return self::getBackupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a lake - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * - * @return string The formatted lake resource. - * - * @experimental - */ - public static function lakeName($project, $location, $lake) - { - return self::getLakeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - ]); - } - - /** - * 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 - * metadata_import resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $metadataImport - * - * @return string The formatted metadata_import resource. - * - * @experimental - */ - public static function metadataImportName($project, $location, $service, $metadataImport) - { - return self::getMetadataImportNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'metadata_import' => $metadataImport, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - * - * @experimental - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * - * @return string The formatted service resource. - * - * @experimental - */ - public static function serviceName($project, $location, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a subnetwork - * resource. - * - * @param string $project - * @param string $region - * @param string $subnetwork - * - * @return string The formatted subnetwork resource. - * - * @experimental - */ - public static function subnetworkName($project, $region, $subnetwork) - { - return self::getSubnetworkNameTemplate()->render([ - 'project' => $project, - 'region' => $region, - 'subnetwork' => $subnetwork, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - backup: projects/{project}/locations/{location}/services/{service}/backups/{backup} - * - lake: projects/{project}/locations/{location}/lakes/{lake} - * - location: projects/{project}/locations/{location} - * - metadataImport: projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import} - * - network: projects/{project}/global/networks/{network} - * - service: projects/{project}/locations/{location}/services/{service} - * - subnetwork: projects/{project}/regions/{region}/subnetworks/{subnetwork} - * - * 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'metastore.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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Alter metadata resource location. The metadata resource can be a database, - * table, or partition. This functionality only updates the parent directory - * for the respective metadata resource and does not transfer any existing - * data to the new location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $resourceName Required. The relative metadata resource name in the following format. - * - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * @param string $locationUri Required. The new location URI for the metadata resource. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function alterMetadataResourceLocation($service, $resourceName, $locationUri, array $optionalArgs = []) - { - $request = new AlterMetadataResourceLocationRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setResourceName($resourceName); - $request->setLocationUri($locationUri); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('AlterMetadataResourceLocation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new backup in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $backupId = 'backup_id'; - * $backup = new Backup(); - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * backup of the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $backupId Required. The ID of the backup, which is used as the final component of the - * backup's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param Backup $backup Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) - { - $request = new CreateBackupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupId($backupId); - $request->setBackup($backup); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new MetadataImport in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $metadataImportId = 'metadata_import_id'; - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $metadataImportId Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param MetadataImport $metadataImport Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createMetadataImport($parent, $metadataImportId, $metadataImport, array $optionalArgs = []) - { - $request = new CreateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMetadataImportId($metadataImportId); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a metastore service in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * $serviceId = 'service_id'; - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $serviceId Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Service $service Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createService($parent, $serviceId, $service, array $optionalArgs = []) - { - $request = new CreateServiceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setServiceId($serviceId); - $request->setService($service); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to delete, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteBackup($name, array $optionalArgs = []) - { - $request = new DeleteBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to delete, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteService($name, array $optionalArgs = []) - { - $request = new DeleteServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Exports metadata from a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'exportMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * export, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $destinationGcsFolder - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type int $databaseDumpType - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1alpha\DatabaseDumpSpec\Type} - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function exportMetadata($service, array $optionalArgs = []) - { - $request = new ExportMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['destinationGcsFolder'])) { - $request->setDestinationGcsFolder($optionalArgs['destinationGcsFolder']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['databaseDumpType'])) { - $request->setDatabaseDumpType($optionalArgs['databaseDumpType']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ExportMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets details of a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $response = $dataprocMetastoreClient->getBackup($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to retrieve, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @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\Metastore\V1alpha\Backup - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getBackup($name, array $optionalArgs = []) - { - $request = new GetBackupRequest(); - $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('GetBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single import. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - * $response = $dataprocMetastoreClient->getMetadataImport($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * @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\Metastore\V1alpha\MetadataImport - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getMetadataImport($name, array $optionalArgs = []) - { - $request = new GetMetadataImportRequest(); - $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('GetMetadataImport', MetadataImport::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the details of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $response = $dataprocMetastoreClient->getService($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @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\Metastore\V1alpha\Service - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getService($name, array $optionalArgs = []) - { - $request = new GetServiceRequest(); - $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('GetService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists backups in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose backups to - * list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 listBackups($parent, array $optionalArgs = []) - { - $request = new ListBackupsRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); - } - - /** - * Lists imports in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 listMetadataImports($parent, array $optionalArgs = []) - { - $request = new ListMetadataImportsRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListMetadataImports', $optionalArgs, ListMetadataImportsResponse::class, $request); - } - - /** - * Lists services in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore services - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 listServices($parent, array $optionalArgs = []) - { - $request = new ListServicesRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); - } - - /** - * Move a table to another database. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $tableName = 'table_name'; - * $dbName = 'db_name'; - * $destinationDbName = 'destination_db_name'; - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'moveTableToDatabase'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $tableName Required. The name of the table to be moved. - * @param string $dbName Required. The name of the database where the table resides. - * @param string $destinationDbName Required. The name of the database where the table should be moved. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function moveTableToDatabase($service, $tableName, $dbName, $destinationDbName, array $optionalArgs = []) - { - $request = new MoveTableToDatabaseRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setTableName($tableName); - $request->setDbName($dbName); - $request->setDestinationDbName($destinationDbName); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('MoveTableToDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Query DPMS metadata. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $query = 'query'; - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'queryMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $query Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function queryMetadata($service, $query, array $optionalArgs = []) - { - $request = new QueryMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setQuery($query); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('QueryMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Removes the attached IAM policies for a resource - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreClient->removeIamPolicy($resource); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type bool $asynchronous - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * @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\Metastore\V1alpha\RemoveIamPolicyResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function removeIamPolicy($resource, array $optionalArgs = []) - { - $request = new RemoveIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['asynchronous'])) { - $request->setAsynchronous($optionalArgs['asynchronous']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RemoveIamPolicy', RemoveIamPolicyResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Restores a service from a backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $formattedBackup = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'restoreService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * restore, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $backup Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $restoreType - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1alpha\Restore\RestoreType} - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function restoreService($service, $backup, array $optionalArgs = []) - { - $request = new RestoreServiceRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setBackup($backup); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['restoreType'])) { - $request->setRestoreType($optionalArgs['restoreType']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param MetadataImport $metadataImport Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateMetadataImport($updateMask, $metadataImport, array $optionalArgs = []) - { - $request = new UpdateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['metadata_import.name'] = $metadataImport->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Service $service Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateService($updateMask, $service, array $optionalArgs = []) - { - $request = new UpdateServiceRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setService($service); - $requestParamHeaders['service.name'] = $service->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $response = $dataprocMetastoreClient->getLocation(); - * } finally { - * $dataprocMetastoreClient->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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreClient->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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreClient->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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreClient->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/DataprocMetastore/src/V1alpha/GetBackupRequest.php b/DataprocMetastore/src/V1alpha/GetBackupRequest.php deleted file mode 100644 index 66676653d76..00000000000 --- a/DataprocMetastore/src/V1alpha/GetBackupRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1alpha.GetBackupRequest - */ -class GetBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/GetFederationRequest.php b/DataprocMetastore/src/V1alpha/GetFederationRequest.php deleted file mode 100644 index 5603b5c3301..00000000000 --- a/DataprocMetastore/src/V1alpha/GetFederationRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1alpha.GetFederationRequest - */ -class GetFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/GetMetadataImportRequest.php b/DataprocMetastore/src/V1alpha/GetMetadataImportRequest.php deleted file mode 100644 index 1091e94c352..00000000000 --- a/DataprocMetastore/src/V1alpha/GetMetadataImportRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1alpha.GetMetadataImportRequest - */ -class GetMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/GetServiceRequest.php b/DataprocMetastore/src/V1alpha/GetServiceRequest.php deleted file mode 100644 index 9d9e528cb81..00000000000 --- a/DataprocMetastore/src/V1alpha/GetServiceRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1alpha.GetServiceRequest - */ -class GetServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig.php b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig.php deleted file mode 100644 index ce72c2d916b..00000000000 --- a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig.php +++ /dev/null @@ -1,278 +0,0 @@ -google.cloud.metastore.v1alpha.HiveMetastoreConfig - */ -class HiveMetastoreConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $version = ''; - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - */ - private $config_overrides; - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.KerberosConfig kerberos_config = 3; - */ - private $kerberos_config = null; - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - */ - private $endpoint_protocol = 0; - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - */ - private $auxiliary_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * Immutable. The Hive metastore schema version. - * @type array|\Google\Protobuf\Internal\MapField $config_overrides - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * @type \Google\Cloud\Metastore\V1alpha\KerberosConfig $kerberos_config - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * @type int $endpoint_protocol - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * @type array|\Google\Protobuf\Internal\MapField $auxiliary_versions - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getConfigOverrides() - { - return $this->config_overrides; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setConfigOverrides($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->config_overrides = $arr; - - return $this; - } - - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.KerberosConfig kerberos_config = 3; - * @return \Google\Cloud\Metastore\V1alpha\KerberosConfig|null - */ - public function getKerberosConfig() - { - return $this->kerberos_config; - } - - public function hasKerberosConfig() - { - return isset($this->kerberos_config); - } - - public function clearKerberosConfig() - { - unset($this->kerberos_config); - } - - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.KerberosConfig kerberos_config = 3; - * @param \Google\Cloud\Metastore\V1alpha\KerberosConfig $var - * @return $this - */ - public function setKerberosConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\KerberosConfig::class); - $this->kerberos_config = $var; - - return $this; - } - - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - * @return int - */ - public function getEndpointProtocol() - { - return $this->endpoint_protocol; - } - - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - * @param int $var - * @return $this - */ - public function setEndpointProtocol($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig\EndpointProtocol::class); - $this->endpoint_protocol = $var; - - return $this; - } - - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAuxiliaryVersions() - { - return $this->auxiliary_versions; - } - - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAuxiliaryVersions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\AuxiliaryVersionConfig::class); - $this->auxiliary_versions = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig/EndpointProtocol.php b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig/EndpointProtocol.php deleted file mode 100644 index 4b93919c49c..00000000000 --- a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig/EndpointProtocol.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1alpha.HiveMetastoreConfig.EndpointProtocol - */ -class EndpointProtocol -{ - /** - * The protocol is not set. - * - * Generated from protobuf enum ENDPOINT_PROTOCOL_UNSPECIFIED = 0; - */ - const ENDPOINT_PROTOCOL_UNSPECIFIED = 0; - /** - * Use the legacy Apache Thrift protocol for the metastore service endpoint. - * - * Generated from protobuf enum THRIFT = 1; - */ - const THRIFT = 1; - /** - * Use the modernized gRPC protocol for the metastore service endpoint. - * - * Generated from protobuf enum GRPC = 2; - */ - const GRPC = 2; - - private static $valueToName = [ - self::ENDPOINT_PROTOCOL_UNSPECIFIED => 'ENDPOINT_PROTOCOL_UNSPECIFIED', - self::THRIFT => 'THRIFT', - self::GRPC => 'GRPC', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EndpointProtocol::class, \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig_EndpointProtocol::class); - diff --git a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig_EndpointProtocol.php b/DataprocMetastore/src/V1alpha/HiveMetastoreConfig_EndpointProtocol.php deleted file mode 100644 index cfb1ce7c78e..00000000000 --- a/DataprocMetastore/src/V1alpha/HiveMetastoreConfig_EndpointProtocol.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.KerberosConfig - */ -class KerberosConfig extends \Google\Protobuf\Internal\Message -{ - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Secret keytab = 1; - */ - private $keytab = null; - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - */ - private $principal = ''; - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - */ - private $krb5_config_gcs_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1alpha\Secret $keytab - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * @type string $principal - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * @type string $krb5_config_gcs_uri - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Secret keytab = 1; - * @return \Google\Cloud\Metastore\V1alpha\Secret|null - */ - public function getKeytab() - { - return $this->keytab; - } - - public function hasKeytab() - { - return isset($this->keytab); - } - - public function clearKeytab() - { - unset($this->keytab); - } - - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Secret keytab = 1; - * @param \Google\Cloud\Metastore\V1alpha\Secret $var - * @return $this - */ - public function setKeytab($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Secret::class); - $this->keytab = $var; - - return $this; - } - - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - * @return string - */ - public function getPrincipal() - { - return $this->principal; - } - - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - * @param string $var - * @return $this - */ - public function setPrincipal($var) - { - GPBUtil::checkString($var, True); - $this->principal = $var; - - return $this; - } - - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - * @return string - */ - public function getKrb5ConfigGcsUri() - { - return $this->krb5_config_gcs_uri; - } - - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - * @param string $var - * @return $this - */ - public function setKrb5ConfigGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->krb5_config_gcs_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Lake.php b/DataprocMetastore/src/V1alpha/Lake.php deleted file mode 100644 index fdc70784462..00000000000 --- a/DataprocMetastore/src/V1alpha/Lake.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1alpha.Lake - */ -class Lake extends \Google\Protobuf\Internal\Message -{ - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListBackupsRequest.php b/DataprocMetastore/src/V1alpha/ListBackupsRequest.php deleted file mode 100644 index 14f48867331..00000000000 --- a/DataprocMetastore/src/V1alpha/ListBackupsRequest.php +++ /dev/null @@ -1,252 +0,0 @@ -google.cloud.metastore.v1alpha.ListBackupsRequest - */ -class ListBackupsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * @type int $page_size - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1alpha.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListBackupsResponse.php b/DataprocMetastore/src/V1alpha/ListBackupsResponse.php deleted file mode 100644 index 732b3ae64f1..00000000000 --- a/DataprocMetastore/src/V1alpha/ListBackupsResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1alpha.ListBackupsResponse - */ -class ListBackupsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Backup backups = 1; - */ - private $backups; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\Backup>|\Google\Protobuf\Internal\RepeatedField $backups - * The backups of the specified service. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Backup backups = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBackups() - { - return $this->backups; - } - - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Backup backups = 1; - * @param array<\Google\Cloud\Metastore\V1alpha\Backup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBackups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\Backup::class); - $this->backups = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListFederationsRequest.php b/DataprocMetastore/src/V1alpha/ListFederationsRequest.php deleted file mode 100644 index 1b41fd48ba9..00000000000 --- a/DataprocMetastore/src/V1alpha/ListFederationsRequest.php +++ /dev/null @@ -1,251 +0,0 @@ -google.cloud.metastore.v1alpha.ListFederationsRequest - */ -class ListFederationsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type int $page_size - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListFederationsResponse.php b/DataprocMetastore/src/V1alpha/ListFederationsResponse.php deleted file mode 100644 index b07375b142a..00000000000 --- a/DataprocMetastore/src/V1alpha/ListFederationsResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.metastore.v1alpha.ListFederationsResponse - */ -class ListFederationsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Federation federations = 1; - */ - private $federations; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\Federation>|\Google\Protobuf\Internal\RepeatedField $federations - * The services in the specified location. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Federation federations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFederations() - { - return $this->federations; - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Federation federations = 1; - * @param array<\Google\Cloud\Metastore\V1alpha\Federation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFederations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\Federation::class); - $this->federations = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListMetadataImportsRequest.php b/DataprocMetastore/src/V1alpha/ListMetadataImportsRequest.php deleted file mode 100644 index 6efc93b0c34..00000000000 --- a/DataprocMetastore/src/V1alpha/ListMetadataImportsRequest.php +++ /dev/null @@ -1,252 +0,0 @@ -google.cloud.metastore.v1alpha.ListMetadataImportsRequest - */ -class ListMetadataImportsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * @type int $page_size - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListMetadataImportsResponse.php b/DataprocMetastore/src/V1alpha/ListMetadataImportsResponse.php deleted file mode 100644 index ea117bfee1d..00000000000 --- a/DataprocMetastore/src/V1alpha/ListMetadataImportsResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1alpha.ListMetadataImportsResponse - */ -class ListMetadataImportsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataImport metadata_imports = 1; - */ - private $metadata_imports; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\MetadataImport>|\Google\Protobuf\Internal\RepeatedField $metadata_imports - * The imports in the specified service. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataImport metadata_imports = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMetadataImports() - { - return $this->metadata_imports; - } - - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataImport metadata_imports = 1; - * @param array<\Google\Cloud\Metastore\V1alpha\MetadataImport>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMetadataImports($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\MetadataImport::class); - $this->metadata_imports = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListServicesRequest.php b/DataprocMetastore/src/V1alpha/ListServicesRequest.php deleted file mode 100644 index 552b8f04361..00000000000 --- a/DataprocMetastore/src/V1alpha/ListServicesRequest.php +++ /dev/null @@ -1,256 +0,0 @@ -google.cloud.metastore.v1alpha.ListServicesRequest - */ -class ListServicesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type int $page_size - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1alpha.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ListServicesResponse.php b/DataprocMetastore/src/V1alpha/ListServicesResponse.php deleted file mode 100644 index 651fe3fe9e7..00000000000 --- a/DataprocMetastore/src/V1alpha/ListServicesResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1alpha.ListServicesResponse - */ -class ListServicesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Service services = 1; - */ - private $services; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\Service>|\Google\Protobuf\Internal\RepeatedField $services - * The services in the specified location. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Service services = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServices() - { - return $this->services; - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Service services = 1; - * @param array<\Google\Cloud\Metastore\V1alpha\Service>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\Service::class); - $this->services = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/LocationMetadata.php b/DataprocMetastore/src/V1alpha/LocationMetadata.php deleted file mode 100644 index 068677258a7..00000000000 --- a/DataprocMetastore/src/V1alpha/LocationMetadata.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1alpha.LocationMetadata - */ -class LocationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - */ - private $supported_hive_metastore_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\LocationMetadata\HiveMetastoreVersion>|\Google\Protobuf\Internal\RepeatedField $supported_hive_metastore_versions - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSupportedHiveMetastoreVersions() - { - return $this->supported_hive_metastore_versions; - } - - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - * @param array<\Google\Cloud\Metastore\V1alpha\LocationMetadata\HiveMetastoreVersion>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSupportedHiveMetastoreVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\LocationMetadata\HiveMetastoreVersion::class); - $this->supported_hive_metastore_versions = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/LocationMetadata/HiveMetastoreVersion.php b/DataprocMetastore/src/V1alpha/LocationMetadata/HiveMetastoreVersion.php deleted file mode 100644 index 5259ba3115e..00000000000 --- a/DataprocMetastore/src/V1alpha/LocationMetadata/HiveMetastoreVersion.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.metastore.v1alpha.LocationMetadata.HiveMetastoreVersion - */ -class HiveMetastoreVersion extends \Google\Protobuf\Internal\Message -{ - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - */ - private $version = ''; - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - */ - private $is_default = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * The semantic version of the Hive Metastore software. - * @type bool $is_default - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - * @return bool - */ - public function getIsDefault() - { - return $this->is_default; - } - - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - * @param bool $var - * @return $this - */ - public function setIsDefault($var) - { - GPBUtil::checkBool($var); - $this->is_default = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HiveMetastoreVersion::class, \Google\Cloud\Metastore\V1alpha\LocationMetadata_HiveMetastoreVersion::class); - diff --git a/DataprocMetastore/src/V1alpha/LocationMetadata_HiveMetastoreVersion.php b/DataprocMetastore/src/V1alpha/LocationMetadata_HiveMetastoreVersion.php deleted file mode 100644 index 765412c896b..00000000000 --- a/DataprocMetastore/src/V1alpha/LocationMetadata_HiveMetastoreVersion.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.MaintenanceWindow - */ -class MaintenanceWindow extends \Google\Protobuf\Internal\Message -{ - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - */ - private $hour_of_day = null; - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - */ - private $day_of_week = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Int32Value $hour_of_day - * The hour of day (0-23) when the window starts. - * @type int $day_of_week - * The day of week, when the window starts. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @return \Google\Protobuf\Int32Value|null - */ - public function getHourOfDay() - { - return $this->hour_of_day; - } - - public function hasHourOfDay() - { - return isset($this->hour_of_day); - } - - public function clearHourOfDay() - { - unset($this->hour_of_day); - } - - /** - * Returns the unboxed value from getHourOfDay() - - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @return int|null - */ - public function getHourOfDayValue() - { - return $this->readWrapperValue("hour_of_day"); - } - - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @param \Google\Protobuf\Int32Value $var - * @return $this - */ - public function setHourOfDay($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); - $this->hour_of_day = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. - - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @param int|null $var - * @return $this - */ - public function setHourOfDayValue($var) - { - $this->writeWrapperValue("hour_of_day", $var); - return $this;} - - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - * @return int - */ - public function getDayOfWeek() - { - return $this->day_of_week; - } - - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - * @param int $var - * @return $this - */ - public function setDayOfWeek($var) - { - GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); - $this->day_of_week = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MetadataExport.php b/DataprocMetastore/src/V1alpha/MetadataExport.php deleted file mode 100644 index 12d8b2f0890..00000000000 --- a/DataprocMetastore/src/V1alpha/MetadataExport.php +++ /dev/null @@ -1,240 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataExport - */ -class MetadataExport extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_time = null; - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $database_dump_type = 0; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $destination_gcs_uri - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * @type \Google\Protobuf\Timestamp $start_time - * Output only. The time when the export started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the export ended. - * @type int $state - * Output only. The current state of the export. - * @type int $database_dump_type - * Output only. The type of the database dump. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * - * Generated from protobuf field string destination_gcs_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDestinationGcsUri() - { - return $this->readOneof(4); - } - - public function hasDestinationGcsUri() - { - return $this->hasOneof(4); - } - - /** - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * - * Generated from protobuf field string destination_gcs_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDestinationGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\MetadataExport\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getDatabaseDumpType() - { - return $this->database_dump_type; - } - - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setDatabaseDumpType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\DatabaseDumpSpec\Type::class); - $this->database_dump_type = $var; - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MetadataExport/State.php b/DataprocMetastore/src/V1alpha/MetadataExport/State.php deleted file mode 100644 index 5c68430d9e4..00000000000 --- a/DataprocMetastore/src/V1alpha/MetadataExport/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataExport.State - */ -class State -{ - /** - * The state of the metadata export is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata export is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata export completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata export failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The metadata export is cancelled. - * - * Generated from protobuf enum CANCELLED = 4; - */ - const CANCELLED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\MetadataExport_State::class); - diff --git a/DataprocMetastore/src/V1alpha/MetadataExport_State.php b/DataprocMetastore/src/V1alpha/MetadataExport_State.php deleted file mode 100644 index 14491f90cb0..00000000000 --- a/DataprocMetastore/src/V1alpha/MetadataExport_State.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataImport - */ -class MetadataImport extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - */ - private $description = ''; - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - protected $metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1alpha\MetadataImport\DatabaseDump $database_dump - * Immutable. A database dump from a pre-existing metastore's database. - * @type string $name - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * @type string $description - * The description of the metadata import. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metadata import was started. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metadata import was last updated. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the metadata import finished. - * @type int $state - * Output only. The current state of the metadata import. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. A database dump from a pre-existing metastore's database. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump database_dump = 6 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\Metastore\V1alpha\MetadataImport\DatabaseDump|null - */ - public function getDatabaseDump() - { - return $this->readOneof(6); - } - - public function hasDatabaseDump() - { - return $this->hasOneof(6); - } - - /** - * Immutable. A database dump from a pre-existing metastore's database. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump database_dump = 6 [(.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\Metastore\V1alpha\MetadataImport\DatabaseDump $var - * @return $this - */ - public function setDatabaseDump($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MetadataImport\DatabaseDump::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\MetadataImport\State::class); - $this->state = $var; - - return $this; - } - - /** - * @return string - */ - public function getMetadata() - { - return $this->whichOneof("metadata"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump.php b/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump.php deleted file mode 100644 index 9d58308fa40..00000000000 --- a/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump.php +++ /dev/null @@ -1,191 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump - */ -class DatabaseDump extends \Google\Protobuf\Internal\Message -{ - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @deprecated - */ - protected $database_type = 0; - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - */ - private $gcs_uri = ''; - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @deprecated - */ - protected $source_database = ''; - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $database_type - * The type of the database. - * @type string $gcs_uri - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * @type string $source_database - * The name of the source database. - * @type int $type - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @return int - * @deprecated - */ - public function getDatabaseType() - { - @trigger_error('database_type is deprecated.', E_USER_DEPRECATED); - return $this->database_type; - } - - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @param int $var - * @return $this - * @deprecated - */ - public function setDatabaseType($var) - { - @trigger_error('database_type is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\MetadataImport\DatabaseDump\DatabaseType::class); - $this->database_type = $var; - - return $this; - } - - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - * @return string - */ - public function getGcsUri() - { - return $this->gcs_uri; - } - - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - * @param string $var - * @return $this - */ - public function setGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->gcs_uri = $var; - - return $this; - } - - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @return string - * @deprecated - */ - public function getSourceDatabase() - { - @trigger_error('source_database is deprecated.', E_USER_DEPRECATED); - return $this->source_database; - } - - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setSourceDatabase($var) - { - @trigger_error('source_database is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->source_database = $var; - - return $this; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\DatabaseDumpSpec\Type::class); - $this->type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseDump::class, \Google\Cloud\Metastore\V1alpha\MetadataImport_DatabaseDump::class); - diff --git a/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump/DatabaseType.php b/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump/DatabaseType.php deleted file mode 100644 index be296436de3..00000000000 --- a/DataprocMetastore/src/V1alpha/MetadataImport/DatabaseDump/DatabaseType.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataImport.DatabaseDump.DatabaseType - */ -class DatabaseType -{ - /** - * The type of the source database is unknown. - * - * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; - */ - const DATABASE_TYPE_UNSPECIFIED = 0; - /** - * The type of the source database is MySQL. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - - private static $valueToName = [ - self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1alpha\MetadataImport_DatabaseDump_DatabaseType::class); - diff --git a/DataprocMetastore/src/V1alpha/MetadataImport/State.php b/DataprocMetastore/src/V1alpha/MetadataImport/State.php deleted file mode 100644 index 7064408075c..00000000000 --- a/DataprocMetastore/src/V1alpha/MetadataImport/State.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataImport.State - */ -class State -{ - /** - * The state of the metadata import is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata import is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata import completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata import is being updated. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * The metadata import failed, and attempted metadata changes were rolled - * back. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::UPDATING => 'UPDATING', - self::FAILED => 'FAILED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\MetadataImport_State::class); - diff --git a/DataprocMetastore/src/V1alpha/MetadataImport_DatabaseDump.php b/DataprocMetastore/src/V1alpha/MetadataImport_DatabaseDump.php deleted file mode 100644 index 41d5f644b16..00000000000 --- a/DataprocMetastore/src/V1alpha/MetadataImport_DatabaseDump.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataIntegration - */ -class MetadataIntegration extends \Google\Protobuf\Internal\Message -{ - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataCatalogConfig data_catalog_config = 1; - */ - private $data_catalog_config = null; - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataplexConfig dataplex_config = 2; - */ - private $dataplex_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1alpha\DataCatalogConfig $data_catalog_config - * The integration config for the Data Catalog service. - * @type \Google\Cloud\Metastore\V1alpha\DataplexConfig $dataplex_config - * The integration config for the Dataplex service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataCatalogConfig data_catalog_config = 1; - * @return \Google\Cloud\Metastore\V1alpha\DataCatalogConfig|null - */ - public function getDataCatalogConfig() - { - return $this->data_catalog_config; - } - - public function hasDataCatalogConfig() - { - return isset($this->data_catalog_config); - } - - public function clearDataCatalogConfig() - { - unset($this->data_catalog_config); - } - - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataCatalogConfig data_catalog_config = 1; - * @param \Google\Cloud\Metastore\V1alpha\DataCatalogConfig $var - * @return $this - */ - public function setDataCatalogConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\DataCatalogConfig::class); - $this->data_catalog_config = $var; - - return $this; - } - - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataplexConfig dataplex_config = 2; - * @return \Google\Cloud\Metastore\V1alpha\DataplexConfig|null - */ - public function getDataplexConfig() - { - return $this->dataplex_config; - } - - public function hasDataplexConfig() - { - return isset($this->dataplex_config); - } - - public function clearDataplexConfig() - { - unset($this->dataplex_config); - } - - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.DataplexConfig dataplex_config = 2; - * @param \Google\Cloud\Metastore\V1alpha\DataplexConfig $var - * @return $this - */ - public function setDataplexConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\DataplexConfig::class); - $this->dataplex_config = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MetadataManagementActivity.php b/DataprocMetastore/src/V1alpha/MetadataManagementActivity.php deleted file mode 100644 index 3af658f899e..00000000000 --- a/DataprocMetastore/src/V1alpha/MetadataManagementActivity.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.metastore.v1alpha.MetadataManagementActivity - */ -class MetadataManagementActivity extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $metadata_exports; - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $restores; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\MetadataExport>|\Google\Protobuf\Internal\RepeatedField $metadata_exports - * Output only. The latest metadata exports of the metastore service. - * @type array<\Google\Cloud\Metastore\V1alpha\Restore>|\Google\Protobuf\Internal\RepeatedField $restores - * Output only. The latest restores of the metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMetadataExports() - { - return $this->metadata_exports; - } - - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Metastore\V1alpha\MetadataExport>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMetadataExports($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\MetadataExport::class); - $this->metadata_exports = $arr; - - return $this; - } - - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRestores() - { - return $this->restores; - } - - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Metastore\V1alpha\Restore>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRestores($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\Restore::class); - $this->restores = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MoveTableToDatabaseRequest.php b/DataprocMetastore/src/V1alpha/MoveTableToDatabaseRequest.php deleted file mode 100644 index 71b9a52f0b3..00000000000 --- a/DataprocMetastore/src/V1alpha/MoveTableToDatabaseRequest.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.metastore.v1alpha.MoveTableToDatabaseRequest - */ -class MoveTableToDatabaseRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $table_name = ''; - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $db_name = ''; - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $destination_db_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $table_name - * Required. The name of the table to be moved. - * @type string $db_name - * Required. The name of the database where the table resides. - * @type string $destination_db_name - * Required. The name of the database where the table should be moved. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTableName() - { - return $this->table_name; - } - - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTableName($var) - { - GPBUtil::checkString($var, True); - $this->table_name = $var; - - return $this; - } - - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDbName() - { - return $this->db_name; - } - - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDbName($var) - { - GPBUtil::checkString($var, True); - $this->db_name = $var; - - return $this; - } - - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDestinationDbName() - { - return $this->destination_db_name; - } - - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDestinationDbName($var) - { - GPBUtil::checkString($var, True); - $this->destination_db_name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/MoveTableToDatabaseResponse.php b/DataprocMetastore/src/V1alpha/MoveTableToDatabaseResponse.php deleted file mode 100644 index de287eda072..00000000000 --- a/DataprocMetastore/src/V1alpha/MoveTableToDatabaseResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.metastore.v1alpha.MoveTableToDatabaseResponse - */ -class MoveTableToDatabaseResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/NetworkConfig.php b/DataprocMetastore/src/V1alpha/NetworkConfig.php deleted file mode 100644 index 8273ed5a275..00000000000 --- a/DataprocMetastore/src/V1alpha/NetworkConfig.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.metastore.v1alpha.NetworkConfig - */ -class NetworkConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $consumers; - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - */ - private $custom_routes_enabled = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1alpha\NetworkConfig\Consumer>|\Google\Protobuf\Internal\RepeatedField $consumers - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * @type bool $custom_routes_enabled - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConsumers() - { - return $this->consumers; - } - - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1alpha.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param array<\Google\Cloud\Metastore\V1alpha\NetworkConfig\Consumer>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConsumers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1alpha\NetworkConfig\Consumer::class); - $this->consumers = $arr; - - return $this; - } - - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - * @return bool - */ - public function getCustomRoutesEnabled() - { - return $this->custom_routes_enabled; - } - - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - * @param bool $var - * @return $this - */ - public function setCustomRoutesEnabled($var) - { - GPBUtil::checkBool($var); - $this->custom_routes_enabled = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/NetworkConfig/Consumer.php b/DataprocMetastore/src/V1alpha/NetworkConfig/Consumer.php deleted file mode 100644 index 5a9ecbaa8d4..00000000000 --- a/DataprocMetastore/src/V1alpha/NetworkConfig/Consumer.php +++ /dev/null @@ -1,173 +0,0 @@ -google.cloud.metastore.v1alpha.NetworkConfig.Consumer - */ -class Consumer extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $endpoint_location = ''; - protected $vpc_resource; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subnetwork - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * @type string $endpoint_uri - * Output only. The URI of the endpoint used to access the metastore - * service. - * @type string $endpoint_location - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * - * Generated from protobuf field string subnetwork = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @return string - */ - public function getSubnetwork() - { - return $this->readOneof(1); - } - - public function hasSubnetwork() - { - return $this->hasOneof(1); - } - - /** - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * - * Generated from protobuf field string subnetwork = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubnetwork($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getEndpointLocation() - { - return $this->endpoint_location; - } - - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setEndpointLocation($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_location = $var; - - return $this; - } - - /** - * @return string - */ - public function getVpcResource() - { - return $this->whichOneof("vpc_resource"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Consumer::class, \Google\Cloud\Metastore\V1alpha\NetworkConfig_Consumer::class); - diff --git a/DataprocMetastore/src/V1alpha/NetworkConfig_Consumer.php b/DataprocMetastore/src/V1alpha/NetworkConfig_Consumer.php deleted file mode 100644 index 68e992af58b..00000000000 --- a/DataprocMetastore/src/V1alpha/NetworkConfig_Consumer.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $status_message = ''; - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/QueryMetadataRequest.php b/DataprocMetastore/src/V1alpha/QueryMetadataRequest.php deleted file mode 100644 index 11ed978485e..00000000000 --- a/DataprocMetastore/src/V1alpha/QueryMetadataRequest.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.metastore.v1alpha.QueryMetadataRequest - */ -class QueryMetadataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $query = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $query - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/QueryMetadataResponse.php b/DataprocMetastore/src/V1alpha/QueryMetadataResponse.php deleted file mode 100644 index 0b7fd913f3d..00000000000 --- a/DataprocMetastore/src/V1alpha/QueryMetadataResponse.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.metastore.v1alpha.QueryMetadataResponse - */ -class QueryMetadataResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - */ - private $result_manifest_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $result_manifest_uri - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - * @return string - */ - public function getResultManifestUri() - { - return $this->result_manifest_uri; - } - - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - * @param string $var - * @return $this - */ - public function setResultManifestUri($var) - { - GPBUtil::checkString($var, True); - $this->result_manifest_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/RemoveIamPolicyRequest.php b/DataprocMetastore/src/V1alpha/RemoveIamPolicyRequest.php deleted file mode 100644 index b641adc2978..00000000000 --- a/DataprocMetastore/src/V1alpha/RemoveIamPolicyRequest.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.metastore.v1alpha.RemoveIamPolicyRequest - */ -class RemoveIamPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $resource = ''; - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $asynchronous = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * @type bool $asynchronous - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAsynchronous() - { - return $this->asynchronous; - } - - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAsynchronous($var) - { - GPBUtil::checkBool($var); - $this->asynchronous = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/RemoveIamPolicyResponse.php b/DataprocMetastore/src/V1alpha/RemoveIamPolicyResponse.php deleted file mode 100644 index a523f596655..00000000000 --- a/DataprocMetastore/src/V1alpha/RemoveIamPolicyResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.metastore.v1alpha.RemoveIamPolicyResponse - */ -class RemoveIamPolicyResponse extends \Google\Protobuf\Internal\Message -{ - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - */ - private $success = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $success - * True if the policy is successfully removed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - * @return bool - */ - public function getSuccess() - { - return $this->success; - } - - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - * @param bool $var - * @return $this - */ - public function setSuccess($var) - { - GPBUtil::checkBool($var); - $this->success = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Restore.php b/DataprocMetastore/src/V1alpha/Restore.php deleted file mode 100644 index bc8db5447df..00000000000 --- a/DataprocMetastore/src/V1alpha/Restore.php +++ /dev/null @@ -1,269 +0,0 @@ -google.cloud.metastore.v1alpha.Restore - */ -class Restore extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_time = null; - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $backup = ''; - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $type = 0; - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $details = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Output only. The time when the restore started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the restore ended. - * @type int $state - * Output only. The current state of the restore. - * @type string $backup - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type int $type - * Output only. The type of restore. - * @type string $details - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Restore\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getBackup() - { - return $this->backup; - } - - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkString($var, True); - $this->backup = $var; - - return $this; - } - - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Restore\RestoreType::class); - $this->type = $var; - - return $this; - } - - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDetails() - { - return $this->details; - } - - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDetails($var) - { - GPBUtil::checkString($var, True); - $this->details = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Restore/RestoreType.php b/DataprocMetastore/src/V1alpha/Restore/RestoreType.php deleted file mode 100644 index ac00e6c12f0..00000000000 --- a/DataprocMetastore/src/V1alpha/Restore/RestoreType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1alpha.Restore.RestoreType - */ -class RestoreType -{ - /** - * The restore type is unknown. - * - * Generated from protobuf enum RESTORE_TYPE_UNSPECIFIED = 0; - */ - const RESTORE_TYPE_UNSPECIFIED = 0; - /** - * The service's metadata and configuration are restored. - * - * Generated from protobuf enum FULL = 1; - */ - const FULL = 1; - /** - * Only the service's metadata is restored. - * - * Generated from protobuf enum METADATA_ONLY = 2; - */ - const METADATA_ONLY = 2; - - private static $valueToName = [ - self::RESTORE_TYPE_UNSPECIFIED => 'RESTORE_TYPE_UNSPECIFIED', - self::FULL => 'FULL', - self::METADATA_ONLY => 'METADATA_ONLY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RestoreType::class, \Google\Cloud\Metastore\V1alpha\Restore_RestoreType::class); - diff --git a/DataprocMetastore/src/V1alpha/Restore/State.php b/DataprocMetastore/src/V1alpha/Restore/State.php deleted file mode 100644 index f5225dc2cc6..00000000000 --- a/DataprocMetastore/src/V1alpha/Restore/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.metastore.v1alpha.Restore.State - */ -class State -{ - /** - * The state of the metadata restore is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata restore is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata restore completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata restore failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The metadata restore is cancelled. - * - * Generated from protobuf enum CANCELLED = 4; - */ - const CANCELLED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\Restore_State::class); - diff --git a/DataprocMetastore/src/V1alpha/RestoreServiceRequest.php b/DataprocMetastore/src/V1alpha/RestoreServiceRequest.php deleted file mode 100644 index fc6247c733e..00000000000 --- a/DataprocMetastore/src/V1alpha/RestoreServiceRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.metastore.v1alpha.RestoreServiceRequest - */ -class RestoreServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $backup = ''; - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $restore_type = 0; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $backup - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type int $restore_type - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getBackup() - { - return $this->backup; - } - - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkString($var, True); - $this->backup = $var; - - return $this; - } - - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getRestoreType() - { - return $this->restore_type; - } - - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setRestoreType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Restore\RestoreType::class); - $this->restore_type = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Restore_RestoreType.php b/DataprocMetastore/src/V1alpha/Restore_RestoreType.php deleted file mode 100644 index 8774d40fa47..00000000000 --- a/DataprocMetastore/src/V1alpha/Restore_RestoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.ScalingConfig - */ -class ScalingConfig extends \Google\Protobuf\Internal\Message -{ - protected $scaling_model; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $instance_size - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * @type float $scaling_factor - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.ScalingConfig.InstanceSize instance_size = 1; - * @return int - */ - public function getInstanceSize() - { - return $this->readOneof(1); - } - - public function hasInstanceSize() - { - return $this->hasOneof(1); - } - - /** - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.ScalingConfig.InstanceSize instance_size = 1; - * @param int $var - * @return $this - */ - public function setInstanceSize($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\ScalingConfig\InstanceSize::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * - * Generated from protobuf field float scaling_factor = 2; - * @return float - */ - public function getScalingFactor() - { - return $this->readOneof(2); - } - - public function hasScalingFactor() - { - return $this->hasOneof(2); - } - - /** - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * - * Generated from protobuf field float scaling_factor = 2; - * @param float $var - * @return $this - */ - public function setScalingFactor($var) - { - GPBUtil::checkFloat($var); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getScalingModel() - { - return $this->whichOneof("scaling_model"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/ScalingConfig/InstanceSize.php b/DataprocMetastore/src/V1alpha/ScalingConfig/InstanceSize.php deleted file mode 100644 index 1b7ccfc5dfe..00000000000 --- a/DataprocMetastore/src/V1alpha/ScalingConfig/InstanceSize.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.metastore.v1alpha.ScalingConfig.InstanceSize - */ -class InstanceSize -{ - /** - * Unspecified instance size - * - * Generated from protobuf enum INSTANCE_SIZE_UNSPECIFIED = 0; - */ - const INSTANCE_SIZE_UNSPECIFIED = 0; - /** - * Extra small instance size, maps to a scaling factor of 0.1. - * - * Generated from protobuf enum EXTRA_SMALL = 1; - */ - const EXTRA_SMALL = 1; - /** - * Small instance size, maps to a scaling factor of 0.5. - * - * Generated from protobuf enum SMALL = 2; - */ - const SMALL = 2; - /** - * Medium instance size, maps to a scaling factor of 1.0. - * - * Generated from protobuf enum MEDIUM = 3; - */ - const MEDIUM = 3; - /** - * Large instance size, maps to a scaling factor of 3.0. - * - * Generated from protobuf enum LARGE = 4; - */ - const LARGE = 4; - /** - * Extra large instance size, maps to a scaling factor of 6.0. - * - * Generated from protobuf enum EXTRA_LARGE = 5; - */ - const EXTRA_LARGE = 5; - - private static $valueToName = [ - self::INSTANCE_SIZE_UNSPECIFIED => 'INSTANCE_SIZE_UNSPECIFIED', - self::EXTRA_SMALL => 'EXTRA_SMALL', - self::SMALL => 'SMALL', - self::MEDIUM => 'MEDIUM', - self::LARGE => 'LARGE', - self::EXTRA_LARGE => 'EXTRA_LARGE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InstanceSize::class, \Google\Cloud\Metastore\V1alpha\ScalingConfig_InstanceSize::class); - diff --git a/DataprocMetastore/src/V1alpha/ScalingConfig_InstanceSize.php b/DataprocMetastore/src/V1alpha/ScalingConfig_InstanceSize.php deleted file mode 100644 index 86bcc8b924f..00000000000 --- a/DataprocMetastore/src/V1alpha/ScalingConfig_InstanceSize.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.Secret - */ -class Secret extends \Google\Protobuf\Internal\Message -{ - protected $value; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $cloud_secret - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * - * Generated from protobuf field string cloud_secret = 2; - * @return string - */ - public function getCloudSecret() - { - return $this->readOneof(2); - } - - public function hasCloudSecret() - { - return $this->hasOneof(2); - } - - /** - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * - * Generated from protobuf field string cloud_secret = 2; - * @param string $var - * @return $this - */ - public function setCloudSecret($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getValue() - { - return $this->whichOneof("value"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Service.php b/DataprocMetastore/src/V1alpha/Service.php deleted file mode 100644 index f5fc3e4e1d7..00000000000 --- a/DataprocMetastore/src/V1alpha/Service.php +++ /dev/null @@ -1,942 +0,0 @@ -google.cloud.metastore.v1alpha.Service - */ -class Service extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - */ - private $network = ''; - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - */ - private $port = 0; - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state_message = ''; - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $artifact_gcs_uri = ''; - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.Tier tier = 13; - */ - private $tier = 0; - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataIntegration metadata_integration = 14; - */ - private $metadata_integration = null; - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MaintenanceWindow maintenance_window = 15; - */ - private $maintenance_window = null; - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $uid = ''; - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $metadata_management_activity = null; - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $release_channel = 0; - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $encryption_config = null; - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 21; - */ - private $network_config = null; - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $database_type = 0; - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig telemetry_config = 23; - */ - private $telemetry_config = null; - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.ScalingConfig scaling_config = 24; - */ - private $scaling_config = null; - protected $metastore_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig $hive_metastore_config - * Configuration information specific to running Hive metastore - * software as the metastore service. - * @type string $name - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metastore service was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metastore service was last updated. - * @type array|\Google\Protobuf\Internal\MapField $labels - * User-defined labels for the metastore service. - * @type string $network - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * @type string $endpoint_uri - * Output only. The URI of the endpoint used to access the metastore service. - * @type int $port - * The TCP port at which the metastore service is reached. Default: 9083. - * @type int $state - * Output only. The current state of the metastore service. - * @type string $state_message - * Output only. Additional information about the current state of the - * metastore service, if available. - * @type string $artifact_gcs_uri - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * @type int $tier - * The tier of the service. - * @type \Google\Cloud\Metastore\V1alpha\MetadataIntegration $metadata_integration - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * @type \Google\Cloud\Metastore\V1alpha\MaintenanceWindow $maintenance_window - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * @type string $uid - * Output only. The globally unique resource identifier of the metastore - * service. - * @type \Google\Cloud\Metastore\V1alpha\MetadataManagementActivity $metadata_management_activity - * Output only. The metadata management activities of the metastore service. - * @type int $release_channel - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * @type \Google\Cloud\Metastore\V1alpha\EncryptionConfig $encryption_config - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * @type \Google\Cloud\Metastore\V1alpha\NetworkConfig $network_config - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * @type int $database_type - * Immutable. The database type that the Metastore service stores its data. - * @type \Google\Cloud\Metastore\V1alpha\TelemetryConfig $telemetry_config - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * @type \Google\Cloud\Metastore\V1alpha\ScalingConfig $scaling_config - * Scaling configuration of the metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Configuration information specific to running Hive metastore - * software as the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig hive_metastore_config = 5; - * @return \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig|null - */ - public function getHiveMetastoreConfig() - { - return $this->readOneof(5); - } - - public function hasHiveMetastoreConfig() - { - return $this->hasOneof(5); - } - - /** - * Configuration information specific to running Hive metastore - * software as the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.HiveMetastoreConfig hive_metastore_config = 5; - * @param \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig $var - * @return $this - */ - public function setHiveMetastoreConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\HiveMetastoreConfig::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Service\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getArtifactGcsUri() - { - return $this->artifact_gcs_uri; - } - - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setArtifactGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->artifact_gcs_uri = $var; - - return $this; - } - - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.Tier tier = 13; - * @return int - */ - public function getTier() - { - return $this->tier; - } - - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.Tier tier = 13; - * @param int $var - * @return $this - */ - public function setTier($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Service\Tier::class); - $this->tier = $var; - - return $this; - } - - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataIntegration metadata_integration = 14; - * @return \Google\Cloud\Metastore\V1alpha\MetadataIntegration|null - */ - public function getMetadataIntegration() - { - return $this->metadata_integration; - } - - public function hasMetadataIntegration() - { - return isset($this->metadata_integration); - } - - public function clearMetadataIntegration() - { - unset($this->metadata_integration); - } - - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataIntegration metadata_integration = 14; - * @param \Google\Cloud\Metastore\V1alpha\MetadataIntegration $var - * @return $this - */ - public function setMetadataIntegration($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MetadataIntegration::class); - $this->metadata_integration = $var; - - return $this; - } - - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MaintenanceWindow maintenance_window = 15; - * @return \Google\Cloud\Metastore\V1alpha\MaintenanceWindow|null - */ - public function getMaintenanceWindow() - { - return $this->maintenance_window; - } - - public function hasMaintenanceWindow() - { - return isset($this->maintenance_window); - } - - public function clearMaintenanceWindow() - { - unset($this->maintenance_window); - } - - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MaintenanceWindow maintenance_window = 15; - * @param \Google\Cloud\Metastore\V1alpha\MaintenanceWindow $var - * @return $this - */ - public function setMaintenanceWindow($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MaintenanceWindow::class); - $this->maintenance_window = $var; - - return $this; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1alpha\MetadataManagementActivity|null - */ - public function getMetadataManagementActivity() - { - return $this->metadata_management_activity; - } - - public function hasMetadataManagementActivity() - { - return isset($this->metadata_management_activity); - } - - public function clearMetadataManagementActivity() - { - unset($this->metadata_management_activity); - } - - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1alpha\MetadataManagementActivity $var - * @return $this - */ - public function setMetadataManagementActivity($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MetadataManagementActivity::class); - $this->metadata_management_activity = $var; - - return $this; - } - - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getReleaseChannel() - { - return $this->release_channel; - } - - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setReleaseChannel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Service\ReleaseChannel::class); - $this->release_channel = $var; - - return $this; - } - - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\Metastore\V1alpha\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\Metastore\V1alpha\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 21; - * @return \Google\Cloud\Metastore\V1alpha\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.NetworkConfig network_config = 21; - * @param \Google\Cloud\Metastore\V1alpha\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getDatabaseType() - { - return $this->database_type; - } - - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setDatabaseType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\Service\DatabaseType::class); - $this->database_type = $var; - - return $this; - } - - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig telemetry_config = 23; - * @return \Google\Cloud\Metastore\V1alpha\TelemetryConfig|null - */ - public function getTelemetryConfig() - { - return $this->telemetry_config; - } - - public function hasTelemetryConfig() - { - return isset($this->telemetry_config); - } - - public function clearTelemetryConfig() - { - unset($this->telemetry_config); - } - - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig telemetry_config = 23; - * @param \Google\Cloud\Metastore\V1alpha\TelemetryConfig $var - * @return $this - */ - public function setTelemetryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\TelemetryConfig::class); - $this->telemetry_config = $var; - - return $this; - } - - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.ScalingConfig scaling_config = 24; - * @return \Google\Cloud\Metastore\V1alpha\ScalingConfig|null - */ - public function getScalingConfig() - { - return $this->scaling_config; - } - - public function hasScalingConfig() - { - return isset($this->scaling_config); - } - - public function clearScalingConfig() - { - unset($this->scaling_config); - } - - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.ScalingConfig scaling_config = 24; - * @param \Google\Cloud\Metastore\V1alpha\ScalingConfig $var - * @return $this - */ - public function setScalingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\ScalingConfig::class); - $this->scaling_config = $var; - - return $this; - } - - /** - * @return string - */ - public function getMetastoreConfig() - { - return $this->whichOneof("metastore_config"); - } - -} - diff --git a/DataprocMetastore/src/V1alpha/Service/DatabaseType.php b/DataprocMetastore/src/V1alpha/Service/DatabaseType.php deleted file mode 100644 index af3d2b8bc59..00000000000 --- a/DataprocMetastore/src/V1alpha/Service/DatabaseType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1alpha.Service.DatabaseType - */ -class DatabaseType -{ - /** - * The DATABASE_TYPE is not set. - * - * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; - */ - const DATABASE_TYPE_UNSPECIFIED = 0; - /** - * MySQL is used to persist the metastore data. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - /** - * Spanner is used to persist the metastore data. - * - * Generated from protobuf enum SPANNER = 2; - */ - const SPANNER = 2; - - private static $valueToName = [ - self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - self::SPANNER => 'SPANNER', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1alpha\Service_DatabaseType::class); - diff --git a/DataprocMetastore/src/V1alpha/Service/ReleaseChannel.php b/DataprocMetastore/src/V1alpha/Service/ReleaseChannel.php deleted file mode 100644 index 5bc9f8664ad..00000000000 --- a/DataprocMetastore/src/V1alpha/Service/ReleaseChannel.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.metastore.v1alpha.Service.ReleaseChannel - */ -class ReleaseChannel -{ - /** - * Release channel is not specified. - * - * Generated from protobuf enum RELEASE_CHANNEL_UNSPECIFIED = 0; - */ - const RELEASE_CHANNEL_UNSPECIFIED = 0; - /** - * The `CANARY` release channel contains the newest features, which may be - * unstable and subject to unresolved issues with no known workarounds. - * Services using the `CANARY` release channel are not subject to any SLAs. - * - * Generated from protobuf enum CANARY = 1; - */ - const CANARY = 1; - /** - * The `STABLE` release channel contains features that are considered stable - * and have been validated for production use. - * - * Generated from protobuf enum STABLE = 2; - */ - const STABLE = 2; - - private static $valueToName = [ - self::RELEASE_CHANNEL_UNSPECIFIED => 'RELEASE_CHANNEL_UNSPECIFIED', - self::CANARY => 'CANARY', - self::STABLE => 'STABLE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReleaseChannel::class, \Google\Cloud\Metastore\V1alpha\Service_ReleaseChannel::class); - diff --git a/DataprocMetastore/src/V1alpha/Service/State.php b/DataprocMetastore/src/V1alpha/Service/State.php deleted file mode 100644 index ccf6ccae3a0..00000000000 --- a/DataprocMetastore/src/V1alpha/Service/State.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.metastore.v1alpha.Service.State - */ -class State -{ - /** - * The state of the metastore service is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metastore service is in the process of being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The metastore service is running and ready to serve queries. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The metastore service is entering suspension. Its query-serving - * availability may cease unexpectedly. - * - * Generated from protobuf enum SUSPENDING = 3; - */ - const SUSPENDING = 3; - /** - * The metastore service is suspended and unable to serve queries. - * - * Generated from protobuf enum SUSPENDED = 4; - */ - const SUSPENDED = 4; - /** - * The metastore service is being updated. It remains usable but cannot - * accept additional update requests or be deleted at this time. - * - * Generated from protobuf enum UPDATING = 5; - */ - const UPDATING = 5; - /** - * The metastore service is undergoing deletion. It cannot be used. - * - * Generated from protobuf enum DELETING = 6; - */ - const DELETING = 6; - /** - * The metastore service has encountered an error and cannot be used. The - * metastore service should be deleted. - * - * Generated from protobuf enum ERROR = 7; - */ - const ERROR = 7; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::SUSPENDING => 'SUSPENDING', - self::SUSPENDED => 'SUSPENDED', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - self::ERROR => 'ERROR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1alpha\Service_State::class); - diff --git a/DataprocMetastore/src/V1alpha/Service/Tier.php b/DataprocMetastore/src/V1alpha/Service/Tier.php deleted file mode 100644 index 83e8f852b49..00000000000 --- a/DataprocMetastore/src/V1alpha/Service/Tier.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.metastore.v1alpha.Service.Tier - */ -class Tier -{ - /** - * The tier is not set. - * - * Generated from protobuf enum TIER_UNSPECIFIED = 0; - */ - const TIER_UNSPECIFIED = 0; - /** - * The developer tier provides limited scalability and no fault tolerance. - * Good for low-cost proof-of-concept. - * - * Generated from protobuf enum DEVELOPER = 1; - */ - const DEVELOPER = 1; - /** - * The enterprise tier provides multi-zone high availability, and sufficient - * scalability for enterprise-level Dataproc Metastore workloads. - * - * Generated from protobuf enum ENTERPRISE = 3; - */ - const ENTERPRISE = 3; - - private static $valueToName = [ - self::TIER_UNSPECIFIED => 'TIER_UNSPECIFIED', - self::DEVELOPER => 'DEVELOPER', - self::ENTERPRISE => 'ENTERPRISE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Tier::class, \Google\Cloud\Metastore\V1alpha\Service_Tier::class); - diff --git a/DataprocMetastore/src/V1alpha/Service_DatabaseType.php b/DataprocMetastore/src/V1alpha/Service_DatabaseType.php deleted file mode 100644 index 6abe29c080d..00000000000 --- a/DataprocMetastore/src/V1alpha/Service_DatabaseType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.TelemetryConfig - */ -class TelemetryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig.LogFormat log_format = 1; - */ - private $log_format = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $log_format - * The output format of the Dataproc Metastore service's logs. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig.LogFormat log_format = 1; - * @return int - */ - public function getLogFormat() - { - return $this->log_format; - } - - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.TelemetryConfig.LogFormat log_format = 1; - * @param int $var - * @return $this - */ - public function setLogFormat($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1alpha\TelemetryConfig\LogFormat::class); - $this->log_format = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/TelemetryConfig/LogFormat.php b/DataprocMetastore/src/V1alpha/TelemetryConfig/LogFormat.php deleted file mode 100644 index e1ea20ce4cc..00000000000 --- a/DataprocMetastore/src/V1alpha/TelemetryConfig/LogFormat.php +++ /dev/null @@ -1,62 +0,0 @@ -google.cloud.metastore.v1alpha.TelemetryConfig.LogFormat - */ -class LogFormat -{ - /** - * The LOG_FORMAT is not set. - * - * Generated from protobuf enum LOG_FORMAT_UNSPECIFIED = 0; - */ - const LOG_FORMAT_UNSPECIFIED = 0; - /** - * Logging output uses the legacy `textPayload` format. - * - * Generated from protobuf enum LEGACY = 1; - */ - const LEGACY = 1; - /** - * Logging output uses the `jsonPayload` format. - * - * Generated from protobuf enum JSON = 2; - */ - const JSON = 2; - - private static $valueToName = [ - self::LOG_FORMAT_UNSPECIFIED => 'LOG_FORMAT_UNSPECIFIED', - self::LEGACY => 'LEGACY', - self::JSON => 'JSON', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LogFormat::class, \Google\Cloud\Metastore\V1alpha\TelemetryConfig_LogFormat::class); - diff --git a/DataprocMetastore/src/V1alpha/TelemetryConfig_LogFormat.php b/DataprocMetastore/src/V1alpha/TelemetryConfig_LogFormat.php deleted file mode 100644 index 0dae8f5193c..00000000000 --- a/DataprocMetastore/src/V1alpha/TelemetryConfig_LogFormat.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1alpha.UpdateFederationRequest - */ -class UpdateFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1alpha\Federation $federation - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\Federation|null - */ - public function getFederation() - { - return $this->federation; - } - - public function hasFederation() - { - return isset($this->federation); - } - - public function clearFederation() - { - unset($this->federation); - } - - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\Federation $var - * @return $this - */ - public function setFederation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Federation::class); - $this->federation = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/UpdateMetadataImportRequest.php b/DataprocMetastore/src/V1alpha/UpdateMetadataImportRequest.php deleted file mode 100644 index 79a863ac58e..00000000000 --- a/DataprocMetastore/src/V1alpha/UpdateMetadataImportRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.metastore.v1alpha.UpdateMetadataImportRequest - */ -class UpdateMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1alpha\MetadataImport $metadata_import - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\MetadataImport|null - */ - public function getMetadataImport() - { - return $this->metadata_import; - } - - public function hasMetadataImport() - { - return isset($this->metadata_import); - } - - public function clearMetadataImport() - { - unset($this->metadata_import); - } - - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\MetadataImport $var - * @return $this - */ - public function setMetadataImport($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\MetadataImport::class); - $this->metadata_import = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/UpdateServiceRequest.php b/DataprocMetastore/src/V1alpha/UpdateServiceRequest.php deleted file mode 100644 index 7d81f4d579d..00000000000 --- a/DataprocMetastore/src/V1alpha/UpdateServiceRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.metastore.v1alpha.UpdateServiceRequest - */ -class UpdateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1alpha\Service $service - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Alpha\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1alpha\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1alpha.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1alpha\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1alpha\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1alpha/gapic_metadata.json b/DataprocMetastore/src/V1alpha/gapic_metadata.json deleted file mode 100644 index 1276f9994a1..00000000000 --- a/DataprocMetastore/src/V1alpha/gapic_metadata.json +++ /dev/null @@ -1,197 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.metastore.v1alpha", - "libraryPackage": "Google\\Cloud\\Metastore\\V1alpha", - "services": { - "DataprocMetastore": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreGapicClient", - "rpcs": { - "AlterMetadataResourceLocation": { - "methods": [ - "alterMetadataResourceLocation" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "CreateMetadataImport": { - "methods": [ - "createMetadataImport" - ] - }, - "CreateService": { - "methods": [ - "createService" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "DeleteService": { - "methods": [ - "deleteService" - ] - }, - "ExportMetadata": { - "methods": [ - "exportMetadata" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GetMetadataImport": { - "methods": [ - "getMetadataImport" - ] - }, - "GetService": { - "methods": [ - "getService" - ] - }, - "ListBackups": { - "methods": [ - "listBackups" - ] - }, - "ListMetadataImports": { - "methods": [ - "listMetadataImports" - ] - }, - "ListServices": { - "methods": [ - "listServices" - ] - }, - "MoveTableToDatabase": { - "methods": [ - "moveTableToDatabase" - ] - }, - "QueryMetadata": { - "methods": [ - "queryMetadata" - ] - }, - "RemoveIamPolicy": { - "methods": [ - "removeIamPolicy" - ] - }, - "RestoreService": { - "methods": [ - "restoreService" - ] - }, - "UpdateMetadataImport": { - "methods": [ - "updateMetadataImport" - ] - }, - "UpdateService": { - "methods": [ - "updateService" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - }, - "DataprocMetastoreFederation": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreFederationGapicClient", - "rpcs": { - "CreateFederation": { - "methods": [ - "createFederation" - ] - }, - "DeleteFederation": { - "methods": [ - "deleteFederation" - ] - }, - "GetFederation": { - "methods": [ - "getFederation" - ] - }, - "ListFederations": { - "methods": [ - "listFederations" - ] - }, - "UpdateFederation": { - "methods": [ - "updateFederation" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_client_config.json b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_client_config.json deleted file mode 100644 index 2355e4bd352..00000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_client_config.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "interfaces": { - "google.cloud.metastore.v1alpha.DataprocMetastore": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "AlterMetadataResourceLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ExportMetadata": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetBackup": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetService": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListMetadataImports": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListServices": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "MoveTableToDatabase": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "QueryMetadata": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RemoveIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RestoreService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_descriptor_config.php b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_descriptor_config.php deleted file mode 100644 index 6bb0b1c9e93..00000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_descriptor_config.php +++ /dev/null @@ -1,201 +0,0 @@ - [ - 'google.cloud.metastore.v1alpha.DataprocMetastore' => [ - 'AlterMetadataResourceLocation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\AlterMetadataResourceLocationResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Backup', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateMetadataImport' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\MetadataImport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Service', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ExportMetadata' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\MetadataExport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'MoveTableToDatabase' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\MoveTableToDatabaseResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'QueryMetadata' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\QueryMetadataResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RestoreService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Restore', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateMetadataImport' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\MetadataImport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Service', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListBackups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackups', - ], - ], - 'ListMetadataImports' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMetadataImports', - ], - ], - 'ListServices' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServices', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - ], - ], -]; diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_client_config.json b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_client_config.json deleted file mode 100644 index 360aa62b94f..00000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_client_config.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "interfaces": { - "google.cloud.metastore.v1alpha.DataprocMetastoreFederation": { - "retry_codes": { - "no_retry_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - } - }, - "methods": { - "CreateFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListFederations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_descriptor_config.php b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_descriptor_config.php deleted file mode 100644 index 11f1cbce258..00000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_descriptor_config.php +++ /dev/null @@ -1,91 +0,0 @@ - [ - 'google.cloud.metastore.v1alpha.DataprocMetastoreFederation' => [ - 'CreateFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Federation', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1alpha\Federation', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1alpha\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListFederations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFederations', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - ], - ], -]; diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_rest_client_config.php b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_rest_client_config.php deleted file mode 100644 index 6265cadd23a..00000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_federation_rest_client_config.php +++ /dev/null @@ -1,263 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.metastore.v1alpha.DataprocMetastoreFederation' => [ - 'CreateFederation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/federations', - 'body' => 'federation', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'federation_id', - ], - ], - 'DeleteFederation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/federations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetFederation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/federations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListFederations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/federations', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateFederation' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1alpha/{federation.name=projects/*/locations/*/federations/*}', - 'body' => 'federation', - 'placeholders' => [ - 'federation.name' => [ - 'getters' => [ - 'getFederation', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_rest_client_config.php b/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_rest_client_config.php deleted file mode 100644 index cc57a96689a..00000000000 --- a/DataprocMetastore/src/V1alpha/resources/dataproc_metastore_rest_client_config.php +++ /dev/null @@ -1,436 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.metastore.v1alpha.DataprocMetastore' => [ - 'AlterMetadataResourceLocation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{service=projects/*/locations/*/services/*}:alterLocation', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'CreateBackup' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/services/*}/backups', - 'body' => 'backup', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'backup_id', - ], - ], - 'CreateMetadataImport' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/services/*}/metadataImports', - 'body' => 'metadata_import', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'metadata_import_id', - ], - ], - 'CreateService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/services', - 'body' => 'service', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'service_id', - ], - ], - 'DeleteBackup' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/services/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteService' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ExportMetadata' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{service=projects/*/locations/*/services/*}:exportMetadata', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'GetBackup' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/services/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetMetadataImport' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/services/*/metadataImports/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetService' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListBackups' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/services/*}/backups', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListMetadataImports' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/services/*}/metadataImports', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListServices' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/services', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'MoveTableToDatabase' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{service=projects/*/locations/*/services/*}:moveTableToDatabase', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'QueryMetadata' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{service=projects/*/locations/*/services/*}:queryMetadata', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'RemoveIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/**}:removeIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'RestoreService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{service=projects/*/locations/*/services/*}:restore', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'UpdateMetadataImport' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1alpha/{metadata_import.name=projects/*/locations/*/services/*/metadataImports/*}', - 'body' => 'metadata_import', - 'placeholders' => [ - 'metadata_import.name' => [ - 'getters' => [ - 'getMetadataImport', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateService' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1alpha/{service.name=projects/*/locations/*/services/*}', - 'body' => 'service', - 'placeholders' => [ - 'service.name' => [ - 'getters' => [ - 'getService', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/backups/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{resource=projects/*/locations/*/federations/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationRequest.php b/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationRequest.php deleted file mode 100644 index e341494d760..00000000000 --- a/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationRequest.php +++ /dev/null @@ -1,164 +0,0 @@ -google.cloud.metastore.v1beta.AlterMetadataResourceLocationRequest - */ -class AlterMetadataResourceLocationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $resource_name = ''; - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $location_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $resource_name - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * @type string $location_uri - * Required. The new location URI for the metadata resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getResourceName() - { - return $this->resource_name; - } - - /** - * Required. The relative metadata resource name in the following format. - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * - * Generated from protobuf field string resource_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setResourceName($var) - { - GPBUtil::checkString($var, True); - $this->resource_name = $var; - - return $this; - } - - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLocationUri() - { - return $this->location_uri; - } - - /** - * Required. The new location URI for the metadata resource. - * - * Generated from protobuf field string location_uri = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLocationUri($var) - { - GPBUtil::checkString($var, True); - $this->location_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationResponse.php b/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationResponse.php deleted file mode 100644 index 03eec5061de..00000000000 --- a/DataprocMetastore/src/V1beta/AlterMetadataResourceLocationResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.metastore.v1beta.AlterMetadataResourceLocationResponse - */ -class AlterMetadataResourceLocationResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1beta/AuxiliaryVersionConfig.php b/DataprocMetastore/src/V1beta/AuxiliaryVersionConfig.php deleted file mode 100644 index 10820cee527..00000000000 --- a/DataprocMetastore/src/V1beta/AuxiliaryVersionConfig.php +++ /dev/null @@ -1,169 +0,0 @@ -google.cloud.metastore.v1beta.AuxiliaryVersionConfig - */ -class AuxiliaryVersionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - */ - private $version = ''; - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - */ - private $config_overrides; - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $network_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * @type array|\Google\Protobuf\Internal\MapField $config_overrides - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * @type \Google\Cloud\Metastore\V1beta\NetworkConfig $network_config - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The Hive metastore version of the auxiliary service. It must be less - * than the primary Hive metastore service's version. - * - * Generated from protobuf field string version = 1; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getConfigOverrides() - { - return $this->config_overrides; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * auxiliary Hive metastore (configured in `hive-site.xml`) in addition to - * the primary version's overrides. If keys are present in both the auxiliary - * version's overrides and the primary version's overrides, the value from - * the auxiliary version's overrides takes precedence. - * - * Generated from protobuf field map config_overrides = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setConfigOverrides($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->config_overrides = $arr; - - return $this; - } - - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1beta\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * Output only. The network configuration contains the endpoint URI(s) of the - * auxiliary Hive metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1beta\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/BackendMetastore.php b/DataprocMetastore/src/V1beta/BackendMetastore.php deleted file mode 100644 index 52d4d6a684b..00000000000 --- a/DataprocMetastore/src/V1beta/BackendMetastore.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.metastore.v1beta.BackendMetastore - */ -class BackendMetastore extends \Google\Protobuf\Internal\Message -{ - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.BackendMetastore.MetastoreType metastore_type = 2; - */ - private $metastore_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * @type int $metastore_type - * The type of the backend metastore. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The relative resource name of the metastore that is being federated. - * The formats of the relative resource names for the currently supported - * metastores are listed below: - * * BigQuery - * * `projects/{project_id}` - * * Dataproc Metastore - * * `projects/{project_id}/locations/{location}/services/{service_id}` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.BackendMetastore.MetastoreType metastore_type = 2; - * @return int - */ - public function getMetastoreType() - { - return $this->metastore_type; - } - - /** - * The type of the backend metastore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.BackendMetastore.MetastoreType metastore_type = 2; - * @param int $var - * @return $this - */ - public function setMetastoreType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\BackendMetastore\MetastoreType::class); - $this->metastore_type = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/BackendMetastore/MetastoreType.php b/DataprocMetastore/src/V1beta/BackendMetastore/MetastoreType.php deleted file mode 100644 index 4f52e47ec7d..00000000000 --- a/DataprocMetastore/src/V1beta/BackendMetastore/MetastoreType.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.metastore.v1beta.BackendMetastore.MetastoreType - */ -class MetastoreType -{ - /** - * The metastore type is not set. - * - * Generated from protobuf enum METASTORE_TYPE_UNSPECIFIED = 0; - */ - const METASTORE_TYPE_UNSPECIFIED = 0; - /** - * The backend metastore is Dataplex. - * - * Generated from protobuf enum DATAPLEX = 1; - */ - const DATAPLEX = 1; - /** - * The backend metastore is BigQuery. - * - * Generated from protobuf enum BIGQUERY = 2; - */ - const BIGQUERY = 2; - /** - * The backend metastore is Dataproc Metastore. - * - * Generated from protobuf enum DATAPROC_METASTORE = 3; - */ - const DATAPROC_METASTORE = 3; - - private static $valueToName = [ - self::METASTORE_TYPE_UNSPECIFIED => 'METASTORE_TYPE_UNSPECIFIED', - self::DATAPLEX => 'DATAPLEX', - self::BIGQUERY => 'BIGQUERY', - self::DATAPROC_METASTORE => 'DATAPROC_METASTORE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MetastoreType::class, \Google\Cloud\Metastore\V1beta\BackendMetastore_MetastoreType::class); - diff --git a/DataprocMetastore/src/V1beta/BackendMetastore_MetastoreType.php b/DataprocMetastore/src/V1beta/BackendMetastore_MetastoreType.php deleted file mode 100644 index ca05921efe5..00000000000 --- a/DataprocMetastore/src/V1beta/BackendMetastore_MetastoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.Backup - */ -class Backup extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $service_revision = null; - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - */ - private $description = ''; - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $restoring_services; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the backup was started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the backup finished creating. - * @type int $state - * Output only. The current state of the backup. - * @type \Google\Cloud\Metastore\V1beta\Service $service_revision - * Output only. The revision of the service at the time of backup. - * @type string $description - * The description of the backup. - * @type array|\Google\Protobuf\Internal\RepeatedField $restoring_services - * Output only. Services that are restoring from the backup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the backup, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the backup was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the backup finished creating. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Backup\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1beta\Service|null - */ - public function getServiceRevision() - { - return $this->service_revision; - } - - public function hasServiceRevision() - { - return isset($this->service_revision); - } - - public function clearServiceRevision() - { - unset($this->service_revision); - } - - /** - * Output only. The revision of the service at the time of backup. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service_revision = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1beta\Service $var - * @return $this - */ - public function setServiceRevision($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Service::class); - $this->service_revision = $var; - - return $this; - } - - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The description of the backup. - * - * Generated from protobuf field string description = 6; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRestoringServices() - { - return $this->restoring_services; - } - - /** - * Output only. Services that are restoring from the backup. - * - * Generated from protobuf field repeated string restoring_services = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRestoringServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->restoring_services = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Backup/State.php b/DataprocMetastore/src/V1beta/Backup/State.php deleted file mode 100644 index b66b7d93284..00000000000 --- a/DataprocMetastore/src/V1beta/Backup/State.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.metastore.v1beta.Backup.State - */ -class State -{ - /** - * The state of the backup is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The backup is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The backup is being deleted. - * - * Generated from protobuf enum DELETING = 2; - */ - const DELETING = 2; - /** - * The backup is active and ready to use. - * - * Generated from protobuf enum ACTIVE = 3; - */ - const ACTIVE = 3; - /** - * The backup failed. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - /** - * The backup is being restored. - * - * Generated from protobuf enum RESTORING = 5; - */ - const RESTORING = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::ACTIVE => 'ACTIVE', - self::FAILED => 'FAILED', - self::RESTORING => 'RESTORING', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\Backup_State::class); - diff --git a/DataprocMetastore/src/V1beta/Backup_State.php b/DataprocMetastore/src/V1beta/Backup_State.php deleted file mode 100644 index 7975aac93c1..00000000000 --- a/DataprocMetastore/src/V1beta/Backup_State.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.CreateBackupRequest - */ -class CreateBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $backup_id = ''; - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $backup = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $backup_id - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @type \Google\Cloud\Metastore\V1beta\Backup $backup - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service in which to create a - * backup of the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getBackupId() - { - return $this->backup_id; - } - - /** - * Required. The ID of the backup, which is used as the final component of the - * backup's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setBackupId($var) - { - GPBUtil::checkString($var, True); - $this->backup_id = $var; - - return $this; - } - - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\Backup|null - */ - public function getBackup() - { - return $this->backup; - } - - public function hasBackup() - { - return isset($this->backup); - } - - public function clearBackup() - { - unset($this->backup); - } - - /** - * Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\Backup $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Backup::class); - $this->backup = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/CreateFederationRequest.php b/DataprocMetastore/src/V1beta/CreateFederationRequest.php deleted file mode 100644 index 2d8cda1c1bc..00000000000 --- a/DataprocMetastore/src/V1beta/CreateFederationRequest.php +++ /dev/null @@ -1,247 +0,0 @@ -google.cloud.metastore.v1beta.CreateFederationRequest - */ -class CreateFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation_id = ''; - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type string $federation_id - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @type \Google\Cloud\Metastore\V1beta\Federation $federation - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFederationId() - { - return $this->federation_id; - } - - /** - * Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string federation_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFederationId($var) - { - GPBUtil::checkString($var, True); - $this->federation_id = $var; - - return $this; - } - - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\Federation|null - */ - public function getFederation() - { - return $this->federation; - } - - public function hasFederation() - { - return isset($this->federation); - } - - public function clearFederation() - { - unset($this->federation); - } - - /** - * Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\Federation $var - * @return $this - */ - public function setFederation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Federation::class); - $this->federation = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/CreateMetadataImportRequest.php b/DataprocMetastore/src/V1beta/CreateMetadataImportRequest.php deleted file mode 100644 index 93e9965ead5..00000000000 --- a/DataprocMetastore/src/V1beta/CreateMetadataImportRequest.php +++ /dev/null @@ -1,248 +0,0 @@ -google.cloud.metastore.v1beta.CreateMetadataImportRequest - */ -class CreateMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import_id = ''; - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $metadata_import_id - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @type \Google\Cloud\Metastore\V1beta\MetadataImport $metadata_import - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getMetadataImportId() - { - return $this->metadata_import_id; - } - - /** - * Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * - * Generated from protobuf field string metadata_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setMetadataImportId($var) - { - GPBUtil::checkString($var, True); - $this->metadata_import_id = $var; - - return $this; - } - - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\MetadataImport|null - */ - public function getMetadataImport() - { - return $this->metadata_import; - } - - public function hasMetadataImport() - { - return isset($this->metadata_import); - } - - public function clearMetadataImport() - { - unset($this->metadata_import); - } - - /** - * Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\MetadataImport $var - * @return $this - */ - public function setMetadataImport($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MetadataImport::class); - $this->metadata_import = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/CreateServiceRequest.php b/DataprocMetastore/src/V1beta/CreateServiceRequest.php deleted file mode 100644 index de19e88b955..00000000000 --- a/DataprocMetastore/src/V1beta/CreateServiceRequest.php +++ /dev/null @@ -1,248 +0,0 @@ -google.cloud.metastore.v1beta.CreateServiceRequest - */ -class CreateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service_id = ''; - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type string $service_id - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @type \Google\Cloud\Metastore\V1beta\Service $service - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getServiceId() - { - return $this->service_id; - } - - /** - * Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * - * Generated from protobuf field string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setServiceId($var) - { - GPBUtil::checkString($var, True); - $this->service_id = $var; - - return $this; - } - - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/DataCatalogConfig.php b/DataprocMetastore/src/V1beta/DataCatalogConfig.php deleted file mode 100644 index 25b5be738fe..00000000000 --- a/DataprocMetastore/src/V1beta/DataCatalogConfig.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.metastore.v1beta.DataCatalogConfig - */ -class DataCatalogConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - */ - private $enabled = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $enabled - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - * @return bool - */ - public function getEnabled() - { - return $this->enabled; - } - - /** - * Defines whether the metastore metadata should be synced to Data Catalog. - * The default value is to disable syncing metastore metadata to Data Catalog. - * - * Generated from protobuf field bool enabled = 2; - * @param bool $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkBool($var); - $this->enabled = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/DatabaseDumpSpec.php b/DataprocMetastore/src/V1beta/DatabaseDumpSpec.php deleted file mode 100644 index 3f871317303..00000000000 --- a/DataprocMetastore/src/V1beta/DatabaseDumpSpec.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.metastore.v1beta.DatabaseDumpSpec - */ -class DatabaseDumpSpec extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1beta/DatabaseDumpSpec/Type.php b/DataprocMetastore/src/V1beta/DatabaseDumpSpec/Type.php deleted file mode 100644 index 47888ab7a90..00000000000 --- a/DataprocMetastore/src/V1beta/DatabaseDumpSpec/Type.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1beta.DatabaseDumpSpec.Type - */ -class Type -{ - /** - * The type of the database dump is unknown. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * Database dump is a MySQL dump file. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - /** - * Database dump contains Avro files. - * - * Generated from protobuf enum AVRO = 2; - */ - const AVRO = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - self::AVRO => 'AVRO', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Metastore\V1beta\DatabaseDumpSpec_Type::class); - diff --git a/DataprocMetastore/src/V1beta/DatabaseDumpSpec_Type.php b/DataprocMetastore/src/V1beta/DatabaseDumpSpec_Type.php deleted file mode 100644 index 4bbc8bd1eb2..00000000000 --- a/DataprocMetastore/src/V1beta/DatabaseDumpSpec_Type.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.DataplexConfig - */ -class DataplexConfig extends \Google\Protobuf\Internal\Message -{ - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - */ - private $lake_resources; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $lake_resources - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLakeResources() - { - return $this->lake_resources; - } - - /** - * A reference to the Lake resources that this metastore service is attached - * to. The key is the lake resource name. Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. - * - * Generated from protobuf field map lake_resources = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLakeResources($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\Lake::class); - $this->lake_resources = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/DataprocMetastoreClient.php b/DataprocMetastore/src/V1beta/DataprocMetastoreClient.php deleted file mode 100644 index d25109200e3..00000000000 --- a/DataprocMetastore/src/V1beta/DataprocMetastoreClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/ListFederations', - $argument, - ['\Google\Cloud\Metastore\V1beta\ListFederationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single federation. - * @param \Google\Cloud\Metastore\V1beta\GetFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFederation(\Google\Cloud\Metastore\V1beta\GetFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/GetFederation', - $argument, - ['\Google\Cloud\Metastore\V1beta\Federation', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore federation in a project and location. - * @param \Google\Cloud\Metastore\V1beta\CreateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateFederation(\Google\Cloud\Metastore\V1beta\CreateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/CreateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the fields of a federation. - * @param \Google\Cloud\Metastore\V1beta\UpdateFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateFederation(\Google\Cloud\Metastore\V1beta\UpdateFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/UpdateFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single federation. - * @param \Google\Cloud\Metastore\V1beta\DeleteFederationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteFederation(\Google\Cloud\Metastore\V1beta\DeleteFederationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/DeleteFederation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1beta/DataprocMetastoreGrpcClient.php b/DataprocMetastore/src/V1beta/DataprocMetastoreGrpcClient.php deleted file mode 100644 index 4dcc144746e..00000000000 --- a/DataprocMetastore/src/V1beta/DataprocMetastoreGrpcClient.php +++ /dev/null @@ -1,340 +0,0 @@ -_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/ListServices', - $argument, - ['\Google\Cloud\Metastore\V1beta\ListServicesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets the details of a single service. - * @param \Google\Cloud\Metastore\V1beta\GetServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetService(\Google\Cloud\Metastore\V1beta\GetServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/GetService', - $argument, - ['\Google\Cloud\Metastore\V1beta\Service', 'decode'], - $metadata, $options); - } - - /** - * Creates a metastore service in a project and location. - * @param \Google\Cloud\Metastore\V1beta\CreateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateService(\Google\Cloud\Metastore\V1beta\CreateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/CreateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates the parameters of a single service. - * @param \Google\Cloud\Metastore\V1beta\UpdateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateService(\Google\Cloud\Metastore\V1beta\UpdateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/UpdateService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single service. - * @param \Google\Cloud\Metastore\V1beta\DeleteServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteService(\Google\Cloud\Metastore\V1beta\DeleteServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/DeleteService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists imports in a service. - * @param \Google\Cloud\Metastore\V1beta\ListMetadataImportsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMetadataImports(\Google\Cloud\Metastore\V1beta\ListMetadataImportsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/ListMetadataImports', - $argument, - ['\Google\Cloud\Metastore\V1beta\ListMetadataImportsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single import. - * @param \Google\Cloud\Metastore\V1beta\GetMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMetadataImport(\Google\Cloud\Metastore\V1beta\GetMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/GetMetadataImport', - $argument, - ['\Google\Cloud\Metastore\V1beta\MetadataImport', 'decode'], - $metadata, $options); - } - - /** - * Creates a new MetadataImport in a given project and location. - * @param \Google\Cloud\Metastore\V1beta\CreateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateMetadataImport(\Google\Cloud\Metastore\V1beta\CreateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/CreateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * @param \Google\Cloud\Metastore\V1beta\UpdateMetadataImportRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateMetadataImport(\Google\Cloud\Metastore\V1beta\UpdateMetadataImportRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/UpdateMetadataImport', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Exports metadata from a service. - * @param \Google\Cloud\Metastore\V1beta\ExportMetadataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ExportMetadata(\Google\Cloud\Metastore\V1beta\ExportMetadataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/ExportMetadata', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Restores a service from a backup. - * @param \Google\Cloud\Metastore\V1beta\RestoreServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestoreService(\Google\Cloud\Metastore\V1beta\RestoreServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/RestoreService', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists backups in a service. - * @param \Google\Cloud\Metastore\V1beta\ListBackupsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListBackups(\Google\Cloud\Metastore\V1beta\ListBackupsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/ListBackups', - $argument, - ['\Google\Cloud\Metastore\V1beta\ListBackupsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets details of a single backup. - * @param \Google\Cloud\Metastore\V1beta\GetBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetBackup(\Google\Cloud\Metastore\V1beta\GetBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/GetBackup', - $argument, - ['\Google\Cloud\Metastore\V1beta\Backup', 'decode'], - $metadata, $options); - } - - /** - * Creates a new backup in a given project and location. - * @param \Google\Cloud\Metastore\V1beta\CreateBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateBackup(\Google\Cloud\Metastore\V1beta\CreateBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/CreateBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Deletes a single backup. - * @param \Google\Cloud\Metastore\V1beta\DeleteBackupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteBackup(\Google\Cloud\Metastore\V1beta\DeleteBackupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/DeleteBackup', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Removes the attached IAM policies for a resource - * @param \Google\Cloud\Metastore\V1beta\RemoveIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RemoveIamPolicy(\Google\Cloud\Metastore\V1beta\RemoveIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/RemoveIamPolicy', - $argument, - ['\Google\Cloud\Metastore\V1beta\RemoveIamPolicyResponse', 'decode'], - $metadata, $options); - } - - /** - * Query DPMS metadata. - * @param \Google\Cloud\Metastore\V1beta\QueryMetadataRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function QueryMetadata(\Google\Cloud\Metastore\V1beta\QueryMetadataRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/QueryMetadata', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Move a table to another database. - * @param \Google\Cloud\Metastore\V1beta\MoveTableToDatabaseRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function MoveTableToDatabase(\Google\Cloud\Metastore\V1beta\MoveTableToDatabaseRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/MoveTableToDatabase', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Alter metadata resource location. The metadata resource can be a database, - * table, or partition. This functionality only updates the parent directory - * for the respective metadata resource and does not transfer any existing - * data to the new location. - * @param \Google\Cloud\Metastore\V1beta\AlterMetadataResourceLocationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AlterMetadataResourceLocation(\Google\Cloud\Metastore\V1beta\AlterMetadataResourceLocationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.metastore.v1beta.DataprocMetastore/AlterMetadataResourceLocation', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/DataprocMetastore/src/V1beta/DeleteBackupRequest.php b/DataprocMetastore/src/V1beta/DeleteBackupRequest.php deleted file mode 100644 index 7f8e47145af..00000000000 --- a/DataprocMetastore/src/V1beta/DeleteBackupRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.metastore.v1beta.DeleteBackupRequest - */ -class DeleteBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the backup to delete, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/DeleteFederationRequest.php b/DataprocMetastore/src/V1beta/DeleteFederationRequest.php deleted file mode 100644 index 695a5cc635e..00000000000 --- a/DataprocMetastore/src/V1beta/DeleteFederationRequest.php +++ /dev/null @@ -1,145 +0,0 @@ -google.cloud.metastore.v1beta.DeleteFederationRequest - */ -class DeleteFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore federation to delete, - * in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/DeleteServiceRequest.php b/DataprocMetastore/src/V1beta/DeleteServiceRequest.php deleted file mode 100644 index a9795f11a70..00000000000 --- a/DataprocMetastore/src/V1beta/DeleteServiceRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.metastore.v1beta.DeleteServiceRequest - */ -class DeleteServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore service to delete, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/EncryptionConfig.php b/DataprocMetastore/src/V1beta/EncryptionConfig.php deleted file mode 100644 index 21205e790c3..00000000000 --- a/DataprocMetastore/src/V1beta/EncryptionConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1beta.EncryptionConfig - */ -class EncryptionConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - */ - private $kms_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kms_key - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - * @return string - */ - public function getKmsKey() - { - return $this->kms_key; - } - - /** - * The fully qualified customer provided Cloud KMS key name to use for - * customer data encryption, in the following form: - * `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`. - * - * Generated from protobuf field string kms_key = 1; - * @param string $var - * @return $this - */ - public function setKmsKey($var) - { - GPBUtil::checkString($var, True); - $this->kms_key = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ErrorDetails.php b/DataprocMetastore/src/V1beta/ErrorDetails.php deleted file mode 100644 index f92d367a604..00000000000 --- a/DataprocMetastore/src/V1beta/ErrorDetails.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1beta.ErrorDetails - */ -class ErrorDetails extends \Google\Protobuf\Internal\Message -{ - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - */ - private $details; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $details - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getDetails() - { - return $this->details; - } - - /** - * Additional structured details about this error. - * Keys define the failure items. - * Value describes the exception or details of the item. - * - * Generated from protobuf field map details = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setDetails($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->details = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ExportMetadataRequest.php b/DataprocMetastore/src/V1beta/ExportMetadataRequest.php deleted file mode 100644 index 1a4845eb5ba..00000000000 --- a/DataprocMetastore/src/V1beta/ExportMetadataRequest.php +++ /dev/null @@ -1,232 +0,0 @@ -google.cloud.metastore.v1beta.ExportMetadataRequest - */ -class ExportMetadataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $database_dump_type = 0; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $destination_gcs_folder - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * @type string $service - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type int $database_dump_type - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * - * Generated from protobuf field string destination_gcs_folder = 2; - * @return string - */ - public function getDestinationGcsFolder() - { - return $this->readOneof(2); - } - - public function hasDestinationGcsFolder() - { - return $this->hasOneof(2); - } - - /** - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * - * Generated from protobuf field string destination_gcs_folder = 2; - * @param string $var - * @return $this - */ - public function setDestinationGcsFolder($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to run - * export, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDatabaseDumpType() - { - return $this->database_dump_type; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDatabaseDumpType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\DatabaseDumpSpec\Type::class); - $this->database_dump_type = $var; - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/Federation.php b/DataprocMetastore/src/V1beta/Federation.php deleted file mode 100644 index 8aab8974011..00000000000 --- a/DataprocMetastore/src/V1beta/Federation.php +++ /dev/null @@ -1,433 +0,0 @@ -google.cloud.metastore.v1beta.Federation - */ -class Federation extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $version = ''; - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - */ - private $backend_metastores; - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state_message = ''; - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $uid = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metastore federation was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metastore federation was last updated. - * @type array|\Google\Protobuf\Internal\MapField $labels - * User-defined labels for the metastore federation. - * @type string $version - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * @type array|\Google\Protobuf\Internal\MapField $backend_metastores - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * @type string $endpoint_uri - * Output only. The federation endpoint. - * @type int $state - * Output only. The current state of the federation. - * @type string $state_message - * Output only. Additional information about the current state of the - * metastore federation, if available. - * @type string $uid - * Output only. The globally unique resource identifier of the metastore - * federation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the federation, of the - * form: - * projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metastore federation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metastore federation was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * User-defined labels for the metastore federation. - * - * Generated from protobuf field map labels = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Immutable. The Apache Hive metastore version of the federation. All backend - * metastore versions must be compatible with the federation version. - * - * Generated from protobuf field string version = 5 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getBackendMetastores() - { - return $this->backend_metastores; - } - - /** - * A map from `BackendMetastore` rank to `BackendMetastore`s from which the - * federation service serves metadata at query time. The map key represents - * the order in which `BackendMetastore`s should be evaluated to resolve - * database names at query time and should be greater than or equal to zero. A - * `BackendMetastore` with a lower number will be evaluated before a - * `BackendMetastore` with a higher number. - * - * Generated from protobuf field map backend_metastores = 6; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setBackendMetastores($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\BackendMetastore::class); - $this->backend_metastores = $arr; - - return $this; - } - - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The federation endpoint. - * - * Generated from protobuf field string endpoint_uri = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the federation. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Federation\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * Output only. Additional information about the current state of the - * metastore federation, if available. - * - * Generated from protobuf field string state_message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * federation. - * - * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Federation/State.php b/DataprocMetastore/src/V1beta/Federation/State.php deleted file mode 100644 index ece483cad3f..00000000000 --- a/DataprocMetastore/src/V1beta/Federation/State.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.metastore.v1beta.Federation.State - */ -class State -{ - /** - * The state of the metastore federation is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metastore federation is in the process of being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The metastore federation is running and ready to serve queries. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The metastore federation is being updated. It remains usable but cannot - * accept additional update requests or be deleted at this time. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * The metastore federation is undergoing deletion. It cannot be used. - * - * Generated from protobuf enum DELETING = 4; - */ - const DELETING = 4; - /** - * The metastore federation has encountered an error and cannot be used. The - * metastore federation should be deleted. - * - * Generated from protobuf enum ERROR = 5; - */ - const ERROR = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - self::ERROR => 'ERROR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\Federation_State::class); - diff --git a/DataprocMetastore/src/V1beta/Federation_State.php b/DataprocMetastore/src/V1beta/Federation_State.php deleted file mode 100644 index 55898347c3e..00000000000 --- a/DataprocMetastore/src/V1beta/Federation_State.php +++ /dev/null @@ -1,16 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->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 This class will be removed in the next major version update. - */ -class DataprocMetastoreFederationGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1beta.DataprocMetastoreFederation'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.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 $federationNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_federation_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_federation_rest_client_config.php', - ], - ], - ]; - } - - private static function getFederationNameTemplate() - { - if (self::$federationNameTemplate == null) { - self::$federationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/federations/{federation}'); - } - - return self::$federationNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'federation' => self::getFederationNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a federation - * resource. - * - * @param string $project - * @param string $location - * @param string $federation - * - * @return string The formatted federation resource. - * - * @experimental - */ - public static function federationName($project, $location, $federation) - { - return self::getFederationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'federation' => $federation, - ]); - } - - /** - * 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, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - federation: projects/{project}/locations/{location}/federations/{federation} - * - location: projects/{project}/locations/{location} - * - * 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'metastore.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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a metastore federation in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * $federationId = 'federation_id'; - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->createFederation($formattedParent, $federationId, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'createFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * federation service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $federationId Required. The ID of the metastore federation, which is used as the final - * component of the metastore federation's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Federation $federation Required. The Metastore Federation to create. The `name` field is - * ignored. The ID of the created metastore federation must be - * provided in the request's `federation_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createFederation($parent, $federationId, $federation, array $optionalArgs = []) - { - $request = new CreateFederationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFederationId($federationId); - $request->setFederation($federation); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->deleteFederation($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'deleteFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to delete, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteFederation($name, array $optionalArgs = []) - { - $request = new DeleteFederationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets the details of a single federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedName = $dataprocMetastoreFederationClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - * $response = $dataprocMetastoreFederationClient->getFederation($formattedName); - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * @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\Metastore\V1beta\Federation - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getFederation($name, array $optionalArgs = []) - { - $request = new GetFederationRequest(); - $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('GetFederation', Federation::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists federations in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $formattedParent = $dataprocMetastoreFederationClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listFederations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 listFederations($parent, array $optionalArgs = []) - { - $request = new ListFederationsRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListFederations', $optionalArgs, ListFederationsResponse::class, $request); - } - - /** - * Updates the fields of a federation. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $updateMask = new FieldMask(); - * $federation = new Federation(); - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreFederationClient->updateFederation($updateMask, $federation); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreFederationClient->resumeOperation($operationName, 'updateFederation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreFederationClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Federation $federation Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateFederation($updateMask, $federation, array $optionalArgs = []) - { - $request = new UpdateFederationRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setFederation($federation); - $requestParamHeaders['federation.name'] = $federation->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateFederation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $response = $dataprocMetastoreFederationClient->getLocation(); - * } finally { - * $dataprocMetastoreFederationClient->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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreFederationClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreFederationClient->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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreFederationClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreFederationClient->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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreFederationClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreFederationClient->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: - * ``` - * $dataprocMetastoreFederationClient = new DataprocMetastoreFederationClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreFederationClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreFederationClient->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/DataprocMetastore/src/V1beta/Gapic/DataprocMetastoreGapicClient.php b/DataprocMetastore/src/V1beta/Gapic/DataprocMetastoreGapicClient.php deleted file mode 100644 index a8d70fca27c..00000000000 --- a/DataprocMetastore/src/V1beta/Gapic/DataprocMetastoreGapicClient.php +++ /dev/null @@ -1,2408 +0,0 @@ -serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->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 This class will be removed in the next major version update. - */ -class DataprocMetastoreGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.metastore.v1beta.DataprocMetastore'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'metastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'metastore.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 $backupNameTemplate; - - private static $lakeNameTemplate; - - private static $locationNameTemplate; - - private static $metadataImportNameTemplate; - - private static $networkNameTemplate; - - private static $serviceNameTemplate; - - private static $subnetworkNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/dataproc_metastore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/dataproc_metastore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/dataproc_metastore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/dataproc_metastore_rest_client_config.php', - ], - ], - ]; - } - - private static function getBackupNameTemplate() - { - if (self::$backupNameTemplate == null) { - self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/backups/{backup}'); - } - - return self::$backupNameTemplate; - } - - private static function getLakeNameTemplate() - { - if (self::$lakeNameTemplate == null) { - self::$lakeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/lakes/{lake}'); - } - - return self::$lakeNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getMetadataImportNameTemplate() - { - if (self::$metadataImportNameTemplate == null) { - self::$metadataImportNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import}'); - } - - return self::$metadataImportNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getSubnetworkNameTemplate() - { - if (self::$subnetworkNameTemplate == null) { - self::$subnetworkNameTemplate = new PathTemplate('projects/{project}/regions/{region}/subnetworks/{subnetwork}'); - } - - return self::$subnetworkNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'backup' => self::getBackupNameTemplate(), - 'lake' => self::getLakeNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'metadataImport' => self::getMetadataImportNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'service' => self::getServiceNameTemplate(), - 'subnetwork' => self::getSubnetworkNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $backup - * - * @return string The formatted backup resource. - * - * @experimental - */ - public static function backupName($project, $location, $service, $backup) - { - return self::getBackupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a lake - * resource. - * - * @param string $project - * @param string $location - * @param string $lake - * - * @return string The formatted lake resource. - * - * @experimental - */ - public static function lakeName($project, $location, $lake) - { - return self::getLakeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'lake' => $lake, - ]); - } - - /** - * 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 - * metadata_import resource. - * - * @param string $project - * @param string $location - * @param string $service - * @param string $metadataImport - * - * @return string The formatted metadata_import resource. - * - * @experimental - */ - public static function metadataImportName($project, $location, $service, $metadataImport) - { - return self::getMetadataImportNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - 'metadata_import' => $metadataImport, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - * - * @experimental - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $service - * - * @return string The formatted service resource. - * - * @experimental - */ - public static function serviceName($project, $location, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a subnetwork - * resource. - * - * @param string $project - * @param string $region - * @param string $subnetwork - * - * @return string The formatted subnetwork resource. - * - * @experimental - */ - public static function subnetworkName($project, $region, $subnetwork) - { - return self::getSubnetworkNameTemplate()->render([ - 'project' => $project, - 'region' => $region, - 'subnetwork' => $subnetwork, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - backup: projects/{project}/locations/{location}/services/{service}/backups/{backup} - * - lake: projects/{project}/locations/{location}/lakes/{lake} - * - location: projects/{project}/locations/{location} - * - metadataImport: projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import} - * - network: projects/{project}/global/networks/{network} - * - service: projects/{project}/locations/{location}/services/{service} - * - subnetwork: projects/{project}/regions/{region}/subnetworks/{subnetwork} - * - * 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"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'metastore.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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Alter metadata resource location. The metadata resource can be a database, - * table, or partition. This functionality only updates the parent directory - * for the respective metadata resource and does not transfer any existing - * data to the new location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $resourceName = 'resource_name'; - * $locationUri = 'location_uri'; - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'alterMetadataResourceLocation'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $resourceName Required. The relative metadata resource name in the following format. - * - * `databases/{database_id}` - * or - * `databases/{database_id}/tables/{table_id}` - * or - * `databases/{database_id}/tables/{table_id}/partitions/{partition_id}` - * @param string $locationUri Required. The new location URI for the metadata resource. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function alterMetadataResourceLocation($service, $resourceName, $locationUri, array $optionalArgs = []) - { - $request = new AlterMetadataResourceLocationRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setResourceName($resourceName); - $request->setLocationUri($locationUri); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('AlterMetadataResourceLocation', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new backup in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $backupId = 'backup_id'; - * $backup = new Backup(); - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createBackup($formattedParent, $backupId, $backup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * backup of the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $backupId Required. The ID of the backup, which is used as the final component of the - * backup's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param Backup $backup Required. The backup to create. The `name` field is ignored. The ID of the - * created backup must be provided in the request's `backup_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createBackup($parent, $backupId, $backup, array $optionalArgs = []) - { - $request = new CreateBackupRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupId($backupId); - $request->setBackup($backup); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new MetadataImport in a given project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $metadataImportId = 'metadata_import_id'; - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service in which to create a - * metastore import, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param string $metadataImportId Required. The ID of the metadata import, which is used as the final - * component of the metadata import's name. - * - * This value must be between 1 and 64 characters long, begin with a letter, - * end with a letter or number, and consist of alpha-numeric ASCII characters - * or hyphens. - * @param MetadataImport $metadataImport Required. The metadata import to create. The `name` field is ignored. The - * ID of the created metadata import must be provided in the request's - * `metadata_import_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createMetadataImport($parent, $metadataImportId, $metadataImport, array $optionalArgs = []) - { - $request = new CreateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMetadataImportId($metadataImportId); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a metastore service in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * $serviceId = 'service_id'; - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->createService($formattedParent, $serviceId, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'createService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location in which to create a - * metastore service, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @param string $serviceId Required. The ID of the metastore service, which is used as the final - * component of the metastore service's name. - * - * This value must be between 2 and 63 characters long inclusive, begin with a - * letter, end with a letter or number, and consist of alpha-numeric - * ASCII characters or hyphens. - * @param Service $service Required. The Metastore service to create. The `name` field is - * ignored. The ID of the created metastore service must be provided in - * the request's `service_id` field. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createService($parent, $serviceId, $service, array $optionalArgs = []) - { - $request = new CreateServiceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setServiceId($serviceId); - $request->setService($service); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteBackup($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteBackup'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to delete, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteBackup($name, array $optionalArgs = []) - { - $request = new DeleteBackupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteBackup', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->deleteService($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'deleteService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to delete, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteService($name, array $optionalArgs = []) - { - $request = new DeleteServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Exports metadata from a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->exportMetadata($formattedService); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'exportMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * export, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $destinationGcsFolder - * A Cloud Storage URI of a folder, in the format - * `gs:///`. A sub-folder - * `` containing exported files will be created below it. - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @type int $databaseDumpType - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1beta\DatabaseDumpSpec\Type} - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function exportMetadata($service, array $optionalArgs = []) - { - $request = new ExportMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['destinationGcsFolder'])) { - $request->setDestinationGcsFolder($optionalArgs['destinationGcsFolder']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['databaseDumpType'])) { - $request->setDatabaseDumpType($optionalArgs['databaseDumpType']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ExportMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets details of a single backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $response = $dataprocMetastoreClient->getBackup($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the backup to retrieve, in the - * following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @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\Metastore\V1beta\Backup - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getBackup($name, array $optionalArgs = []) - { - $request = new GetBackupRequest(); - $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('GetBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single import. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - * $response = $dataprocMetastoreClient->getMetadataImport($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * @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\Metastore\V1beta\MetadataImport - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getMetadataImport($name, array $optionalArgs = []) - { - $request = new GetMetadataImportRequest(); - $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('GetMetadataImport', MetadataImport::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the details of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedName = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $response = $dataprocMetastoreClient->getService($formattedName); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $name Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @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\Metastore\V1beta\Service - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getService($name, array $optionalArgs = []) - { - $request = new GetServiceRequest(); - $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('GetService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists backups in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listBackups($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose backups to - * list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 listBackups($parent, array $optionalArgs = []) - { - $request = new ListBackupsRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBackups', $optionalArgs, ListBackupsResponse::class, $request); - } - - /** - * Lists imports in a service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listMetadataImports($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 listMetadataImports($parent, array $optionalArgs = []) - { - $request = new ListMetadataImportsRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListMetadataImports', $optionalArgs, ListMetadataImportsResponse::class, $request); - } - - /** - * Lists services in a project and location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedParent = $dataprocMetastoreClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listServices($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The relative resource name of the location of metastore services - * to list, in the following form: - * - * `projects/{project_number}/locations/{location_id}`. - * @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. The filter to apply to list results. - * @type string $orderBy - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * @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 listServices($parent, array $optionalArgs = []) - { - $request = new ListServicesRequest(); - $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['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); - } - - /** - * Move a table to another database. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $tableName = 'table_name'; - * $dbName = 'db_name'; - * $destinationDbName = 'destination_db_name'; - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'moveTableToDatabase'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $tableName Required. The name of the table to be moved. - * @param string $dbName Required. The name of the database where the table resides. - * @param string $destinationDbName Required. The name of the database where the table should be moved. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function moveTableToDatabase($service, $tableName, $dbName, $destinationDbName, array $optionalArgs = []) - { - $request = new MoveTableToDatabaseRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setTableName($tableName); - $request->setDbName($dbName); - $request->setDestinationDbName($destinationDbName); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('MoveTableToDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Query DPMS metadata. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $query = 'query'; - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->queryMetadata($formattedService, $query); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'queryMetadata'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $query Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function queryMetadata($service, $query, array $optionalArgs = []) - { - $request = new QueryMetadataRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setQuery($query); - $requestParamHeaders['service'] = $service; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('QueryMetadata', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Removes the attached IAM policies for a resource - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreClient->removeIamPolicy($resource); - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $resource Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type bool $asynchronous - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * @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\Metastore\V1beta\RemoveIamPolicyResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function removeIamPolicy($resource, array $optionalArgs = []) - { - $request = new RemoveIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['asynchronous'])) { - $request->setAsynchronous($optionalArgs['asynchronous']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RemoveIamPolicy', RemoveIamPolicyResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Restores a service from a backup. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $formattedService = $dataprocMetastoreClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - * $formattedBackup = $dataprocMetastoreClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->restoreService($formattedService, $formattedBackup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'restoreService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param string $service Required. The relative resource name of the metastore service to run - * restore, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @param string $backup Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $restoreType - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * For allowed values, use constants defined on {@see \Google\Cloud\Metastore\V1beta\Restore\RestoreType} - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function restoreService($service, $backup, array $optionalArgs = []) - { - $request = new RestoreServiceRequest(); - $requestParamHeaders = []; - $request->setService($service); - $request->setBackup($backup); - $requestParamHeaders['service'] = $service; - if (isset($optionalArgs['restoreType'])) { - $request->setRestoreType($optionalArgs['restoreType']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a single import. - * Only the description field of MetadataImport is supported to be updated. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $metadataImport = new MetadataImport(); - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateMetadataImport($updateMask, $metadataImport); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateMetadataImport'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param MetadataImport $metadataImport Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateMetadataImport($updateMask, $metadataImport, array $optionalArgs = []) - { - $request = new UpdateMetadataImportRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setMetadataImport($metadataImport); - $requestParamHeaders['metadata_import.name'] = $metadataImport->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateMetadataImport', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates the parameters of a single service. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $updateMask = new FieldMask(); - * $service = new Service(); - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $dataprocMetastoreClient->updateService($updateMask, $service); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $dataprocMetastoreClient->resumeOperation($operationName, 'updateService'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $dataprocMetastoreClient->close(); - * } - * ``` - * - * @param FieldMask $updateMask Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @param Service $service Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * @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\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateService($updateMask, $service, array $optionalArgs = []) - { - $request = new UpdateServiceRequest(); - $requestParamHeaders = []; - $request->setUpdateMask($updateMask); - $request->setService($service); - $requestParamHeaders['service.name'] = $service->getName(); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateService', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $response = $dataprocMetastoreClient->getLocation(); - * } finally { - * $dataprocMetastoreClient->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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $dataprocMetastoreClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $dataprocMetastoreClient->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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $response = $dataprocMetastoreClient->getIamPolicy($resource); - * } finally { - * $dataprocMetastoreClient->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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $dataprocMetastoreClient->setIamPolicy($resource, $policy); - * } finally { - * $dataprocMetastoreClient->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: - * ``` - * $dataprocMetastoreClient = new DataprocMetastoreClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $dataprocMetastoreClient->testIamPermissions($resource, $permissions); - * } finally { - * $dataprocMetastoreClient->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/DataprocMetastore/src/V1beta/GetBackupRequest.php b/DataprocMetastore/src/V1beta/GetBackupRequest.php deleted file mode 100644 index 2cd6732ac3c..00000000000 --- a/DataprocMetastore/src/V1beta/GetBackupRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1beta.GetBackupRequest - */ -class GetBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the backup to retrieve, in the - * following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/GetFederationRequest.php b/DataprocMetastore/src/V1beta/GetFederationRequest.php deleted file mode 100644 index 2f01ea139e8..00000000000 --- a/DataprocMetastore/src/V1beta/GetFederationRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1beta.GetFederationRequest - */ -class GetFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore federation to - * retrieve, in the following form: - * `projects/{project_number}/locations/{location_id}/federations/{federation_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/GetMetadataImportRequest.php b/DataprocMetastore/src/V1beta/GetMetadataImportRequest.php deleted file mode 100644 index bc05ebda030..00000000000 --- a/DataprocMetastore/src/V1beta/GetMetadataImportRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1beta.GetMetadataImportRequest - */ -class GetMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metadata import to retrieve, in - * the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/GetServiceRequest.php b/DataprocMetastore/src/V1beta/GetServiceRequest.php deleted file mode 100644 index 38396ecf47c..00000000000 --- a/DataprocMetastore/src/V1beta/GetServiceRequest.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.metastore.v1beta.GetServiceRequest - */ -class GetServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The relative resource name of the metastore service to retrieve, - * in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/HiveMetastoreConfig.php b/DataprocMetastore/src/V1beta/HiveMetastoreConfig.php deleted file mode 100644 index 0e2f8307ee4..00000000000 --- a/DataprocMetastore/src/V1beta/HiveMetastoreConfig.php +++ /dev/null @@ -1,278 +0,0 @@ -google.cloud.metastore.v1beta.HiveMetastoreConfig - */ -class HiveMetastoreConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $version = ''; - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - */ - private $config_overrides; - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.KerberosConfig kerberos_config = 3; - */ - private $kerberos_config = null; - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - */ - private $endpoint_protocol = 0; - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - */ - private $auxiliary_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * Immutable. The Hive metastore schema version. - * @type array|\Google\Protobuf\Internal\MapField $config_overrides - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * @type \Google\Cloud\Metastore\V1beta\KerberosConfig $kerberos_config - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * @type int $endpoint_protocol - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * @type array|\Google\Protobuf\Internal\MapField $auxiliary_versions - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Immutable. The Hive metastore schema version. - * - * Generated from protobuf field string version = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getConfigOverrides() - { - return $this->config_overrides; - } - - /** - * A mapping of Hive metastore configuration key-value pairs to apply to the - * Hive metastore (configured in `hive-site.xml`). The mappings - * override system defaults (some keys cannot be overridden). These - * overrides are also applied to auxiliary versions and can be further - * customized in the auxiliary version's `AuxiliaryVersionConfig`. - * - * Generated from protobuf field map config_overrides = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setConfigOverrides($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->config_overrides = $arr; - - return $this; - } - - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.KerberosConfig kerberos_config = 3; - * @return \Google\Cloud\Metastore\V1beta\KerberosConfig|null - */ - public function getKerberosConfig() - { - return $this->kerberos_config; - } - - public function hasKerberosConfig() - { - return isset($this->kerberos_config); - } - - public function clearKerberosConfig() - { - unset($this->kerberos_config); - } - - /** - * Information used to configure the Hive metastore service as a service - * principal in a Kerberos realm. To disable Kerberos, use the `UpdateService` - * method and specify this field's path - * (`hive_metastore_config.kerberos_config`) in the request's `update_mask` - * while omitting this field from the request's `service`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.KerberosConfig kerberos_config = 3; - * @param \Google\Cloud\Metastore\V1beta\KerberosConfig $var - * @return $this - */ - public function setKerberosConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\KerberosConfig::class); - $this->kerberos_config = $var; - - return $this; - } - - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - * @return int - */ - public function getEndpointProtocol() - { - return $this->endpoint_protocol; - } - - /** - * The protocol to use for the metastore service endpoint. If unspecified, - * defaults to `THRIFT`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.HiveMetastoreConfig.EndpointProtocol endpoint_protocol = 4; - * @param int $var - * @return $this - */ - public function setEndpointProtocol($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig\EndpointProtocol::class); - $this->endpoint_protocol = $var; - - return $this; - } - - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAuxiliaryVersions() - { - return $this->auxiliary_versions; - } - - /** - * A mapping of Hive metastore version to the auxiliary version - * configuration. When specified, a secondary Hive metastore service is - * created along with the primary service. All auxiliary versions must be less - * than the service's primary version. The key is the auxiliary service name - * and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This - * means that the first character must be a lowercase letter, and all the - * following characters must be hyphens, lowercase letters, or digits, except - * the last character, which cannot be a hyphen. - * - * Generated from protobuf field map auxiliary_versions = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAuxiliaryVersions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\AuxiliaryVersionConfig::class); - $this->auxiliary_versions = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/HiveMetastoreConfig/EndpointProtocol.php b/DataprocMetastore/src/V1beta/HiveMetastoreConfig/EndpointProtocol.php deleted file mode 100644 index 2098fa3fe11..00000000000 --- a/DataprocMetastore/src/V1beta/HiveMetastoreConfig/EndpointProtocol.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1beta.HiveMetastoreConfig.EndpointProtocol - */ -class EndpointProtocol -{ - /** - * The protocol is not set. - * - * Generated from protobuf enum ENDPOINT_PROTOCOL_UNSPECIFIED = 0; - */ - const ENDPOINT_PROTOCOL_UNSPECIFIED = 0; - /** - * Use the legacy Apache Thrift protocol for the metastore service endpoint. - * - * Generated from protobuf enum THRIFT = 1; - */ - const THRIFT = 1; - /** - * Use the modernized gRPC protocol for the metastore service endpoint. - * - * Generated from protobuf enum GRPC = 2; - */ - const GRPC = 2; - - private static $valueToName = [ - self::ENDPOINT_PROTOCOL_UNSPECIFIED => 'ENDPOINT_PROTOCOL_UNSPECIFIED', - self::THRIFT => 'THRIFT', - self::GRPC => 'GRPC', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EndpointProtocol::class, \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig_EndpointProtocol::class); - diff --git a/DataprocMetastore/src/V1beta/HiveMetastoreConfig_EndpointProtocol.php b/DataprocMetastore/src/V1beta/HiveMetastoreConfig_EndpointProtocol.php deleted file mode 100644 index 2cee82220a4..00000000000 --- a/DataprocMetastore/src/V1beta/HiveMetastoreConfig_EndpointProtocol.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.KerberosConfig - */ -class KerberosConfig extends \Google\Protobuf\Internal\Message -{ - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Secret keytab = 1; - */ - private $keytab = null; - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - */ - private $principal = ''; - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - */ - private $krb5_config_gcs_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1beta\Secret $keytab - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * @type string $principal - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * @type string $krb5_config_gcs_uri - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Secret keytab = 1; - * @return \Google\Cloud\Metastore\V1beta\Secret|null - */ - public function getKeytab() - { - return $this->keytab; - } - - public function hasKeytab() - { - return isset($this->keytab); - } - - public function clearKeytab() - { - unset($this->keytab); - } - - /** - * A Kerberos keytab file that can be used to authenticate a service principal - * with a Kerberos Key Distribution Center (KDC). - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Secret keytab = 1; - * @param \Google\Cloud\Metastore\V1beta\Secret $var - * @return $this - */ - public function setKeytab($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Secret::class); - $this->keytab = $var; - - return $this; - } - - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - * @return string - */ - public function getPrincipal() - { - return $this->principal; - } - - /** - * A Kerberos principal that exists in the both the keytab the KDC - * to authenticate as. A typical principal is of the form - * `primary/instance@REALM`, but there is no exact format. - * - * Generated from protobuf field string principal = 2; - * @param string $var - * @return $this - */ - public function setPrincipal($var) - { - GPBUtil::checkString($var, True); - $this->principal = $var; - - return $this; - } - - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - * @return string - */ - public function getKrb5ConfigGcsUri() - { - return $this->krb5_config_gcs_uri; - } - - /** - * A Cloud Storage URI that specifies the path to a - * krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`, - * although the file does not need to be named krb5.conf explicitly. - * - * Generated from protobuf field string krb5_config_gcs_uri = 3; - * @param string $var - * @return $this - */ - public function setKrb5ConfigGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->krb5_config_gcs_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Lake.php b/DataprocMetastore/src/V1beta/Lake.php deleted file mode 100644 index cb26f5fd0f1..00000000000 --- a/DataprocMetastore/src/V1beta/Lake.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1beta.Lake - */ -class Lake extends \Google\Protobuf\Internal\Message -{ - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The Lake resource name. - * Example: - * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListBackupsRequest.php b/DataprocMetastore/src/V1beta/ListBackupsRequest.php deleted file mode 100644 index d5be288debd..00000000000 --- a/DataprocMetastore/src/V1beta/ListBackupsRequest.php +++ /dev/null @@ -1,252 +0,0 @@ -google.cloud.metastore.v1beta.ListBackupsRequest - */ -class ListBackupsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * @type int $page_size - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service whose backups to - * list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of backups to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 backups are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListBackups][google.cloud.metastore.v1beta.DataprocMetastore.ListBackups] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListBackupsResponse.php b/DataprocMetastore/src/V1beta/ListBackupsResponse.php deleted file mode 100644 index e5217feacd9..00000000000 --- a/DataprocMetastore/src/V1beta/ListBackupsResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1beta.ListBackupsResponse - */ -class ListBackupsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Backup backups = 1; - */ - private $backups; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\Backup>|\Google\Protobuf\Internal\RepeatedField $backups - * The backups of the specified service. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Backup backups = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBackups() - { - return $this->backups; - } - - /** - * The backups of the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Backup backups = 1; - * @param array<\Google\Cloud\Metastore\V1beta\Backup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBackups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\Backup::class); - $this->backups = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListFederationsRequest.php b/DataprocMetastore/src/V1beta/ListFederationsRequest.php deleted file mode 100644 index c3263965026..00000000000 --- a/DataprocMetastore/src/V1beta/ListFederationsRequest.php +++ /dev/null @@ -1,251 +0,0 @@ -google.cloud.metastore.v1beta.ListFederationsRequest - */ -class ListFederationsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type int $page_size - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location of metastore - * federations to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of federations to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous ListFederationServices - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * ListFederationServices must match the call that provided the - * page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListFederationsResponse.php b/DataprocMetastore/src/V1beta/ListFederationsResponse.php deleted file mode 100644 index 4bd38b11e0d..00000000000 --- a/DataprocMetastore/src/V1beta/ListFederationsResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.metastore.v1beta.ListFederationsResponse - */ -class ListFederationsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Federation federations = 1; - */ - private $federations; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\Federation>|\Google\Protobuf\Internal\RepeatedField $federations - * The services in the specified location. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Federation federations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFederations() - { - return $this->federations; - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Federation federations = 1; - * @param array<\Google\Cloud\Metastore\V1beta\Federation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFederations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\Federation::class); - $this->federations = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListMetadataImportsRequest.php b/DataprocMetastore/src/V1beta/ListMetadataImportsRequest.php deleted file mode 100644 index 1b6130e54d5..00000000000 --- a/DataprocMetastore/src/V1beta/ListMetadataImportsRequest.php +++ /dev/null @@ -1,252 +0,0 @@ -google.cloud.metastore.v1beta.ListMetadataImportsRequest - */ -class ListMetadataImportsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * @type int $page_size - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the service whose metadata imports - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of imports to return. The response may contain - * less than the maximum number. If unspecified, no more than 500 imports are - * returned. The maximum value is 1000; values above 1000 are changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListMetadataImportsResponse.php b/DataprocMetastore/src/V1beta/ListMetadataImportsResponse.php deleted file mode 100644 index f57bc3e48b0..00000000000 --- a/DataprocMetastore/src/V1beta/ListMetadataImportsResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1beta.ListMetadataImportsResponse - */ -class ListMetadataImportsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataImport metadata_imports = 1; - */ - private $metadata_imports; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\MetadataImport>|\Google\Protobuf\Internal\RepeatedField $metadata_imports - * The imports in the specified service. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataImport metadata_imports = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMetadataImports() - { - return $this->metadata_imports; - } - - /** - * The imports in the specified service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataImport metadata_imports = 1; - * @param array<\Google\Cloud\Metastore\V1beta\MetadataImport>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMetadataImports($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\MetadataImport::class); - $this->metadata_imports = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListServicesRequest.php b/DataprocMetastore/src/V1beta/ListServicesRequest.php deleted file mode 100644 index c5c917d6ac0..00000000000 --- a/DataprocMetastore/src/V1beta/ListServicesRequest.php +++ /dev/null @@ -1,256 +0,0 @@ -google.cloud.metastore.v1beta.ListServicesRequest - */ -class ListServicesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_size = 0; - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $page_token = ''; - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * @type int $page_size - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * @type string $page_token - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * @type string $filter - * Optional. The filter to apply to list results. - * @type string $order_by - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The relative resource name of the location of metastore services - * to list, in the following form: - * `projects/{project_number}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of services to return. The response may - * contain less than the maximum number. If unspecified, no more than 500 - * services are returned. The maximum value is 1000; values above 1000 are - * changed to 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * call. Provide this token to retrieve the subsequent page. - * To retrieve the first page, supply an empty page token. - * When paginating, other parameters provided to - * [DataprocMetastore.ListServices][google.cloud.metastore.v1beta.DataprocMetastore.ListServices] - * must match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. The filter to apply to list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify the ordering of results as described in [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * If not specified, the results will be sorted in the default order. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/ListServicesResponse.php b/DataprocMetastore/src/V1beta/ListServicesResponse.php deleted file mode 100644 index b267f025110..00000000000 --- a/DataprocMetastore/src/V1beta/ListServicesResponse.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.metastore.v1beta.ListServicesResponse - */ -class ListServicesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Service services = 1; - */ - private $services; - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\Service>|\Google\Protobuf\Internal\RepeatedField $services - * The services in the specified location. - * @type string $next_page_token - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Service services = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServices() - { - return $this->services; - } - - /** - * The services in the specified location. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Service services = 1; - * @param array<\Google\Cloud\Metastore\V1beta\Service>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\Service::class); - $this->services = $arr; - - return $this; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token that can be sent as `page_token` to retrieve the next page. If this - * field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/LocationMetadata.php b/DataprocMetastore/src/V1beta/LocationMetadata.php deleted file mode 100644 index 2399c3c3e4e..00000000000 --- a/DataprocMetastore/src/V1beta/LocationMetadata.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.metastore.v1beta.LocationMetadata - */ -class LocationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - */ - private $supported_hive_metastore_versions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\LocationMetadata\HiveMetastoreVersion>|\Google\Protobuf\Internal\RepeatedField $supported_hive_metastore_versions - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSupportedHiveMetastoreVersions() - { - return $this->supported_hive_metastore_versions; - } - - /** - * The versions of Hive Metastore that can be used when creating a new - * metastore service in this location. The server guarantees that exactly one - * `HiveMetastoreVersion` in the list will set `is_default`. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.LocationMetadata.HiveMetastoreVersion supported_hive_metastore_versions = 1; - * @param array<\Google\Cloud\Metastore\V1beta\LocationMetadata\HiveMetastoreVersion>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSupportedHiveMetastoreVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\LocationMetadata\HiveMetastoreVersion::class); - $this->supported_hive_metastore_versions = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/LocationMetadata/HiveMetastoreVersion.php b/DataprocMetastore/src/V1beta/LocationMetadata/HiveMetastoreVersion.php deleted file mode 100644 index 326093d14c4..00000000000 --- a/DataprocMetastore/src/V1beta/LocationMetadata/HiveMetastoreVersion.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.metastore.v1beta.LocationMetadata.HiveMetastoreVersion - */ -class HiveMetastoreVersion extends \Google\Protobuf\Internal\Message -{ - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - */ - private $version = ''; - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - */ - private $is_default = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version - * The semantic version of the Hive Metastore software. - * @type bool $is_default - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The semantic version of the Hive Metastore software. - * - * Generated from protobuf field string version = 1; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - * @return bool - */ - public function getIsDefault() - { - return $this->is_default; - } - - /** - * Whether `version` will be chosen by the server if a metastore service is - * created with a `HiveMetastoreConfig` that omits the `version`. - * - * Generated from protobuf field bool is_default = 2; - * @param bool $var - * @return $this - */ - public function setIsDefault($var) - { - GPBUtil::checkBool($var); - $this->is_default = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HiveMetastoreVersion::class, \Google\Cloud\Metastore\V1beta\LocationMetadata_HiveMetastoreVersion::class); - diff --git a/DataprocMetastore/src/V1beta/LocationMetadata_HiveMetastoreVersion.php b/DataprocMetastore/src/V1beta/LocationMetadata_HiveMetastoreVersion.php deleted file mode 100644 index bfa27f7269b..00000000000 --- a/DataprocMetastore/src/V1beta/LocationMetadata_HiveMetastoreVersion.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.MaintenanceWindow - */ -class MaintenanceWindow extends \Google\Protobuf\Internal\Message -{ - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - */ - private $hour_of_day = null; - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - */ - private $day_of_week = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Int32Value $hour_of_day - * The hour of day (0-23) when the window starts. - * @type int $day_of_week - * The day of week, when the window starts. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @return \Google\Protobuf\Int32Value|null - */ - public function getHourOfDay() - { - return $this->hour_of_day; - } - - public function hasHourOfDay() - { - return isset($this->hour_of_day); - } - - public function clearHourOfDay() - { - unset($this->hour_of_day); - } - - /** - * Returns the unboxed value from getHourOfDay() - - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @return int|null - */ - public function getHourOfDayValue() - { - return $this->readWrapperValue("hour_of_day"); - } - - /** - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @param \Google\Protobuf\Int32Value $var - * @return $this - */ - public function setHourOfDay($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); - $this->hour_of_day = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. - - * The hour of day (0-23) when the window starts. - * - * Generated from protobuf field .google.protobuf.Int32Value hour_of_day = 1; - * @param int|null $var - * @return $this - */ - public function setHourOfDayValue($var) - { - $this->writeWrapperValue("hour_of_day", $var); - return $this;} - - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - * @return int - */ - public function getDayOfWeek() - { - return $this->day_of_week; - } - - /** - * The day of week, when the window starts. - * - * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2; - * @param int $var - * @return $this - */ - public function setDayOfWeek($var) - { - GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); - $this->day_of_week = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/MetadataExport.php b/DataprocMetastore/src/V1beta/MetadataExport.php deleted file mode 100644 index 59229109126..00000000000 --- a/DataprocMetastore/src/V1beta/MetadataExport.php +++ /dev/null @@ -1,240 +0,0 @@ -google.cloud.metastore.v1beta.MetadataExport - */ -class MetadataExport extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_time = null; - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $database_dump_type = 0; - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $destination_gcs_uri - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * @type \Google\Protobuf\Timestamp $start_time - * Output only. The time when the export started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the export ended. - * @type int $state - * Output only. The current state of the export. - * @type int $database_dump_type - * Output only. The type of the database dump. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * - * Generated from protobuf field string destination_gcs_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDestinationGcsUri() - { - return $this->readOneof(4); - } - - public function hasDestinationGcsUri() - { - return $this->hasOneof(4); - } - - /** - * Output only. A Cloud Storage URI of a folder that metadata are exported - * to, in the form of - * `gs:////`, where - * `` is automatically generated. - * - * Generated from protobuf field string destination_gcs_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDestinationGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. The time when the export started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the export ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the export. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataExport.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\MetadataExport\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getDatabaseDumpType() - { - return $this->database_dump_type; - } - - /** - * Output only. The type of the database dump. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type database_dump_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setDatabaseDumpType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\DatabaseDumpSpec\Type::class); - $this->database_dump_type = $var; - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/MetadataExport/State.php b/DataprocMetastore/src/V1beta/MetadataExport/State.php deleted file mode 100644 index 92bac47ffdc..00000000000 --- a/DataprocMetastore/src/V1beta/MetadataExport/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.metastore.v1beta.MetadataExport.State - */ -class State -{ - /** - * The state of the metadata export is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata export is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata export completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata export failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The metadata export is cancelled. - * - * Generated from protobuf enum CANCELLED = 4; - */ - const CANCELLED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\MetadataExport_State::class); - diff --git a/DataprocMetastore/src/V1beta/MetadataExport_State.php b/DataprocMetastore/src/V1beta/MetadataExport_State.php deleted file mode 100644 index 91b41b8b740..00000000000 --- a/DataprocMetastore/src/V1beta/MetadataExport_State.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.MetadataImport - */ -class MetadataImport extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - */ - private $description = ''; - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - protected $metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1beta\MetadataImport\DatabaseDump $database_dump - * Immutable. A database dump from a pre-existing metastore's database. - * @type string $name - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * @type string $description - * The description of the metadata import. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metadata import was started. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metadata import was last updated. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the metadata import finished. - * @type int $state - * Output only. The current state of the metadata import. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. A database dump from a pre-existing metastore's database. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.DatabaseDump database_dump = 6 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\Metastore\V1beta\MetadataImport\DatabaseDump|null - */ - public function getDatabaseDump() - { - return $this->readOneof(6); - } - - public function hasDatabaseDump() - { - return $this->hasOneof(6); - } - - /** - * Immutable. A database dump from a pre-existing metastore's database. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.DatabaseDump database_dump = 6 [(.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\Metastore\V1beta\MetadataImport\DatabaseDump $var - * @return $this - */ - public function setDatabaseDump($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MetadataImport\DatabaseDump::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the metadata import, of the form: - * `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The description of the metadata import. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metadata import was started. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metadata import was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the metadata import finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the metadata import. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\MetadataImport\State::class); - $this->state = $var; - - return $this; - } - - /** - * @return string - */ - public function getMetadata() - { - return $this->whichOneof("metadata"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump.php b/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump.php deleted file mode 100644 index 75c8013c268..00000000000 --- a/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump.php +++ /dev/null @@ -1,191 +0,0 @@ -google.cloud.metastore.v1beta.MetadataImport.DatabaseDump - */ -class DatabaseDump extends \Google\Protobuf\Internal\Message -{ - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @deprecated - */ - protected $database_type = 0; - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - */ - private $gcs_uri = ''; - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @deprecated - */ - protected $source_database = ''; - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $database_type - * The type of the database. - * @type string $gcs_uri - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * @type string $source_database - * The name of the source database. - * @type int $type - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @return int - * @deprecated - */ - public function getDatabaseType() - { - @trigger_error('database_type is deprecated.', E_USER_DEPRECATED); - return $this->database_type; - } - - /** - * The type of the database. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport.DatabaseDump.DatabaseType database_type = 1 [deprecated = true]; - * @param int $var - * @return $this - * @deprecated - */ - public function setDatabaseType($var) - { - @trigger_error('database_type is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\MetadataImport\DatabaseDump\DatabaseType::class); - $this->database_type = $var; - - return $this; - } - - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - * @return string - */ - public function getGcsUri() - { - return $this->gcs_uri; - } - - /** - * A Cloud Storage object or folder URI that specifies the source from which - * to import metadata. It must begin with `gs://`. - * - * Generated from protobuf field string gcs_uri = 2; - * @param string $var - * @return $this - */ - public function setGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->gcs_uri = $var; - - return $this; - } - - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @return string - * @deprecated - */ - public function getSourceDatabase() - { - @trigger_error('source_database is deprecated.', E_USER_DEPRECATED); - return $this->source_database; - } - - /** - * The name of the source database. - * - * Generated from protobuf field string source_database = 3 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setSourceDatabase($var) - { - @trigger_error('source_database is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->source_database = $var; - - return $this; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Optional. The type of the database dump. If unspecified, defaults to - * `MYSQL`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DatabaseDumpSpec.Type type = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\DatabaseDumpSpec\Type::class); - $this->type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseDump::class, \Google\Cloud\Metastore\V1beta\MetadataImport_DatabaseDump::class); - diff --git a/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump/DatabaseType.php b/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump/DatabaseType.php deleted file mode 100644 index d217a3fd64c..00000000000 --- a/DataprocMetastore/src/V1beta/MetadataImport/DatabaseDump/DatabaseType.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.metastore.v1beta.MetadataImport.DatabaseDump.DatabaseType - */ -class DatabaseType -{ - /** - * The type of the source database is unknown. - * - * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; - */ - const DATABASE_TYPE_UNSPECIFIED = 0; - /** - * The type of the source database is MySQL. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - - private static $valueToName = [ - self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1beta\MetadataImport_DatabaseDump_DatabaseType::class); - diff --git a/DataprocMetastore/src/V1beta/MetadataImport/State.php b/DataprocMetastore/src/V1beta/MetadataImport/State.php deleted file mode 100644 index 317ecb49550..00000000000 --- a/DataprocMetastore/src/V1beta/MetadataImport/State.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.metastore.v1beta.MetadataImport.State - */ -class State -{ - /** - * The state of the metadata import is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata import is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata import completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata import is being updated. - * - * Generated from protobuf enum UPDATING = 3; - */ - const UPDATING = 3; - /** - * The metadata import failed, and attempted metadata changes were rolled - * back. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::UPDATING => 'UPDATING', - self::FAILED => 'FAILED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\MetadataImport_State::class); - diff --git a/DataprocMetastore/src/V1beta/MetadataImport_DatabaseDump.php b/DataprocMetastore/src/V1beta/MetadataImport_DatabaseDump.php deleted file mode 100644 index 244f5c88e38..00000000000 --- a/DataprocMetastore/src/V1beta/MetadataImport_DatabaseDump.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.MetadataIntegration - */ -class MetadataIntegration extends \Google\Protobuf\Internal\Message -{ - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataCatalogConfig data_catalog_config = 1; - */ - private $data_catalog_config = null; - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataplexConfig dataplex_config = 2; - */ - private $dataplex_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1beta\DataCatalogConfig $data_catalog_config - * The integration config for the Data Catalog service. - * @type \Google\Cloud\Metastore\V1beta\DataplexConfig $dataplex_config - * The integration config for the Dataplex service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataCatalogConfig data_catalog_config = 1; - * @return \Google\Cloud\Metastore\V1beta\DataCatalogConfig|null - */ - public function getDataCatalogConfig() - { - return $this->data_catalog_config; - } - - public function hasDataCatalogConfig() - { - return isset($this->data_catalog_config); - } - - public function clearDataCatalogConfig() - { - unset($this->data_catalog_config); - } - - /** - * The integration config for the Data Catalog service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataCatalogConfig data_catalog_config = 1; - * @param \Google\Cloud\Metastore\V1beta\DataCatalogConfig $var - * @return $this - */ - public function setDataCatalogConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\DataCatalogConfig::class); - $this->data_catalog_config = $var; - - return $this; - } - - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataplexConfig dataplex_config = 2; - * @return \Google\Cloud\Metastore\V1beta\DataplexConfig|null - */ - public function getDataplexConfig() - { - return $this->dataplex_config; - } - - public function hasDataplexConfig() - { - return isset($this->dataplex_config); - } - - public function clearDataplexConfig() - { - unset($this->dataplex_config); - } - - /** - * The integration config for the Dataplex service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.DataplexConfig dataplex_config = 2; - * @param \Google\Cloud\Metastore\V1beta\DataplexConfig $var - * @return $this - */ - public function setDataplexConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\DataplexConfig::class); - $this->dataplex_config = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/MetadataManagementActivity.php b/DataprocMetastore/src/V1beta/MetadataManagementActivity.php deleted file mode 100644 index 379ac929fda..00000000000 --- a/DataprocMetastore/src/V1beta/MetadataManagementActivity.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.metastore.v1beta.MetadataManagementActivity - */ -class MetadataManagementActivity extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $metadata_exports; - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $restores; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\MetadataExport>|\Google\Protobuf\Internal\RepeatedField $metadata_exports - * Output only. The latest metadata exports of the metastore service. - * @type array<\Google\Cloud\Metastore\V1beta\Restore>|\Google\Protobuf\Internal\RepeatedField $restores - * Output only. The latest restores of the metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMetadataExports() - { - return $this->metadata_exports; - } - - /** - * Output only. The latest metadata exports of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.MetadataExport metadata_exports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Metastore\V1beta\MetadataExport>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMetadataExports($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\MetadataExport::class); - $this->metadata_exports = $arr; - - return $this; - } - - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRestores() - { - return $this->restores; - } - - /** - * Output only. The latest restores of the metastore service. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.Restore restores = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Metastore\V1beta\Restore>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRestores($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\Restore::class); - $this->restores = $arr; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/MoveTableToDatabaseRequest.php b/DataprocMetastore/src/V1beta/MoveTableToDatabaseRequest.php deleted file mode 100644 index da536eb4a64..00000000000 --- a/DataprocMetastore/src/V1beta/MoveTableToDatabaseRequest.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.metastore.v1beta.MoveTableToDatabaseRequest - */ -class MoveTableToDatabaseRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $table_name = ''; - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $db_name = ''; - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $destination_db_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $table_name - * Required. The name of the table to be moved. - * @type string $db_name - * Required. The name of the database where the table resides. - * @type string $destination_db_name - * Required. The name of the database where the table should be moved. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to mutate - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTableName() - { - return $this->table_name; - } - - /** - * Required. The name of the table to be moved. - * - * Generated from protobuf field string table_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTableName($var) - { - GPBUtil::checkString($var, True); - $this->table_name = $var; - - return $this; - } - - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDbName() - { - return $this->db_name; - } - - /** - * Required. The name of the database where the table resides. - * - * Generated from protobuf field string db_name = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDbName($var) - { - GPBUtil::checkString($var, True); - $this->db_name = $var; - - return $this; - } - - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDestinationDbName() - { - return $this->destination_db_name; - } - - /** - * Required. The name of the database where the table should be moved. - * - * Generated from protobuf field string destination_db_name = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDestinationDbName($var) - { - GPBUtil::checkString($var, True); - $this->destination_db_name = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/MoveTableToDatabaseResponse.php b/DataprocMetastore/src/V1beta/MoveTableToDatabaseResponse.php deleted file mode 100644 index d37cfad3e62..00000000000 --- a/DataprocMetastore/src/V1beta/MoveTableToDatabaseResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.metastore.v1beta.MoveTableToDatabaseResponse - */ -class MoveTableToDatabaseResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/DataprocMetastore/src/V1beta/NetworkConfig.php b/DataprocMetastore/src/V1beta/NetworkConfig.php deleted file mode 100644 index 731fe07d5d2..00000000000 --- a/DataprocMetastore/src/V1beta/NetworkConfig.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.metastore.v1beta.NetworkConfig - */ -class NetworkConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $consumers; - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - */ - private $custom_routes_enabled = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Metastore\V1beta\NetworkConfig\Consumer>|\Google\Protobuf\Internal\RepeatedField $consumers - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * @type bool $custom_routes_enabled - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConsumers() - { - return $this->consumers; - } - - /** - * Immutable. The consumer-side network configuration for the Dataproc - * Metastore instance. - * - * Generated from protobuf field repeated .google.cloud.metastore.v1beta.NetworkConfig.Consumer consumers = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param array<\Google\Cloud\Metastore\V1beta\NetworkConfig\Consumer>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConsumers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Metastore\V1beta\NetworkConfig\Consumer::class); - $this->consumers = $arr; - - return $this; - } - - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - * @return bool - */ - public function getCustomRoutesEnabled() - { - return $this->custom_routes_enabled; - } - - /** - * Enables custom routes to be imported and exported for the Dataproc - * Metastore service's peered VPC network. - * - * Generated from protobuf field bool custom_routes_enabled = 2; - * @param bool $var - * @return $this - */ - public function setCustomRoutesEnabled($var) - { - GPBUtil::checkBool($var); - $this->custom_routes_enabled = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/NetworkConfig/Consumer.php b/DataprocMetastore/src/V1beta/NetworkConfig/Consumer.php deleted file mode 100644 index 96995a72031..00000000000 --- a/DataprocMetastore/src/V1beta/NetworkConfig/Consumer.php +++ /dev/null @@ -1,173 +0,0 @@ -google.cloud.metastore.v1beta.NetworkConfig.Consumer - */ -class Consumer extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $endpoint_location = ''; - protected $vpc_resource; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subnetwork - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * @type string $endpoint_uri - * Output only. The URI of the endpoint used to access the metastore - * service. - * @type string $endpoint_location - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * - * Generated from protobuf field string subnetwork = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @return string - */ - public function getSubnetwork() - { - return $this->readOneof(1); - } - - public function hasSubnetwork() - { - return $this->hasOneof(1); - } - - /** - * Immutable. The subnetwork of the customer project from which an IP - * address is reserved and used as the Dataproc Metastore service's - * endpoint. It is accessible to hosts in the subnet and to all - * hosts in a subnet in the same region and same network. There must - * be at least one IP address available in the subnet's primary range. The - * subnet is specified in the following form: - * `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}` - * - * Generated from protobuf field string subnetwork = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubnetwork($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The URI of the endpoint used to access the metastore - * service. - * - * Generated from protobuf field string endpoint_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getEndpointLocation() - { - return $this->endpoint_location; - } - - /** - * Output only. The location of the endpoint URI. Format: - * `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string endpoint_location = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setEndpointLocation($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_location = $var; - - return $this; - } - - /** - * @return string - */ - public function getVpcResource() - { - return $this->whichOneof("vpc_resource"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Consumer::class, \Google\Cloud\Metastore\V1beta\NetworkConfig_Consumer::class); - diff --git a/DataprocMetastore/src/V1beta/NetworkConfig_Consumer.php b/DataprocMetastore/src/V1beta/NetworkConfig_Consumer.php deleted file mode 100644 index 8695cc88bca..00000000000 --- a/DataprocMetastore/src/V1beta/NetworkConfig_Consumer.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $status_message = ''; - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the caller has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/QueryMetadataRequest.php b/DataprocMetastore/src/V1beta/QueryMetadataRequest.php deleted file mode 100644 index c5b323e5513..00000000000 --- a/DataprocMetastore/src/V1beta/QueryMetadataRequest.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.metastore.v1beta.QueryMetadataRequest - */ -class QueryMetadataRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $query = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $query - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to query - * metadata, in the following format: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Required. A read-only SQL query to execute against the metadata database. - * The query cannot change or mutate the data. - * - * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/QueryMetadataResponse.php b/DataprocMetastore/src/V1beta/QueryMetadataResponse.php deleted file mode 100644 index 4670e0d803d..00000000000 --- a/DataprocMetastore/src/V1beta/QueryMetadataResponse.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.metastore.v1beta.QueryMetadataResponse - */ -class QueryMetadataResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - */ - private $result_manifest_uri = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $result_manifest_uri - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - * @return string - */ - public function getResultManifestUri() - { - return $this->result_manifest_uri; - } - - /** - * The manifest URI is link to a JSON instance in Cloud Storage. - * This instance manifests immediately along with QueryMetadataResponse. The - * content of the URI is not retriable until the long-running operation query - * against the metadata finishes. - * - * Generated from protobuf field string result_manifest_uri = 1; - * @param string $var - * @return $this - */ - public function setResultManifestUri($var) - { - GPBUtil::checkString($var, True); - $this->result_manifest_uri = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/RemoveIamPolicyRequest.php b/DataprocMetastore/src/V1beta/RemoveIamPolicyRequest.php deleted file mode 100644 index 2718519aea4..00000000000 --- a/DataprocMetastore/src/V1beta/RemoveIamPolicyRequest.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.metastore.v1beta.RemoveIamPolicyRequest - */ -class RemoveIamPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $resource = ''; - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $asynchronous = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * @type bool $asynchronous - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * Required. The relative resource name of the dataplane resource to remove - * IAM policy, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}` - * or - * `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`. - * - * Generated from protobuf field string resource = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAsynchronous() - { - return $this->asynchronous; - } - - /** - * Optional. Removes IAM policy attached to database or table asynchronously - * when it is set. The default is false. - * - * Generated from protobuf field bool asynchronous = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAsynchronous($var) - { - GPBUtil::checkBool($var); - $this->asynchronous = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/RemoveIamPolicyResponse.php b/DataprocMetastore/src/V1beta/RemoveIamPolicyResponse.php deleted file mode 100644 index 05886a2c33d..00000000000 --- a/DataprocMetastore/src/V1beta/RemoveIamPolicyResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.metastore.v1beta.RemoveIamPolicyResponse - */ -class RemoveIamPolicyResponse extends \Google\Protobuf\Internal\Message -{ - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - */ - private $success = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $success - * True if the policy is successfully removed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - * @return bool - */ - public function getSuccess() - { - return $this->success; - } - - /** - * True if the policy is successfully removed. - * - * Generated from protobuf field bool success = 1; - * @param bool $var - * @return $this - */ - public function setSuccess($var) - { - GPBUtil::checkBool($var); - $this->success = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Restore.php b/DataprocMetastore/src/V1beta/Restore.php deleted file mode 100644 index 0db4bba98f8..00000000000 --- a/DataprocMetastore/src/V1beta/Restore.php +++ /dev/null @@ -1,269 +0,0 @@ -google.cloud.metastore.v1beta.Restore - */ -class Restore extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_time = null; - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $end_time = null; - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $backup = ''; - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $type = 0; - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $details = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Output only. The time when the restore started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time when the restore ended. - * @type int $state - * Output only. The current state of the restore. - * @type string $backup - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type int $type - * Output only. The type of restore. - * @type string $details - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. The time when the restore started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time when the restore ended. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Restore\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getBackup() - { - return $this->backup; - } - - /** - * Output only. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkString($var, True); - $this->backup = $var; - - return $this; - } - - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Output only. The type of restore. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Restore\RestoreType::class); - $this->type = $var; - - return $this; - } - - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDetails() - { - return $this->details; - } - - /** - * Output only. The restore details containing the revision of the service to - * be restored to, in format of JSON. - * - * Generated from protobuf field string details = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDetails($var) - { - GPBUtil::checkString($var, True); - $this->details = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Restore/RestoreType.php b/DataprocMetastore/src/V1beta/Restore/RestoreType.php deleted file mode 100644 index 72d5ccd06ea..00000000000 --- a/DataprocMetastore/src/V1beta/Restore/RestoreType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1beta.Restore.RestoreType - */ -class RestoreType -{ - /** - * The restore type is unknown. - * - * Generated from protobuf enum RESTORE_TYPE_UNSPECIFIED = 0; - */ - const RESTORE_TYPE_UNSPECIFIED = 0; - /** - * The service's metadata and configuration are restored. - * - * Generated from protobuf enum FULL = 1; - */ - const FULL = 1; - /** - * Only the service's metadata is restored. - * - * Generated from protobuf enum METADATA_ONLY = 2; - */ - const METADATA_ONLY = 2; - - private static $valueToName = [ - self::RESTORE_TYPE_UNSPECIFIED => 'RESTORE_TYPE_UNSPECIFIED', - self::FULL => 'FULL', - self::METADATA_ONLY => 'METADATA_ONLY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RestoreType::class, \Google\Cloud\Metastore\V1beta\Restore_RestoreType::class); - diff --git a/DataprocMetastore/src/V1beta/Restore/State.php b/DataprocMetastore/src/V1beta/Restore/State.php deleted file mode 100644 index 9d8d0bc75bf..00000000000 --- a/DataprocMetastore/src/V1beta/Restore/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.metastore.v1beta.Restore.State - */ -class State -{ - /** - * The state of the metadata restore is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metadata restore is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The metadata restore completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The metadata restore failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The metadata restore is cancelled. - * - * Generated from protobuf enum CANCELLED = 4; - */ - const CANCELLED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\Restore_State::class); - diff --git a/DataprocMetastore/src/V1beta/RestoreServiceRequest.php b/DataprocMetastore/src/V1beta/RestoreServiceRequest.php deleted file mode 100644 index 042ed64e956..00000000000 --- a/DataprocMetastore/src/V1beta/RestoreServiceRequest.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.metastore.v1beta.RestoreServiceRequest - */ -class RestoreServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $service = ''; - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $backup = ''; - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $restore_type = 0; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * @type string $backup - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * @type int $restore_type - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. The relative resource name of the metastore service to run - * restore, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getBackup() - { - return $this->backup; - } - - /** - * Required. The relative resource name of the metastore service backup to - * restore from, in the following form: - * `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`. - * - * Generated from protobuf field string backup = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkString($var, True); - $this->backup = $var; - - return $this; - } - - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getRestoreType() - { - return $this->restore_type; - } - - /** - * Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Restore.RestoreType restore_type = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setRestoreType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Restore\RestoreType::class); - $this->restore_type = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/Restore_RestoreType.php b/DataprocMetastore/src/V1beta/Restore_RestoreType.php deleted file mode 100644 index 6dceae9293e..00000000000 --- a/DataprocMetastore/src/V1beta/Restore_RestoreType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.ScalingConfig - */ -class ScalingConfig extends \Google\Protobuf\Internal\Message -{ - protected $scaling_model; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $instance_size - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * @type float $scaling_factor - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * - * Generated from protobuf field .google.cloud.metastore.v1beta.ScalingConfig.InstanceSize instance_size = 1; - * @return int - */ - public function getInstanceSize() - { - return $this->readOneof(1); - } - - public function hasInstanceSize() - { - return $this->hasOneof(1); - } - - /** - * An enum of readable instance sizes, with each instance size mapping to a - * float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1)) - * - * Generated from protobuf field .google.cloud.metastore.v1beta.ScalingConfig.InstanceSize instance_size = 1; - * @param int $var - * @return $this - */ - public function setInstanceSize($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\ScalingConfig\InstanceSize::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * - * Generated from protobuf field float scaling_factor = 2; - * @return float - */ - public function getScalingFactor() - { - return $this->readOneof(2); - } - - public function hasScalingFactor() - { - return $this->hasOneof(2); - } - - /** - * Scaling factor, increments of 0.1 for values less than 1.0, and - * increments of 1.0 for values greater than 1.0. - * - * Generated from protobuf field float scaling_factor = 2; - * @param float $var - * @return $this - */ - public function setScalingFactor($var) - { - GPBUtil::checkFloat($var); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getScalingModel() - { - return $this->whichOneof("scaling_model"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/ScalingConfig/InstanceSize.php b/DataprocMetastore/src/V1beta/ScalingConfig/InstanceSize.php deleted file mode 100644 index 5b62c489ed9..00000000000 --- a/DataprocMetastore/src/V1beta/ScalingConfig/InstanceSize.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.metastore.v1beta.ScalingConfig.InstanceSize - */ -class InstanceSize -{ - /** - * Unspecified instance size - * - * Generated from protobuf enum INSTANCE_SIZE_UNSPECIFIED = 0; - */ - const INSTANCE_SIZE_UNSPECIFIED = 0; - /** - * Extra small instance size, maps to a scaling factor of 0.1. - * - * Generated from protobuf enum EXTRA_SMALL = 1; - */ - const EXTRA_SMALL = 1; - /** - * Small instance size, maps to a scaling factor of 0.5. - * - * Generated from protobuf enum SMALL = 2; - */ - const SMALL = 2; - /** - * Medium instance size, maps to a scaling factor of 1.0. - * - * Generated from protobuf enum MEDIUM = 3; - */ - const MEDIUM = 3; - /** - * Large instance size, maps to a scaling factor of 3.0. - * - * Generated from protobuf enum LARGE = 4; - */ - const LARGE = 4; - /** - * Extra large instance size, maps to a scaling factor of 6.0. - * - * Generated from protobuf enum EXTRA_LARGE = 5; - */ - const EXTRA_LARGE = 5; - - private static $valueToName = [ - self::INSTANCE_SIZE_UNSPECIFIED => 'INSTANCE_SIZE_UNSPECIFIED', - self::EXTRA_SMALL => 'EXTRA_SMALL', - self::SMALL => 'SMALL', - self::MEDIUM => 'MEDIUM', - self::LARGE => 'LARGE', - self::EXTRA_LARGE => 'EXTRA_LARGE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InstanceSize::class, \Google\Cloud\Metastore\V1beta\ScalingConfig_InstanceSize::class); - diff --git a/DataprocMetastore/src/V1beta/ScalingConfig_InstanceSize.php b/DataprocMetastore/src/V1beta/ScalingConfig_InstanceSize.php deleted file mode 100644 index 3fe30aa634c..00000000000 --- a/DataprocMetastore/src/V1beta/ScalingConfig_InstanceSize.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.Secret - */ -class Secret extends \Google\Protobuf\Internal\Message -{ - protected $value; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $cloud_secret - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * - * Generated from protobuf field string cloud_secret = 2; - * @return string - */ - public function getCloudSecret() - { - return $this->readOneof(2); - } - - public function hasCloudSecret() - { - return $this->hasOneof(2); - } - - /** - * The relative resource name of a Secret Manager secret version, in the - * following form: - * `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`. - * - * Generated from protobuf field string cloud_secret = 2; - * @param string $var - * @return $this - */ - public function setCloudSecret($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getValue() - { - return $this->whichOneof("value"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/Service.php b/DataprocMetastore/src/V1beta/Service.php deleted file mode 100644 index e96c0eb1bb5..00000000000 --- a/DataprocMetastore/src/V1beta/Service.php +++ /dev/null @@ -1,942 +0,0 @@ -google.cloud.metastore.v1beta.Service - */ -class Service extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $name = ''; - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - */ - private $network = ''; - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $endpoint_uri = ''; - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - */ - private $port = 0; - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state_message = ''; - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $artifact_gcs_uri = ''; - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.Tier tier = 13; - */ - private $tier = 0; - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataIntegration metadata_integration = 14; - */ - private $metadata_integration = null; - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MaintenanceWindow maintenance_window = 15; - */ - private $maintenance_window = null; - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $uid = ''; - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $metadata_management_activity = null; - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $release_channel = 0; - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $encryption_config = null; - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 21; - */ - private $network_config = null; - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $database_type = 0; - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig telemetry_config = 23; - */ - private $telemetry_config = null; - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.ScalingConfig scaling_config = 24; - */ - private $scaling_config = null; - protected $metastore_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig $hive_metastore_config - * Configuration information specific to running Hive metastore - * software as the metastore service. - * @type string $name - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time when the metastore service was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time when the metastore service was last updated. - * @type array|\Google\Protobuf\Internal\MapField $labels - * User-defined labels for the metastore service. - * @type string $network - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * @type string $endpoint_uri - * Output only. The URI of the endpoint used to access the metastore service. - * @type int $port - * The TCP port at which the metastore service is reached. Default: 9083. - * @type int $state - * Output only. The current state of the metastore service. - * @type string $state_message - * Output only. Additional information about the current state of the - * metastore service, if available. - * @type string $artifact_gcs_uri - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * @type int $tier - * The tier of the service. - * @type \Google\Cloud\Metastore\V1beta\MetadataIntegration $metadata_integration - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * @type \Google\Cloud\Metastore\V1beta\MaintenanceWindow $maintenance_window - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * @type string $uid - * Output only. The globally unique resource identifier of the metastore - * service. - * @type \Google\Cloud\Metastore\V1beta\MetadataManagementActivity $metadata_management_activity - * Output only. The metadata management activities of the metastore service. - * @type int $release_channel - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * @type \Google\Cloud\Metastore\V1beta\EncryptionConfig $encryption_config - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * @type \Google\Cloud\Metastore\V1beta\NetworkConfig $network_config - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * @type int $database_type - * Immutable. The database type that the Metastore service stores its data. - * @type \Google\Cloud\Metastore\V1beta\TelemetryConfig $telemetry_config - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * @type \Google\Cloud\Metastore\V1beta\ScalingConfig $scaling_config - * Scaling configuration of the metastore service. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Configuration information specific to running Hive metastore - * software as the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.HiveMetastoreConfig hive_metastore_config = 5; - * @return \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig|null - */ - public function getHiveMetastoreConfig() - { - return $this->readOneof(5); - } - - public function hasHiveMetastoreConfig() - { - return $this->hasOneof(5); - } - - /** - * Configuration information specific to running Hive metastore - * software as the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.HiveMetastoreConfig hive_metastore_config = 5; - * @param \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig $var - * @return $this - */ - public function setHiveMetastoreConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\HiveMetastoreConfig::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The relative resource name of the metastore service, in the - * following format: - * `projects/{project_number}/locations/{location_id}/services/{service_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time when the metastore service was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time when the metastore service was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * User-defined labels for the metastore service. - * - * Generated from protobuf field map labels = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Immutable. The relative resource name of the VPC network on which the - * instance can be accessed. It is specified in the following form: - * `projects/{project_number}/global/networks/{network_id}`. - * - * Generated from protobuf field string network = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEndpointUri() - { - return $this->endpoint_uri; - } - - /** - * Output only. The URI of the endpoint used to access the metastore service. - * - * Generated from protobuf field string endpoint_uri = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEndpointUri($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_uri = $var; - - return $this; - } - - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * The TCP port at which the metastore service is reached. Default: 9083. - * - * Generated from protobuf field int32 port = 9; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Service\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * Output only. Additional information about the current state of the - * metastore service, if available. - * - * Generated from protobuf field string state_message = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getArtifactGcsUri() - { - return $this->artifact_gcs_uri; - } - - /** - * Output only. A Cloud Storage URI (starting with `gs://`) that specifies - * where artifacts related to the metastore service are stored. - * - * Generated from protobuf field string artifact_gcs_uri = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setArtifactGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->artifact_gcs_uri = $var; - - return $this; - } - - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.Tier tier = 13; - * @return int - */ - public function getTier() - { - return $this->tier; - } - - /** - * The tier of the service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.Tier tier = 13; - * @param int $var - * @return $this - */ - public function setTier($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Service\Tier::class); - $this->tier = $var; - - return $this; - } - - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataIntegration metadata_integration = 14; - * @return \Google\Cloud\Metastore\V1beta\MetadataIntegration|null - */ - public function getMetadataIntegration() - { - return $this->metadata_integration; - } - - public function hasMetadataIntegration() - { - return isset($this->metadata_integration); - } - - public function clearMetadataIntegration() - { - unset($this->metadata_integration); - } - - /** - * The setting that defines how metastore metadata should be integrated with - * external services and systems. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataIntegration metadata_integration = 14; - * @param \Google\Cloud\Metastore\V1beta\MetadataIntegration $var - * @return $this - */ - public function setMetadataIntegration($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MetadataIntegration::class); - $this->metadata_integration = $var; - - return $this; - } - - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MaintenanceWindow maintenance_window = 15; - * @return \Google\Cloud\Metastore\V1beta\MaintenanceWindow|null - */ - public function getMaintenanceWindow() - { - return $this->maintenance_window; - } - - public function hasMaintenanceWindow() - { - return isset($this->maintenance_window); - } - - public function clearMaintenanceWindow() - { - unset($this->maintenance_window); - } - - /** - * The one hour maintenance window of the metastore service. This specifies - * when the service can be restarted for maintenance purposes in UTC time. - * Maintenance window is not needed for services with the SPANNER - * database type. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MaintenanceWindow maintenance_window = 15; - * @param \Google\Cloud\Metastore\V1beta\MaintenanceWindow $var - * @return $this - */ - public function setMaintenanceWindow($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MaintenanceWindow::class); - $this->maintenance_window = $var; - - return $this; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The globally unique resource identifier of the metastore - * service. - * - * Generated from protobuf field string uid = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Metastore\V1beta\MetadataManagementActivity|null - */ - public function getMetadataManagementActivity() - { - return $this->metadata_management_activity; - } - - public function hasMetadataManagementActivity() - { - return isset($this->metadata_management_activity); - } - - public function clearMetadataManagementActivity() - { - unset($this->metadata_management_activity); - } - - /** - * Output only. The metadata management activities of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataManagementActivity metadata_management_activity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Metastore\V1beta\MetadataManagementActivity $var - * @return $this - */ - public function setMetadataManagementActivity($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MetadataManagementActivity::class); - $this->metadata_management_activity = $var; - - return $this; - } - - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getReleaseChannel() - { - return $this->release_channel; - } - - /** - * Immutable. The release channel of the service. - * If unspecified, defaults to `STABLE`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.ReleaseChannel release_channel = 19 [(.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setReleaseChannel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Service\ReleaseChannel::class); - $this->release_channel = $var; - - return $this; - } - - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\Metastore\V1beta\EncryptionConfig|null - */ - public function getEncryptionConfig() - { - return $this->encryption_config; - } - - public function hasEncryptionConfig() - { - return isset($this->encryption_config); - } - - public function clearEncryptionConfig() - { - unset($this->encryption_config); - } - - /** - * Immutable. Information used to configure the Dataproc Metastore service to - * encrypt customer data at rest. Cannot be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.EncryptionConfig encryption_config = 20 [(.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\Metastore\V1beta\EncryptionConfig $var - * @return $this - */ - public function setEncryptionConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\EncryptionConfig::class); - $this->encryption_config = $var; - - return $this; - } - - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 21; - * @return \Google\Cloud\Metastore\V1beta\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * The configuration specifying the network settings for the - * Dataproc Metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.NetworkConfig network_config = 21; - * @param \Google\Cloud\Metastore\V1beta\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getDatabaseType() - { - return $this->database_type; - } - - /** - * Immutable. The database type that the Metastore service stores its data. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service.DatabaseType database_type = 22 [(.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setDatabaseType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\Service\DatabaseType::class); - $this->database_type = $var; - - return $this; - } - - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig telemetry_config = 23; - * @return \Google\Cloud\Metastore\V1beta\TelemetryConfig|null - */ - public function getTelemetryConfig() - { - return $this->telemetry_config; - } - - public function hasTelemetryConfig() - { - return isset($this->telemetry_config); - } - - public function clearTelemetryConfig() - { - unset($this->telemetry_config); - } - - /** - * The configuration specifying telemetry settings for the Dataproc Metastore - * service. If unspecified defaults to `JSON`. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig telemetry_config = 23; - * @param \Google\Cloud\Metastore\V1beta\TelemetryConfig $var - * @return $this - */ - public function setTelemetryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\TelemetryConfig::class); - $this->telemetry_config = $var; - - return $this; - } - - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.ScalingConfig scaling_config = 24; - * @return \Google\Cloud\Metastore\V1beta\ScalingConfig|null - */ - public function getScalingConfig() - { - return $this->scaling_config; - } - - public function hasScalingConfig() - { - return isset($this->scaling_config); - } - - public function clearScalingConfig() - { - unset($this->scaling_config); - } - - /** - * Scaling configuration of the metastore service. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.ScalingConfig scaling_config = 24; - * @param \Google\Cloud\Metastore\V1beta\ScalingConfig $var - * @return $this - */ - public function setScalingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\ScalingConfig::class); - $this->scaling_config = $var; - - return $this; - } - - /** - * @return string - */ - public function getMetastoreConfig() - { - return $this->whichOneof("metastore_config"); - } - -} - diff --git a/DataprocMetastore/src/V1beta/Service/DatabaseType.php b/DataprocMetastore/src/V1beta/Service/DatabaseType.php deleted file mode 100644 index d4c91edc926..00000000000 --- a/DataprocMetastore/src/V1beta/Service/DatabaseType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.metastore.v1beta.Service.DatabaseType - */ -class DatabaseType -{ - /** - * The DATABASE_TYPE is not set. - * - * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; - */ - const DATABASE_TYPE_UNSPECIFIED = 0; - /** - * MySQL is used to persist the metastore data. - * - * Generated from protobuf enum MYSQL = 1; - */ - const MYSQL = 1; - /** - * Spanner is used to persist the metastore data. - * - * Generated from protobuf enum SPANNER = 2; - */ - const SPANNER = 2; - - private static $valueToName = [ - self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', - self::MYSQL => 'MYSQL', - self::SPANNER => 'SPANNER', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Metastore\V1beta\Service_DatabaseType::class); - diff --git a/DataprocMetastore/src/V1beta/Service/ReleaseChannel.php b/DataprocMetastore/src/V1beta/Service/ReleaseChannel.php deleted file mode 100644 index 1faf78badb2..00000000000 --- a/DataprocMetastore/src/V1beta/Service/ReleaseChannel.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.metastore.v1beta.Service.ReleaseChannel - */ -class ReleaseChannel -{ - /** - * Release channel is not specified. - * - * Generated from protobuf enum RELEASE_CHANNEL_UNSPECIFIED = 0; - */ - const RELEASE_CHANNEL_UNSPECIFIED = 0; - /** - * The `CANARY` release channel contains the newest features, which may be - * unstable and subject to unresolved issues with no known workarounds. - * Services using the `CANARY` release channel are not subject to any SLAs. - * - * Generated from protobuf enum CANARY = 1; - */ - const CANARY = 1; - /** - * The `STABLE` release channel contains features that are considered stable - * and have been validated for production use. - * - * Generated from protobuf enum STABLE = 2; - */ - const STABLE = 2; - - private static $valueToName = [ - self::RELEASE_CHANNEL_UNSPECIFIED => 'RELEASE_CHANNEL_UNSPECIFIED', - self::CANARY => 'CANARY', - self::STABLE => 'STABLE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReleaseChannel::class, \Google\Cloud\Metastore\V1beta\Service_ReleaseChannel::class); - diff --git a/DataprocMetastore/src/V1beta/Service/State.php b/DataprocMetastore/src/V1beta/Service/State.php deleted file mode 100644 index fb8f23bdab4..00000000000 --- a/DataprocMetastore/src/V1beta/Service/State.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.metastore.v1beta.Service.State - */ -class State -{ - /** - * The state of the metastore service is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The metastore service is in the process of being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The metastore service is running and ready to serve queries. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The metastore service is entering suspension. Its query-serving - * availability may cease unexpectedly. - * - * Generated from protobuf enum SUSPENDING = 3; - */ - const SUSPENDING = 3; - /** - * The metastore service is suspended and unable to serve queries. - * - * Generated from protobuf enum SUSPENDED = 4; - */ - const SUSPENDED = 4; - /** - * The metastore service is being updated. It remains usable but cannot - * accept additional update requests or be deleted at this time. - * - * Generated from protobuf enum UPDATING = 5; - */ - const UPDATING = 5; - /** - * The metastore service is undergoing deletion. It cannot be used. - * - * Generated from protobuf enum DELETING = 6; - */ - const DELETING = 6; - /** - * The metastore service has encountered an error and cannot be used. The - * metastore service should be deleted. - * - * Generated from protobuf enum ERROR = 7; - */ - const ERROR = 7; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::SUSPENDING => 'SUSPENDING', - self::SUSPENDED => 'SUSPENDED', - self::UPDATING => 'UPDATING', - self::DELETING => 'DELETING', - self::ERROR => 'ERROR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Metastore\V1beta\Service_State::class); - diff --git a/DataprocMetastore/src/V1beta/Service/Tier.php b/DataprocMetastore/src/V1beta/Service/Tier.php deleted file mode 100644 index efef7c59b6c..00000000000 --- a/DataprocMetastore/src/V1beta/Service/Tier.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.metastore.v1beta.Service.Tier - */ -class Tier -{ - /** - * The tier is not set. - * - * Generated from protobuf enum TIER_UNSPECIFIED = 0; - */ - const TIER_UNSPECIFIED = 0; - /** - * The developer tier provides limited scalability and no fault tolerance. - * Good for low-cost proof-of-concept. - * - * Generated from protobuf enum DEVELOPER = 1; - */ - const DEVELOPER = 1; - /** - * The enterprise tier provides multi-zone high availability, and sufficient - * scalability for enterprise-level Dataproc Metastore workloads. - * - * Generated from protobuf enum ENTERPRISE = 3; - */ - const ENTERPRISE = 3; - - private static $valueToName = [ - self::TIER_UNSPECIFIED => 'TIER_UNSPECIFIED', - self::DEVELOPER => 'DEVELOPER', - self::ENTERPRISE => 'ENTERPRISE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Tier::class, \Google\Cloud\Metastore\V1beta\Service_Tier::class); - diff --git a/DataprocMetastore/src/V1beta/Service_DatabaseType.php b/DataprocMetastore/src/V1beta/Service_DatabaseType.php deleted file mode 100644 index 03bd8f54694..00000000000 --- a/DataprocMetastore/src/V1beta/Service_DatabaseType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.TelemetryConfig - */ -class TelemetryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig.LogFormat log_format = 1; - */ - private $log_format = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $log_format - * The output format of the Dataproc Metastore service's logs. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig.LogFormat log_format = 1; - * @return int - */ - public function getLogFormat() - { - return $this->log_format; - } - - /** - * The output format of the Dataproc Metastore service's logs. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.TelemetryConfig.LogFormat log_format = 1; - * @param int $var - * @return $this - */ - public function setLogFormat($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Metastore\V1beta\TelemetryConfig\LogFormat::class); - $this->log_format = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/TelemetryConfig/LogFormat.php b/DataprocMetastore/src/V1beta/TelemetryConfig/LogFormat.php deleted file mode 100644 index 31a5ac10376..00000000000 --- a/DataprocMetastore/src/V1beta/TelemetryConfig/LogFormat.php +++ /dev/null @@ -1,62 +0,0 @@ -google.cloud.metastore.v1beta.TelemetryConfig.LogFormat - */ -class LogFormat -{ - /** - * The LOG_FORMAT is not set. - * - * Generated from protobuf enum LOG_FORMAT_UNSPECIFIED = 0; - */ - const LOG_FORMAT_UNSPECIFIED = 0; - /** - * Logging output uses the legacy `textPayload` format. - * - * Generated from protobuf enum LEGACY = 1; - */ - const LEGACY = 1; - /** - * Logging output uses the `jsonPayload` format. - * - * Generated from protobuf enum JSON = 2; - */ - const JSON = 2; - - private static $valueToName = [ - self::LOG_FORMAT_UNSPECIFIED => 'LOG_FORMAT_UNSPECIFIED', - self::LEGACY => 'LEGACY', - self::JSON => 'JSON', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LogFormat::class, \Google\Cloud\Metastore\V1beta\TelemetryConfig_LogFormat::class); - diff --git a/DataprocMetastore/src/V1beta/TelemetryConfig_LogFormat.php b/DataprocMetastore/src/V1beta/TelemetryConfig_LogFormat.php deleted file mode 100644 index 86b110a5203..00000000000 --- a/DataprocMetastore/src/V1beta/TelemetryConfig_LogFormat.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.metastore.v1beta.UpdateFederationRequest - */ -class UpdateFederationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $federation = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1beta\Federation $federation - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\MetastoreFederation::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore federation resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\Federation|null - */ - public function getFederation() - { - return $this->federation; - } - - public function hasFederation() - { - return isset($this->federation); - } - - public function clearFederation() - { - unset($this->federation); - } - - /** - * Required. The metastore federation to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore federation's `name` field is used to identify the - * metastore service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Federation federation = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\Federation $var - * @return $this - */ - public function setFederation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Federation::class); - $this->federation = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/UpdateMetadataImportRequest.php b/DataprocMetastore/src/V1beta/UpdateMetadataImportRequest.php deleted file mode 100644 index 40838f60202..00000000000 --- a/DataprocMetastore/src/V1beta/UpdateMetadataImportRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.metastore.v1beta.UpdateMetadataImportRequest - */ -class UpdateMetadataImportRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $metadata_import = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1beta\MetadataImport $metadata_import - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metadata import resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\MetadataImport|null - */ - public function getMetadataImport() - { - return $this->metadata_import; - } - - public function hasMetadataImport() - { - return isset($this->metadata_import); - } - - public function clearMetadataImport() - { - unset($this->metadata_import); - } - - /** - * Required. The metadata import to update. The server only merges fields - * in the import if they are specified in `update_mask`. - * The metadata import's `name` field is used to identify the metastore - * import to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.MetadataImport metadata_import = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\MetadataImport $var - * @return $this - */ - public function setMetadataImport($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\MetadataImport::class); - $this->metadata_import = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/UpdateServiceRequest.php b/DataprocMetastore/src/V1beta/UpdateServiceRequest.php deleted file mode 100644 index cd0652cd46f..00000000000 --- a/DataprocMetastore/src/V1beta/UpdateServiceRequest.php +++ /dev/null @@ -1,216 +0,0 @@ -google.cloud.metastore.v1beta.UpdateServiceRequest - */ -class UpdateServiceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $service = null; - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * @type \Google\Cloud\Metastore\V1beta\Service $service - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * @type string $request_id - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Metastore\V1Beta\Metastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. A field mask used to specify the fields to be overwritten in the - * metastore service resource by the update. - * Fields specified in the `update_mask` are relative to the resource (not - * to the full request). A field is overwritten if it is in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Metastore\V1beta\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The metastore service to update. The server only merges fields - * in the service if they are specified in `update_mask`. - * The metastore service's `name` field is used to identify the metastore - * service to be updated. - * - * Generated from protobuf field .google.cloud.metastore.v1beta.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Metastore\V1beta\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Metastore\V1beta\Service::class); - $this->service = $var; - - return $this; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. A request ID. Specify a unique request ID to allow the server to - * ignore the request if it has completed. The server will ignore subsequent - * requests that provide a duplicate request ID for at least 60 minutes after - * the first request. - * For example, if an initial request times out, followed by another request - * with the same request ID, the server ignores the second request to prevent - * the creation of duplicate commitments. - * The request ID must be a valid - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) - * A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. - * - * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/DataprocMetastore/src/V1beta/gapic_metadata.json b/DataprocMetastore/src/V1beta/gapic_metadata.json deleted file mode 100644 index 1e01d02ccb3..00000000000 --- a/DataprocMetastore/src/V1beta/gapic_metadata.json +++ /dev/null @@ -1,197 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.metastore.v1beta", - "libraryPackage": "Google\\Cloud\\Metastore\\V1beta", - "services": { - "DataprocMetastore": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreGapicClient", - "rpcs": { - "AlterMetadataResourceLocation": { - "methods": [ - "alterMetadataResourceLocation" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "CreateMetadataImport": { - "methods": [ - "createMetadataImport" - ] - }, - "CreateService": { - "methods": [ - "createService" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "DeleteService": { - "methods": [ - "deleteService" - ] - }, - "ExportMetadata": { - "methods": [ - "exportMetadata" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GetMetadataImport": { - "methods": [ - "getMetadataImport" - ] - }, - "GetService": { - "methods": [ - "getService" - ] - }, - "ListBackups": { - "methods": [ - "listBackups" - ] - }, - "ListMetadataImports": { - "methods": [ - "listMetadataImports" - ] - }, - "ListServices": { - "methods": [ - "listServices" - ] - }, - "MoveTableToDatabase": { - "methods": [ - "moveTableToDatabase" - ] - }, - "QueryMetadata": { - "methods": [ - "queryMetadata" - ] - }, - "RemoveIamPolicy": { - "methods": [ - "removeIamPolicy" - ] - }, - "RestoreService": { - "methods": [ - "restoreService" - ] - }, - "UpdateMetadataImport": { - "methods": [ - "updateMetadataImport" - ] - }, - "UpdateService": { - "methods": [ - "updateService" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - }, - "DataprocMetastoreFederation": { - "clients": { - "grpc": { - "libraryClient": "DataprocMetastoreFederationGapicClient", - "rpcs": { - "CreateFederation": { - "methods": [ - "createFederation" - ] - }, - "DeleteFederation": { - "methods": [ - "deleteFederation" - ] - }, - "GetFederation": { - "methods": [ - "getFederation" - ] - }, - "ListFederations": { - "methods": [ - "listFederations" - ] - }, - "UpdateFederation": { - "methods": [ - "updateFederation" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_client_config.json b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_client_config.json deleted file mode 100644 index f641af0265f..00000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_client_config.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "interfaces": { - "google.cloud.metastore.v1beta.DataprocMetastore": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "AlterMetadataResourceLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ExportMetadata": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetBackup": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetService": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListMetadataImports": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListServices": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "MoveTableToDatabase": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "QueryMetadata": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RemoveIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RestoreService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateMetadataImport": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateService": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_descriptor_config.php b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_descriptor_config.php deleted file mode 100644 index 9a06002101d..00000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_descriptor_config.php +++ /dev/null @@ -1,201 +0,0 @@ - [ - 'google.cloud.metastore.v1beta.DataprocMetastore' => [ - 'AlterMetadataResourceLocation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\AlterMetadataResourceLocationResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Backup', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateMetadataImport' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\MetadataImport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Service', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteBackup' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ExportMetadata' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\MetadataExport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'MoveTableToDatabase' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\MoveTableToDatabaseResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'QueryMetadata' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\QueryMetadataResponse', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RestoreService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Restore', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateMetadataImport' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\MetadataImport', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateService' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Service', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListBackups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBackups', - ], - ], - 'ListMetadataImports' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMetadataImports', - ], - ], - 'ListServices' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServices', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - ], - ], -]; diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_client_config.json b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_client_config.json deleted file mode 100644 index 79bcf744ef4..00000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_client_config.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "interfaces": { - "google.cloud.metastore.v1beta.DataprocMetastoreFederation": { - "retry_codes": { - "no_retry_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - } - }, - "methods": { - "CreateFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListFederations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateFederation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_descriptor_config.php b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_descriptor_config.php deleted file mode 100644 index c96ae408bbb..00000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_descriptor_config.php +++ /dev/null @@ -1,91 +0,0 @@ - [ - 'google.cloud.metastore.v1beta.DataprocMetastoreFederation' => [ - 'CreateFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Federation', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateFederation' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Metastore\V1beta\Federation', - 'metadataReturnType' => '\Google\Cloud\Metastore\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListFederations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFederations', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - ], - ], -]; diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_rest_client_config.php b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_rest_client_config.php deleted file mode 100644 index 687939a6e5a..00000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_federation_rest_client_config.php +++ /dev/null @@ -1,263 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.metastore.v1beta.DataprocMetastoreFederation' => [ - 'CreateFederation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/federations', - 'body' => 'federation', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'federation_id', - ], - ], - 'DeleteFederation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/federations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetFederation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/federations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListFederations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/federations', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateFederation' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{federation.name=projects/*/locations/*/federations/*}', - 'body' => 'federation', - 'placeholders' => [ - 'federation.name' => [ - 'getters' => [ - 'getFederation', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_rest_client_config.php b/DataprocMetastore/src/V1beta/resources/dataproc_metastore_rest_client_config.php deleted file mode 100644 index 848d3380831..00000000000 --- a/DataprocMetastore/src/V1beta/resources/dataproc_metastore_rest_client_config.php +++ /dev/null @@ -1,436 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.metastore.v1beta.DataprocMetastore' => [ - 'AlterMetadataResourceLocation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{service=projects/*/locations/*/services/*}:alterLocation', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'CreateBackup' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/services/*}/backups', - 'body' => 'backup', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'backup_id', - ], - ], - 'CreateMetadataImport' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/services/*}/metadataImports', - 'body' => 'metadata_import', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'metadata_import_id', - ], - ], - 'CreateService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/services', - 'body' => 'service', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'service_id', - ], - ], - 'DeleteBackup' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/services/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteService' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ExportMetadata' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{service=projects/*/locations/*/services/*}:exportMetadata', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'GetBackup' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/services/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetMetadataImport' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/services/*/metadataImports/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetService' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListBackups' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/services/*}/backups', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListMetadataImports' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/services/*}/metadataImports', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListServices' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/services', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'MoveTableToDatabase' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{service=projects/*/locations/*/services/*}:moveTableToDatabase', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'QueryMetadata' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{service=projects/*/locations/*/services/*}:queryMetadata', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'RemoveIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/**}:removeIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'RestoreService' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{service=projects/*/locations/*/services/*}:restore', - 'body' => '*', - 'placeholders' => [ - 'service' => [ - 'getters' => [ - 'getService', - ], - ], - ], - ], - 'UpdateMetadataImport' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{metadata_import.name=projects/*/locations/*/services/*/metadataImports/*}', - 'body' => 'metadata_import', - 'placeholders' => [ - 'metadata_import.name' => [ - 'getters' => [ - 'getMetadataImport', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateService' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{service.name=projects/*/locations/*/services/*}', - 'body' => 'service', - 'placeholders' => [ - 'service.name' => [ - 'getters' => [ - 'getService', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/backups/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/services/*/databases/*/tables/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{resource=projects/*/locations/*/federations/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreClientTest.php b/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreClientTest.php index 21615b12619..426a23703d9 100644 --- a/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreClientTest.php +++ b/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return DataprocMetastoreClient */ @@ -148,7 +150,10 @@ public function alterMetadataResourceLocationTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/AlterMetadataResourceLocation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastore/AlterMetadataResourceLocation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getService(); $this->assertProtobufEquals($formattedService, $actualValue); $actualValue = $actualApiRequestObject->getResourceName(); @@ -198,12 +203,15 @@ public function alterMetadataResourceLocationExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); @@ -335,12 +343,15 @@ public function createBackupExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); @@ -472,12 +483,15 @@ public function createMetadataImportExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); @@ -619,12 +633,15 @@ public function createServiceExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -687,8 +704,7 @@ public function deleteBackupTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new DeleteBackupRequest()) - ->setName($formattedName); + $request = (new DeleteBackupRequest())->setName($formattedName); $response = $gapicClient->deleteBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -744,17 +760,19 @@ public function deleteBackupExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new DeleteBackupRequest()) - ->setName($formattedName); + $request = (new DeleteBackupRequest())->setName($formattedName); $response = $gapicClient->deleteBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -808,8 +826,7 @@ public function deleteServiceTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); + $request = (new DeleteServiceRequest())->setName($formattedName); $response = $gapicClient->deleteService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -865,17 +882,19 @@ public function deleteServiceExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); + $request = (new DeleteServiceRequest())->setName($formattedName); $response = $gapicClient->deleteService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -931,8 +950,7 @@ public function exportMetadataTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ExportMetadataRequest()) - ->setService($formattedService); + $request = (new ExportMetadataRequest())->setService($formattedService); $response = $gapicClient->exportMetadata($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -988,17 +1006,19 @@ public function exportMetadataExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ExportMetadataRequest()) - ->setService($formattedService); + $request = (new ExportMetadataRequest())->setService($formattedService); $response = $gapicClient->exportMetadata($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1038,8 +1058,7 @@ public function getBackupTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new GetBackupRequest()) - ->setName($formattedName); + $request = (new GetBackupRequest())->setName($formattedName); $response = $gapicClient->getBackup($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1063,17 +1082,19 @@ public function getBackupExceptionTest() $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->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new GetBackupRequest()) - ->setName($formattedName); + $request = (new GetBackupRequest())->setName($formattedName); try { $gapicClient->getBackup($request); // If the $gapicClient method call did not throw, fail the test @@ -1104,8 +1125,7 @@ public function getMetadataImportTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - $request = (new GetMetadataImportRequest()) - ->setName($formattedName); + $request = (new GetMetadataImportRequest())->setName($formattedName); $response = $gapicClient->getMetadataImport($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1129,17 +1149,19 @@ public function getMetadataImportExceptionTest() $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->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - $request = (new GetMetadataImportRequest()) - ->setName($formattedName); + $request = (new GetMetadataImportRequest())->setName($formattedName); try { $gapicClient->getMetadataImport($request); // If the $gapicClient method call did not throw, fail the test @@ -1180,8 +1202,7 @@ public function getServiceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); + $request = (new GetServiceRequest())->setName($formattedName); $response = $gapicClient->getService($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1205,17 +1226,19 @@ public function getServiceExceptionTest() $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); + $request = (new GetServiceRequest())->setName($formattedName); try { $gapicClient->getService($request); // If the $gapicClient method call did not throw, fail the test @@ -1240,17 +1263,14 @@ public function listBackupsTest() // Mock response $nextPageToken = ''; $backupsElement = new Backup(); - $backups = [ - $backupsElement, - ]; + $backups = [$backupsElement]; $expectedResponse = new ListBackupsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setBackups($backups); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListBackupsRequest()) - ->setParent($formattedParent); + $request = (new ListBackupsRequest())->setParent($formattedParent); $response = $gapicClient->listBackups($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1277,17 +1297,19 @@ public function listBackupsExceptionTest() $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListBackupsRequest()) - ->setParent($formattedParent); + $request = (new ListBackupsRequest())->setParent($formattedParent); try { $gapicClient->listBackups($request); // If the $gapicClient method call did not throw, fail the test @@ -1312,17 +1334,14 @@ public function listMetadataImportsTest() // Mock response $nextPageToken = ''; $metadataImportsElement = new MetadataImport(); - $metadataImports = [ - $metadataImportsElement, - ]; + $metadataImports = [$metadataImportsElement]; $expectedResponse = new ListMetadataImportsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMetadataImports($metadataImports); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListMetadataImportsRequest()) - ->setParent($formattedParent); + $request = (new ListMetadataImportsRequest())->setParent($formattedParent); $response = $gapicClient->listMetadataImports($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1349,17 +1368,19 @@ public function listMetadataImportsExceptionTest() $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $request = (new ListMetadataImportsRequest()) - ->setParent($formattedParent); + $request = (new ListMetadataImportsRequest())->setParent($formattedParent); try { $gapicClient->listMetadataImports($request); // If the $gapicClient method call did not throw, fail the test @@ -1384,17 +1405,14 @@ public function listServicesTest() // Mock response $nextPageToken = ''; $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; + $services = [$servicesElement]; $expectedResponse = new ListServicesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setServices($services); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListServicesRequest()) - ->setParent($formattedParent); + $request = (new ListServicesRequest())->setParent($formattedParent); $response = $gapicClient->listServices($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1421,17 +1439,19 @@ public function listServicesExceptionTest() $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 ListServicesRequest()) - ->setParent($formattedParent); + $request = (new ListServicesRequest())->setParent($formattedParent); try { $gapicClient->listServices($request); // If the $gapicClient method call did not throw, fail the test @@ -1545,12 +1565,15 @@ public function moveTableToDatabaseExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); @@ -1618,9 +1641,7 @@ public function queryMetadataTest() // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); $query = 'query107944136'; - $request = (new QueryMetadataRequest()) - ->setService($formattedService) - ->setQuery($query); + $request = (new QueryMetadataRequest())->setService($formattedService)->setQuery($query); $response = $gapicClient->queryMetadata($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1678,19 +1699,20 @@ public function queryMetadataExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); $query = 'query107944136'; - $request = (new QueryMetadataRequest()) - ->setService($formattedService) - ->setQuery($query); + $request = (new QueryMetadataRequest())->setService($formattedService)->setQuery($query); $response = $gapicClient->queryMetadata($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1749,9 +1771,7 @@ public function restoreServiceTest() // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new RestoreServiceRequest()) - ->setService($formattedService) - ->setBackup($formattedBackup); + $request = (new RestoreServiceRequest())->setService($formattedService)->setBackup($formattedBackup); $response = $gapicClient->restoreService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1809,19 +1829,20 @@ public function restoreServiceExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $request = (new RestoreServiceRequest()) - ->setService($formattedService) - ->setBackup($formattedBackup); + $request = (new RestoreServiceRequest())->setService($formattedService)->setBackup($formattedBackup); $response = $gapicClient->restoreService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1880,9 +1901,7 @@ public function updateMetadataImportTest() // Mock request $updateMask = new FieldMask(); $metadataImport = new MetadataImport(); - $request = (new UpdateMetadataImportRequest()) - ->setUpdateMask($updateMask) - ->setMetadataImport($metadataImport); + $request = (new UpdateMetadataImportRequest())->setUpdateMask($updateMask)->setMetadataImport($metadataImport); $response = $gapicClient->updateMetadataImport($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1940,19 +1959,20 @@ public function updateMetadataImportExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $metadataImport = new MetadataImport(); - $request = (new UpdateMetadataImportRequest()) - ->setUpdateMask($updateMask) - ->setMetadataImport($metadataImport); + $request = (new UpdateMetadataImportRequest())->setUpdateMask($updateMask)->setMetadataImport($metadataImport); $response = $gapicClient->updateMetadataImport($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2021,9 +2041,7 @@ public function updateServiceTest() // Mock request $updateMask = new FieldMask(); $service = new Service(); - $request = (new UpdateServiceRequest()) - ->setUpdateMask($updateMask) - ->setService($service); + $request = (new UpdateServiceRequest())->setUpdateMask($updateMask)->setService($service); $response = $gapicClient->updateService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2081,19 +2099,20 @@ public function updateServiceExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $service = new Service(); - $request = (new UpdateServiceRequest()) - ->setUpdateMask($updateMask) - ->setService($service); + $request = (new UpdateServiceRequest())->setUpdateMask($updateMask)->setService($service); $response = $gapicClient->updateService($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2155,12 +2174,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 { @@ -2187,9 +2209,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -2219,12 +2239,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 { @@ -2257,8 +2280,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(); @@ -2282,17 +2304,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 @@ -2324,9 +2348,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(); @@ -2352,19 +2374,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 @@ -2392,9 +2415,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(); @@ -2420,19 +2441,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 @@ -2492,7 +2514,10 @@ public function alterMetadataResourceLocationAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/AlterMetadataResourceLocation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastore/AlterMetadataResourceLocation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getService(); $this->assertProtobufEquals($formattedService, $actualValue); $actualValue = $actualApiRequestObject->getResourceName(); diff --git a/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreFederationClientTest.php b/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreFederationClientTest.php index 0c81a2c672e..19d1472beb7 100644 --- a/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreFederationClientTest.php +++ b/DataprocMetastore/tests/Unit/V1/Client/DataprocMetastoreFederationClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return DataprocMetastoreFederationClient */ @@ -136,7 +138,10 @@ public function createFederationTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getFederationId(); @@ -186,12 +191,15 @@ public function createFederationExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -254,8 +262,7 @@ public function deleteFederationTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $request = (new DeleteFederationRequest()) - ->setName($formattedName); + $request = (new DeleteFederationRequest())->setName($formattedName); $response = $gapicClient->deleteFederation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -265,7 +272,10 @@ public function deleteFederationTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/DeleteFederation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastoreFederation/DeleteFederation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -311,17 +321,19 @@ public function deleteFederationExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $request = (new DeleteFederationRequest()) - ->setName($formattedName); + $request = (new DeleteFederationRequest())->setName($formattedName); $response = $gapicClient->deleteFederation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -367,8 +379,7 @@ public function getFederationTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $request = (new GetFederationRequest()) - ->setName($formattedName); + $request = (new GetFederationRequest())->setName($formattedName); $response = $gapicClient->getFederation($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -392,17 +403,19 @@ public function getFederationExceptionTest() $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->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $request = (new GetFederationRequest()) - ->setName($formattedName); + $request = (new GetFederationRequest())->setName($formattedName); try { $gapicClient->getFederation($request); // If the $gapicClient method call did not throw, fail the test @@ -427,17 +440,14 @@ public function listFederationsTest() // Mock response $nextPageToken = ''; $federationsElement = new Federation(); - $federations = [ - $federationsElement, - ]; + $federations = [$federationsElement]; $expectedResponse = new ListFederationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFederations($federations); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListFederationsRequest()) - ->setParent($formattedParent); + $request = (new ListFederationsRequest())->setParent($formattedParent); $response = $gapicClient->listFederations($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -464,17 +474,19 @@ public function listFederationsExceptionTest() $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 ListFederationsRequest()) - ->setParent($formattedParent); + $request = (new ListFederationsRequest())->setParent($formattedParent); try { $gapicClient->listFederations($request); // If the $gapicClient method call did not throw, fail the test @@ -530,9 +542,7 @@ public function updateFederationTest() // Mock request $updateMask = new FieldMask(); $federation = new Federation(); - $request = (new UpdateFederationRequest()) - ->setUpdateMask($updateMask) - ->setFederation($federation); + $request = (new UpdateFederationRequest())->setUpdateMask($updateMask)->setFederation($federation); $response = $gapicClient->updateFederation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -542,7 +552,10 @@ public function updateFederationTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/UpdateFederation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastoreFederation/UpdateFederation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getUpdateMask(); $this->assertProtobufEquals($updateMask, $actualValue); $actualValue = $actualApiRequestObject->getFederation(); @@ -590,19 +603,20 @@ public function updateFederationExceptionTest() $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 + ); $operationsTransport->addResponse(null, $status); // Mock request $updateMask = new FieldMask(); $federation = new Federation(); - $request = (new UpdateFederationRequest()) - ->setUpdateMask($updateMask) - ->setFederation($federation); + $request = (new UpdateFederationRequest())->setUpdateMask($updateMask)->setFederation($federation); $response = $gapicClient->updateFederation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -664,12 +678,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 { @@ -696,9 +713,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -728,12 +743,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 { @@ -766,8 +784,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(); @@ -791,17 +808,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 @@ -833,9 +852,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(); @@ -861,19 +878,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 @@ -901,9 +919,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(); @@ -929,19 +945,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 @@ -1011,7 +1028,10 @@ public function createFederationAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getFederationId(); diff --git a/DataprocMetastore/tests/Unit/V1/DataprocMetastoreClientTest.php b/DataprocMetastore/tests/Unit/V1/DataprocMetastoreClientTest.php deleted file mode 100644 index f4e4eb67f18..00000000000 --- a/DataprocMetastore/tests/Unit/V1/DataprocMetastoreClientTest.php +++ /dev/null @@ -1,2303 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreClient($options); - } - - /** @test */ - public function alterMetadataResourceLocationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new AlterMetadataResourceLocationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/alterMetadataResourceLocationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/AlterMetadataResourceLocation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getResourceName(); - $this->assertProtobufEquals($resourceName, $actualValue); - $actualValue = $actualApiRequestObject->getLocationUri(); - $this->assertProtobufEquals($locationUri, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function alterMetadataResourceLocationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/CreateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/CreateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImportId(); - $this->assertProtobufEquals($metadataImportId, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/CreateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getServiceId(); - $this->assertProtobufEquals($serviceId, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/DeleteBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/DeleteService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $destinationGcsUri = 'destinationGcsUri1386421523'; - $expectedResponse = new MetadataExport(); - $expectedResponse->setDestinationGcsUri($destinationGcsUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/ExportMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->getBackup($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.metastore.v1.DataprocMetastore/GetBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupExceptionTest() - { - $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->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - try { - $gapicClient->getBackup($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 getMetadataImportTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - $response = $gapicClient->getMetadataImport($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.metastore.v1.DataprocMetastore/GetMetadataImport', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataImportExceptionTest() - { - $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->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - try { - $gapicClient->getMetadataImport($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 getServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->getService($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.metastore.v1.DataprocMetastore/GetService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->getService($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 listBackupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupsElement = new Backup(); - $backups = [ - $backupsElement, - ]; - $expectedResponse = new ListBackupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackups($backups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listBackups($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/ListBackups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listBackups($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 listMetadataImportsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $metadataImportsElement = new MetadataImport(); - $metadataImports = [ - $metadataImportsElement, - ]; - $expectedResponse = new ListMetadataImportsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMetadataImports($metadataImports); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listMetadataImports($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMetadataImports()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/ListMetadataImports', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataImportsExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listMetadataImports($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 listServicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listServices($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/ListServices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesExceptionTest() - { - $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->listServices($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 moveTableToDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new MoveTableToDatabaseResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/moveTableToDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/MoveTableToDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getTableName(); - $this->assertProtobufEquals($tableName, $actualValue); - $actualValue = $actualApiRequestObject->getDbName(); - $this->assertProtobufEquals($dbName, $actualValue); - $actualValue = $actualApiRequestObject->getDestinationDbName(); - $this->assertProtobufEquals($destinationDbName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function moveTableToDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $resultManifestUri = 'resultManifestUri-1050940354'; - $expectedResponse = new QueryMetadataResponse(); - $expectedResponse->setResultManifestUri($resultManifestUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/queryMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/QueryMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restoreServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $backup2 = 'backup22121930997'; - $details = 'details1557721666'; - $expectedResponse = new Restore(); - $expectedResponse->setBackup($backup2); - $expectedResponse->setDetails($details); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/RestoreService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($formattedBackup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restoreServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/UpdateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastore/UpdateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->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()); - } -} diff --git a/DataprocMetastore/tests/Unit/V1/DataprocMetastoreFederationClientTest.php b/DataprocMetastore/tests/Unit/V1/DataprocMetastoreFederationClientTest.php deleted file mode 100644 index 7c43e2e769c..00000000000 --- a/DataprocMetastore/tests/Unit/V1/DataprocMetastoreFederationClientTest.php +++ /dev/null @@ -1,901 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreFederationClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreFederationClient($options); - } - - /** @test */ - public function createFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/CreateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFederationId(); - $this->assertProtobufEquals($federationId, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/DeleteFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getFederationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name2); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->getFederation($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.metastore.v1.DataprocMetastoreFederation/GetFederation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFederationExceptionTest() - { - $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->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - try { - $gapicClient->getFederation($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 listFederationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $federationsElement = new Federation(); - $federations = [ - $federationsElement, - ]; - $expectedResponse = new ListFederationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFederations($federations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listFederations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFederations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/ListFederations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFederationsExceptionTest() - { - $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->listFederations($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 updateFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1.DataprocMetastoreFederation/UpdateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->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()); - } -} diff --git a/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreClientTest.php b/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreClientTest.php deleted file mode 100644 index 1015aadf95a..00000000000 --- a/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreClientTest.php +++ /dev/null @@ -1,2364 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreClient($options); - } - - /** @test */ - public function alterMetadataResourceLocationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new AlterMetadataResourceLocationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/alterMetadataResourceLocationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/AlterMetadataResourceLocation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getResourceName(); - $this->assertProtobufEquals($resourceName, $actualValue); - $actualValue = $actualApiRequestObject->getLocationUri(); - $this->assertProtobufEquals($locationUri, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function alterMetadataResourceLocationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImportId(); - $this->assertProtobufEquals($metadataImportId, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/CreateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getServiceId(); - $this->assertProtobufEquals($serviceId, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/DeleteBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/DeleteService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $destinationGcsUri = 'destinationGcsUri1386421523'; - $expectedResponse = new MetadataExport(); - $expectedResponse->setDestinationGcsUri($destinationGcsUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/ExportMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->getBackup($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.metastore.v1alpha.DataprocMetastore/GetBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupExceptionTest() - { - $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->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - try { - $gapicClient->getBackup($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 getMetadataImportTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - $response = $gapicClient->getMetadataImport($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.metastore.v1alpha.DataprocMetastore/GetMetadataImport', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataImportExceptionTest() - { - $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->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - try { - $gapicClient->getMetadataImport($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 getServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->getService($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.metastore.v1alpha.DataprocMetastore/GetService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->getService($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 listBackupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupsElement = new Backup(); - $backups = [ - $backupsElement, - ]; - $expectedResponse = new ListBackupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackups($backups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listBackups($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/ListBackups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listBackups($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 listMetadataImportsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $metadataImportsElement = new MetadataImport(); - $metadataImports = [ - $metadataImportsElement, - ]; - $expectedResponse = new ListMetadataImportsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMetadataImports($metadataImports); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listMetadataImports($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMetadataImports()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/ListMetadataImports', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataImportsExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listMetadataImports($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 listServicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listServices($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/ListServices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesExceptionTest() - { - $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->listServices($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 moveTableToDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new MoveTableToDatabaseResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/moveTableToDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/MoveTableToDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getTableName(); - $this->assertProtobufEquals($tableName, $actualValue); - $actualValue = $actualApiRequestObject->getDbName(); - $this->assertProtobufEquals($dbName, $actualValue); - $actualValue = $actualApiRequestObject->getDestinationDbName(); - $this->assertProtobufEquals($destinationDbName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function moveTableToDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $resultManifestUri = 'resultManifestUri-1050940354'; - $expectedResponse = new QueryMetadataResponse(); - $expectedResponse->setResultManifestUri($resultManifestUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/queryMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/QueryMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function removeIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $success = false; - $expectedResponse = new RemoveIamPolicyResponse(); - $expectedResponse->setSuccess($success); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->removeIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/RemoveIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeIamPolicyExceptionTest() - { - $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->removeIamPolicy($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 restoreServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $backup2 = 'backup22121930997'; - $details = 'details1557721666'; - $expectedResponse = new Restore(); - $expectedResponse->setBackup($backup2); - $expectedResponse->setDetails($details); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/RestoreService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($formattedBackup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restoreServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/UpdateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastore/UpdateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->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()); - } -} diff --git a/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreFederationClientTest.php b/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreFederationClientTest.php deleted file mode 100644 index 5f9c90c3141..00000000000 --- a/DataprocMetastore/tests/Unit/V1alpha/DataprocMetastoreFederationClientTest.php +++ /dev/null @@ -1,901 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreFederationClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreFederationClient($options); - } - - /** @test */ - public function createFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/CreateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFederationId(); - $this->assertProtobufEquals($federationId, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/DeleteFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getFederationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name2); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->getFederation($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.metastore.v1alpha.DataprocMetastoreFederation/GetFederation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFederationExceptionTest() - { - $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->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - try { - $gapicClient->getFederation($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 listFederationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $federationsElement = new Federation(); - $federations = [ - $federationsElement, - ]; - $expectedResponse = new ListFederationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFederations($federations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listFederations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFederations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/ListFederations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFederationsExceptionTest() - { - $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->listFederations($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 updateFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1alpha.DataprocMetastoreFederation/UpdateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->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()); - } -} diff --git a/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreClientTest.php b/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreClientTest.php deleted file mode 100644 index 4cf24f59470..00000000000 --- a/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreClientTest.php +++ /dev/null @@ -1,2364 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreClient($options); - } - - /** @test */ - public function alterMetadataResourceLocationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new AlterMetadataResourceLocationResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/alterMetadataResourceLocationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/AlterMetadataResourceLocation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getResourceName(); - $this->assertProtobufEquals($resourceName, $actualValue); - $actualValue = $actualApiRequestObject->getLocationUri(); - $this->assertProtobufEquals($locationUri, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function alterMetadataResourceLocationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/alterMetadataResourceLocationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $resourceName = 'resourceName979421212'; - $locationUri = 'locationUri-57953822'; - $response = $gapicClient->alterMetadataResourceLocation($formattedService, $resourceName, $locationUri); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/alterMetadataResourceLocationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/CreateBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getBackupId(); - $this->assertProtobufEquals($backupId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($backup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $backupId = 'backupId1355353272'; - $backup = new Backup(); - $response = $gapicClient->createBackup($formattedParent, $backupId, $backup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/CreateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImportId(); - $this->assertProtobufEquals($metadataImportId, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $metadataImportId = 'metadataImportId-476076315'; - $metadataImport = new MetadataImport(); - $response = $gapicClient->createMetadataImport($formattedParent, $metadataImportId, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/CreateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getServiceId(); - $this->assertProtobufEquals($serviceId, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $serviceId = 'serviceId-1724763419'; - $service = new Service(); - $response = $gapicClient->createService($formattedParent, $serviceId, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteBackupTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/DeleteBackup', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteBackupExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteBackupTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->deleteBackup($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/DeleteService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->deleteService($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $destinationGcsUri = 'destinationGcsUri1386421523'; - $expectedResponse = new MetadataExport(); - $expectedResponse->setDestinationGcsUri($destinationGcsUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/ExportMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->exportMetadata($formattedService); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->getBackup($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.metastore.v1beta.DataprocMetastore/GetBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupExceptionTest() - { - $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->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - try { - $gapicClient->getBackup($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 getMetadataImportTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - $response = $gapicClient->getMetadataImport($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.metastore.v1beta.DataprocMetastore/GetMetadataImport', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getMetadataImportExceptionTest() - { - $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->metadataImportName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[METADATA_IMPORT]'); - try { - $gapicClient->getMetadataImport($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 getServiceTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->getService($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.metastore.v1beta.DataprocMetastore/GetService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getServiceExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->getService($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 listBackupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $backupsElement = new Backup(); - $backups = [ - $backupsElement, - ]; - $expectedResponse = new ListBackupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBackups($backups); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listBackups($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/ListBackups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listBackups($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 listMetadataImportsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $metadataImportsElement = new MetadataImport(); - $metadataImports = [ - $metadataImportsElement, - ]; - $expectedResponse = new ListMetadataImportsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMetadataImports($metadataImports); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $response = $gapicClient->listMetadataImports($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMetadataImports()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/ListMetadataImports', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listMetadataImportsExceptionTest() - { - $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->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - try { - $gapicClient->listMetadataImports($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 listServicesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listServices($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/ListServices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listServicesExceptionTest() - { - $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->listServices($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 moveTableToDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new MoveTableToDatabaseResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/moveTableToDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/MoveTableToDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getTableName(); - $this->assertProtobufEquals($tableName, $actualValue); - $actualValue = $actualApiRequestObject->getDbName(); - $this->assertProtobufEquals($dbName, $actualValue); - $actualValue = $actualApiRequestObject->getDestinationDbName(); - $this->assertProtobufEquals($destinationDbName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function moveTableToDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/moveTableToDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $tableName = 'tableName-1504630692'; - $dbName = 'dbName1452819884'; - $destinationDbName = 'destinationDbName-1322761605'; - $response = $gapicClient->moveTableToDatabase($formattedService, $tableName, $dbName, $destinationDbName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/moveTableToDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $resultManifestUri = 'resultManifestUri-1050940354'; - $expectedResponse = new QueryMetadataResponse(); - $expectedResponse->setResultManifestUri($resultManifestUri); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/queryMetadataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/QueryMetadata', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function queryMetadataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/queryMetadataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $query = 'query107944136'; - $response = $gapicClient->queryMetadata($formattedService, $query); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/queryMetadataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function removeIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $success = false; - $expectedResponse = new RemoveIamPolicyResponse(); - $expectedResponse->setSuccess($success); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->removeIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/RemoveIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function removeIamPolicyExceptionTest() - { - $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->removeIamPolicy($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 restoreServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $backup2 = 'backup22121930997'; - $details = 'details1557721666'; - $expectedResponse = new Restore(); - $expectedResponse->setBackup($backup2); - $expectedResponse->setDetails($details); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/restoreServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/RestoreService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($formattedService, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($formattedBackup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function restoreServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/restoreServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedService = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[BACKUP]'); - $response = $gapicClient->restoreService($formattedService, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new MetadataImport(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateMetadataImportTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/UpdateMetadataImport', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getMetadataImport(); - $this->assertProtobufEquals($metadataImport, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateMetadataImportExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMetadataImportTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $metadataImport = new MetadataImport(); - $response = $gapicClient->updateMetadataImport($updateMask, $metadataImport); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMetadataImportTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $network = 'network1843485230'; - $endpointUri = 'endpointUri-850313278'; - $port = 3446913; - $stateMessage = 'stateMessage29641305'; - $artifactGcsUri = 'artifactGcsUri1337121495'; - $uid = 'uid115792'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setNetwork($network); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setPort($port); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setArtifactGcsUri($artifactGcsUri); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateServiceTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastore/UpdateService', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateServiceExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateServiceTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $service = new Service(); - $response = $gapicClient->updateService($updateMask, $service); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateServiceTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->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()); - } -} diff --git a/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreFederationClientTest.php b/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreFederationClientTest.php deleted file mode 100644 index 12be1a4f8d8..00000000000 --- a/DataprocMetastore/tests/Unit/V1beta/DataprocMetastoreFederationClientTest.php +++ /dev/null @@ -1,901 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DataprocMetastoreFederationClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DataprocMetastoreFederationClient($options); - } - - /** @test */ - public function createFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/CreateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFederationId(); - $this->assertProtobufEquals($federationId, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $federationId = 'federationId-1338699881'; - $federation = new Federation(); - $response = $gapicClient->createFederation($formattedParent, $federationId, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/DeleteFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->deleteFederation($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getFederationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name2); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - $response = $gapicClient->getFederation($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.metastore.v1beta.DataprocMetastoreFederation/GetFederation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFederationExceptionTest() - { - $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->federationName('[PROJECT]', '[LOCATION]', '[FEDERATION]'); - try { - $gapicClient->getFederation($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 listFederationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $federationsElement = new Federation(); - $federations = [ - $federationsElement, - ]; - $expectedResponse = new ListFederationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFederations($federations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listFederations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFederations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/ListFederations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFederationsExceptionTest() - { - $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->listFederations($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 updateFederationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $version = 'version351608024'; - $endpointUri = 'endpointUri-850313278'; - $stateMessage = 'stateMessage29641305'; - $uid = 'uid115792'; - $expectedResponse = new Federation(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $expectedResponse->setEndpointUri($endpointUri); - $expectedResponse->setStateMessage($stateMessage); - $expectedResponse->setUid($uid); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFederationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.metastore.v1beta.DataprocMetastoreFederation/UpdateFederation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getFederation(); - $this->assertProtobufEquals($federation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFederationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFederationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $updateMask = new FieldMask(); - $federation = new Federation(); - $response = $gapicClient->updateFederation($updateMask, $federation); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFederationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->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()); - } -}