diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index 49b3491111d7..93ba6865c487 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -132,7 +132,7 @@ "ArtifactRegistry": { "language": "php", "distribution_name": "google/cloud-artifact-registry", - "release_level": "preview", + "release_level": "stable", "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-artifact-registry/latest", "library_type": "GAPIC_AUTO", "api_shortname": "artifactregistry" diff --git a/ArtifactRegistry/.OwlBot.yaml b/ArtifactRegistry/.OwlBot.yaml index 78bc291bec93..f38b4fcc4ae1 100644 --- a/ArtifactRegistry/.OwlBot.yaml +++ b/ArtifactRegistry/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/devtools/artifactregistry/(v1|v1beta2)/.*-php/(.*) + - source: /google/devtools/artifactregistry/(v1)/.*-php/(.*) dest: /owl-bot-staging/ArtifactRegistry/$1/$2 api-name: ArtifactRegistry diff --git a/ArtifactRegistry/README.md b/ArtifactRegistry/README.md index f77bb6a09ba5..7ebf410cf344 100644 --- a/ArtifactRegistry/README.md +++ b/ArtifactRegistry/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/ArtifactRegistry/metadata/V1Beta2/AptArtifact.php b/ArtifactRegistry/metadata/V1Beta2/AptArtifact.php deleted file mode 100644 index e8b92d5640f4..000000000000 Binary files a/ArtifactRegistry/metadata/V1Beta2/AptArtifact.php and /dev/null differ diff --git a/ArtifactRegistry/metadata/V1Beta2/File.php b/ArtifactRegistry/metadata/V1Beta2/File.php deleted file mode 100644 index 012ac3638d8d..000000000000 Binary files a/ArtifactRegistry/metadata/V1Beta2/File.php and /dev/null differ diff --git a/ArtifactRegistry/metadata/V1Beta2/Package.php b/ArtifactRegistry/metadata/V1Beta2/Package.php deleted file mode 100644 index 440effe35bc5..000000000000 --- a/ArtifactRegistry/metadata/V1Beta2/Package.php +++ /dev/null @@ -1,45 +0,0 @@ -internalAddGeneratedFile( - ' -� -6google/devtools/artifactregistry/v1beta2/package.proto(google.devtools.artifactregistry.v1beta2"� -Package -name (  - display_name ( / - create_time ( 2.google.protobuf.Timestamp/ - update_time ( 2.google.protobuf.Timestamp"L -ListPackagesRequest -parent (  - page_size ( - -page_token ( "t -ListPackagesResponseC -packages ( 21.google.devtools.artifactregistry.v1beta2.Package -next_page_token ( "! -GetPackageRequest -name ( "$ -DeletePackageRequest -name ( B� -,com.google.devtools.artifactregistry.v1beta2B PackageProtoPZUcloud.google.com/go/artifactregistry/apiv1beta2/artifactregistrypb;artifactregistrypb�%Google.Cloud.ArtifactRegistry.V1Beta2�%Google\\Cloud\\ArtifactRegistry\\V1beta2�(Google::Cloud::ArtifactRegistry::V1beta2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/ArtifactRegistry/metadata/V1Beta2/Repository.php b/ArtifactRegistry/metadata/V1Beta2/Repository.php deleted file mode 100644 index 71849a2a0446..000000000000 Binary files a/ArtifactRegistry/metadata/V1Beta2/Repository.php and /dev/null differ diff --git a/ArtifactRegistry/metadata/V1Beta2/Service.php b/ArtifactRegistry/metadata/V1Beta2/Service.php deleted file mode 100644 index cb70b939582a..000000000000 --- a/ArtifactRegistry/metadata/V1Beta2/Service.php +++ /dev/null @@ -1,78 +0,0 @@ -internalAddGeneratedFile( - ' -�7 -6google/devtools/artifactregistry/v1beta2/service.proto(google.devtools.artifactregistry.v1beta2google/api/client.proto;google/devtools/artifactregistry/v1beta2/apt_artifact.proto3google/devtools/artifactregistry/v1beta2/file.proto6google/devtools/artifactregistry/v1beta2/package.proto9google/devtools/artifactregistry/v1beta2/repository.proto7google/devtools/artifactregistry/v1beta2/settings.proto2google/devtools/artifactregistry/v1beta2/tag.proto6google/devtools/artifactregistry/v1beta2/version.proto;google/devtools/artifactregistry/v1beta2/yum_artifact.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto" -OperationMetadata2�/ -ArtifactRegistry� -ImportAptArtifactsC.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest.google.longrunning.Operation"��A� -Cgoogle.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponseCgoogle.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata���P"K/v1beta2/{parent=projects/*/locations/*/repositories/*}/aptArtifacts:import:*� -ImportYumArtifactsC.google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest.google.longrunning.Operation"��A� -Cgoogle.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponseCgoogle.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata���P"K/v1beta2/{parent=projects/*/locations/*/repositories/*}/yumArtifacts:import:*� -ListRepositoriesA.google.devtools.artifactregistry.v1beta2.ListRepositoriesRequestB.google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse"F�Aparent���75/v1beta2/{parent=projects/*/locations/*}/repositories� - GetRepository>.google.devtools.artifactregistry.v1beta2.GetRepositoryRequest4.google.devtools.artifactregistry.v1beta2.Repository"D�Aname���75/v1beta2/{name=projects/*/locations/*/repositories/*}� -CreateRepositoryA.google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest.google.longrunning.Operation"��Aq -3google.devtools.artifactregistry.v1beta2.Repository:google.devtools.artifactregistry.v1beta2.OperationMetadata�Aparent,repository,repository_id���C"5/v1beta2/{parent=projects/*/locations/*}/repositories: -repository� -UpdateRepositoryA.google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest4.google.devtools.artifactregistry.v1beta2.Repository"m�Arepository,update_mask���N2@/v1beta2/{repository.name=projects/*/locations/*/repositories/*}: -repository� -DeleteRepositoryA.google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest.google.longrunning.Operation"��AS -google.protobuf.Empty:google.devtools.artifactregistry.v1beta2.OperationMetadata�Aname���7*5/v1beta2/{name=projects/*/locations/*/repositories/*}� - ListPackages=.google.devtools.artifactregistry.v1beta2.ListPackagesRequest>.google.devtools.artifactregistry.v1beta2.ListPackagesResponse"Q�Aparent���B@/v1beta2/{parent=projects/*/locations/*/repositories/*}/packages� - -GetPackage;.google.devtools.artifactregistry.v1beta2.GetPackageRequest1.google.devtools.artifactregistry.v1beta2.Package"O�Aname���B@/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*}� - DeletePackage>.google.devtools.artifactregistry.v1beta2.DeletePackageRequest.google.longrunning.Operation"��AS -google.protobuf.Empty:google.devtools.artifactregistry.v1beta2.OperationMetadata�Aname���B*@/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*}� - ListVersions=.google.devtools.artifactregistry.v1beta2.ListVersionsRequest>.google.devtools.artifactregistry.v1beta2.ListVersionsResponse"\\�Aparent���MK/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/versions� - -GetVersion;.google.devtools.artifactregistry.v1beta2.GetVersionRequest1.google.devtools.artifactregistry.v1beta2.Version"Z�Aname���MK/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/versions/*}� - DeleteVersion>.google.devtools.artifactregistry.v1beta2.DeleteVersionRequest.google.longrunning.Operation"��AS -google.protobuf.Empty:google.devtools.artifactregistry.v1beta2.OperationMetadata�Aname���M*K/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/versions/*}� - ListFiles:.google.devtools.artifactregistry.v1beta2.ListFilesRequest;.google.devtools.artifactregistry.v1beta2.ListFilesResponse"N�Aparent���?=/v1beta2/{parent=projects/*/locations/*/repositories/*}/files� -GetFile8.google.devtools.artifactregistry.v1beta2.GetFileRequest..google.devtools.artifactregistry.v1beta2.File"M�Aname���@>/v1beta2/{name=projects/*/locations/*/repositories/*/files/**}� -ListTags9.google.devtools.artifactregistry.v1beta2.ListTagsRequest:.google.devtools.artifactregistry.v1beta2.ListTagsResponse"X�Aparent���IG/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/tags� -GetTag7.google.devtools.artifactregistry.v1beta2.GetTagRequest-.google.devtools.artifactregistry.v1beta2.Tag"V�Aname���IG/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}� - CreateTag:.google.devtools.artifactregistry.v1beta2.CreateTagRequest-.google.devtools.artifactregistry.v1beta2.Tag"h�Aparent,tag,tag_id���N"G/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/tags:tag� - UpdateTag:.google.devtools.artifactregistry.v1beta2.UpdateTagRequest-.google.devtools.artifactregistry.v1beta2.Tag"j�Atag,update_mask���R2K/v1beta2/{tag.name=projects/*/locations/*/repositories/*/packages/*/tags/*}:tag� - DeleteTag:.google.devtools.artifactregistry.v1beta2.DeleteTagRequest.google.protobuf.Empty"V�Aname���I*G/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}� - SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"Q���K"F/v1beta2/{resource=projects/*/locations/*/repositories/*}:setIamPolicy:*� - GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"N���HF/v1beta2/{resource=projects/*/locations/*/repositories/*}:getIamPolicy� -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"W���Q"L/v1beta2/{resource=projects/*/locations/*/repositories/*}:testIamPermissions:*� -GetProjectSettingsC.google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest9.google.devtools.artifactregistry.v1beta2.ProjectSettings"9�Aname���,*/v1beta2/{name=projects/*/projectSettings}� -UpdateProjectSettingsF.google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest9.google.devtools.artifactregistry.v1beta2.ProjectSettings"t�Aproject_settings,update_mask���O2;/v1beta2/{project_settings.name=projects/*/projectSettings}:project_settings��Aartifactregistry.googleapis.com�Aghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB� -,com.google.devtools.artifactregistry.v1beta2B ServiceProtoPZUcloud.google.com/go/artifactregistry/apiv1beta2/artifactregistrypb;artifactregistrypb�%Google.Cloud.ArtifactRegistry.V1Beta2�%Google\\Cloud\\ArtifactRegistry\\V1beta2�(Google::Cloud::ArtifactRegistry::V1beta2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/ArtifactRegistry/metadata/V1Beta2/Settings.php b/ArtifactRegistry/metadata/V1Beta2/Settings.php deleted file mode 100644 index 8ea9e61479a6..000000000000 Binary files a/ArtifactRegistry/metadata/V1Beta2/Settings.php and /dev/null differ diff --git a/ArtifactRegistry/metadata/V1Beta2/Tag.php b/ArtifactRegistry/metadata/V1Beta2/Tag.php deleted file mode 100644 index 5469e3cf6a1f..000000000000 --- a/ArtifactRegistry/metadata/V1Beta2/Tag.php +++ /dev/null @@ -1,53 +0,0 @@ -internalAddGeneratedFile( - ' -� -2google/devtools/artifactregistry/v1beta2/tag.proto(google.devtools.artifactregistry.v1beta2 google/protobuf/field_mask.proto"� -Tag -name (  -version ( :��A� -#artifactregistry.googleapis.com/Tag_projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}"X -ListTagsRequest -parent (  -filter (  - page_size ( - -page_token ( "h -ListTagsResponse; -tags ( 2-.google.devtools.artifactregistry.v1beta2.Tag -next_page_token ( " - GetTagRequest -name ( "n -CreateTagRequest -parent (  -tag_id ( : -tag ( 2-.google.devtools.artifactregistry.v1beta2.Tag" -UpdateTagRequest: -tag ( 2-.google.devtools.artifactregistry.v1beta2.Tag/ - update_mask ( 2.google.protobuf.FieldMask" -DeleteTagRequest -name ( B� -,com.google.devtools.artifactregistry.v1beta2BTagProtoPZUcloud.google.com/go/artifactregistry/apiv1beta2/artifactregistrypb;artifactregistrypb�%Google.Cloud.ArtifactRegistry.V1Beta2�%Google\\Cloud\\ArtifactRegistry\\V1beta2�(Google::Cloud::ArtifactRegistry::V1beta2bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/ArtifactRegistry/metadata/V1Beta2/Version.php b/ArtifactRegistry/metadata/V1Beta2/Version.php deleted file mode 100644 index 6fa2151082d0..000000000000 Binary files a/ArtifactRegistry/metadata/V1Beta2/Version.php and /dev/null differ diff --git a/ArtifactRegistry/metadata/V1Beta2/YumArtifact.php b/ArtifactRegistry/metadata/V1Beta2/YumArtifact.php deleted file mode 100644 index 8fe45ebc0834..000000000000 Binary files a/ArtifactRegistry/metadata/V1Beta2/YumArtifact.php and /dev/null differ diff --git a/ArtifactRegistry/owlbot.py b/ArtifactRegistry/owlbot.py index 59e026157de7..7b55f4029e03 100644 --- a/ArtifactRegistry/owlbot.py +++ b/ArtifactRegistry/owlbot.py @@ -20,42 +20,37 @@ import synthtool as s from synthtool.languages import php +from synthtool import _tracked_paths logging.basicConfig(level=logging.DEBUG) src = Path(f"../{php.STAGING_DIR}/ArtifactRegistry").resolve() dest = Path().resolve() -php.owlbot_main(src=src, dest=dest) - -# Change the wording for the deprecation warning. -s.replace( - 'src/*/*_*.php', - r'will be removed in the next major release', - 'will be removed in a future release') +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) -### [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 +php.owlbot_main(src=src, dest=dest) -# fix relative cloud.google.com links +# remove class_alias code 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/ArtifactRegistry/src/V1/AptArtifact.php b/ArtifactRegistry/src/V1/AptArtifact.php index e65566777c88..d9ae52ba014a 100644 --- a/ArtifactRegistry/src/V1/AptArtifact.php +++ b/ArtifactRegistry/src/V1/AptArtifact.php @@ -22,37 +22,37 @@ class AptArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. The Apt package name of the artifact. * * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $package_name = ''; + protected $package_name = ''; /** * Output only. An artifact is a binary or source package. * * Generated from protobuf field .google.devtools.artifactregistry.v1.AptArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $package_type = 0; + protected $package_type = 0; /** * Output only. Operating system architecture of the artifact. * * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $architecture = ''; + protected $architecture = ''; /** * Output only. Repository component of the artifact. * * Generated from protobuf field string component = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $component = ''; + protected $component = ''; /** * Output only. Contents of the artifact's control metadata file. * * Generated from protobuf field bytes control_file = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $control_file = ''; + protected $control_file = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/AptArtifact/PackageType.php b/ArtifactRegistry/src/V1/AptArtifact/PackageType.php index cc6369f933a6..503acc22046d 100644 --- a/ArtifactRegistry/src/V1/AptArtifact/PackageType.php +++ b/ArtifactRegistry/src/V1/AptArtifact/PackageType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PackageType::class, \Google\Cloud\ArtifactRegistry\V1\AptArtifact_PackageType::class); diff --git a/ArtifactRegistry/src/V1/ArtifactRegistryGrpcClient.php b/ArtifactRegistry/src/V1/ArtifactRegistryGrpcClient.php deleted file mode 100644 index 7fd278964b2f..000000000000 --- a/ArtifactRegistry/src/V1/ArtifactRegistryGrpcClient.php +++ /dev/null @@ -1,583 +0,0 @@ -_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListDockerImages', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListDockerImagesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a docker image. - * @param \Google\Cloud\ArtifactRegistry\V1\GetDockerImageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetDockerImage(\Google\Cloud\ArtifactRegistry\V1\GetDockerImageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetDockerImage', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\DockerImage', 'decode'], - $metadata, $options); - } - - /** - * Lists maven artifacts. - * @param \Google\Cloud\ArtifactRegistry\V1\ListMavenArtifactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMavenArtifacts(\Google\Cloud\ArtifactRegistry\V1\ListMavenArtifactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListMavenArtifacts', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListMavenArtifactsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a maven artifact. - * @param \Google\Cloud\ArtifactRegistry\V1\GetMavenArtifactRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMavenArtifact(\Google\Cloud\ArtifactRegistry\V1\GetMavenArtifactRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetMavenArtifact', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\MavenArtifact', 'decode'], - $metadata, $options); - } - - /** - * Lists npm packages. - * @param \Google\Cloud\ArtifactRegistry\V1\ListNpmPackagesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListNpmPackages(\Google\Cloud\ArtifactRegistry\V1\ListNpmPackagesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListNpmPackages', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListNpmPackagesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a npm package. - * @param \Google\Cloud\ArtifactRegistry\V1\GetNpmPackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetNpmPackage(\Google\Cloud\ArtifactRegistry\V1\GetNpmPackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetNpmPackage', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\NpmPackage', 'decode'], - $metadata, $options); - } - - /** - * Lists python packages. - * @param \Google\Cloud\ArtifactRegistry\V1\ListPythonPackagesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListPythonPackages(\Google\Cloud\ArtifactRegistry\V1\ListPythonPackagesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListPythonPackages', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListPythonPackagesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a python package. - * @param \Google\Cloud\ArtifactRegistry\V1\GetPythonPackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetPythonPackage(\Google\Cloud\ArtifactRegistry\V1\GetPythonPackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetPythonPackage', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\PythonPackage', 'decode'], - $metadata, $options); - } - - /** - * Imports Apt artifacts. The returned Operation will complete once the - * resources are imported. Package, Version, and File resources are created - * based on the imported artifacts. Imported artifacts that conflict with - * existing resources are ignored. - * @param \Google\Cloud\ArtifactRegistry\V1\ImportAptArtifactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ImportAptArtifacts(\Google\Cloud\ArtifactRegistry\V1\ImportAptArtifactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportAptArtifacts', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Imports Yum (RPM) artifacts. The returned Operation will complete once the - * resources are imported. Package, Version, and File resources are created - * based on the imported artifacts. Imported artifacts that conflict with - * existing resources are ignored. - * @param \Google\Cloud\ArtifactRegistry\V1\ImportYumArtifactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ImportYumArtifacts(\Google\Cloud\ArtifactRegistry\V1\ImportYumArtifactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportYumArtifacts', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists repositories. - * @param \Google\Cloud\ArtifactRegistry\V1\ListRepositoriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListRepositories(\Google\Cloud\ArtifactRegistry\V1\ListRepositoriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListRepositories', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListRepositoriesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a repository. - * @param \Google\Cloud\ArtifactRegistry\V1\GetRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetRepository(\Google\Cloud\ArtifactRegistry\V1\GetRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetRepository', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Repository', 'decode'], - $metadata, $options); - } - - /** - * Creates a repository. The returned Operation will finish once the - * repository has been created. Its response will be the created Repository. - * @param \Google\Cloud\ArtifactRegistry\V1\CreateRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateRepository(\Google\Cloud\ArtifactRegistry\V1\CreateRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/CreateRepository', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a repository. - * @param \Google\Cloud\ArtifactRegistry\V1\UpdateRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateRepository(\Google\Cloud\ArtifactRegistry\V1\UpdateRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateRepository', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Repository', 'decode'], - $metadata, $options); - } - - /** - * Deletes a repository and all of its contents. The returned Operation will - * finish once the repository has been deleted. It will not have any Operation - * metadata and will return a google.protobuf.Empty response. - * @param \Google\Cloud\ArtifactRegistry\V1\DeleteRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteRepository(\Google\Cloud\ArtifactRegistry\V1\DeleteRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/DeleteRepository', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists packages. - * @param \Google\Cloud\ArtifactRegistry\V1\ListPackagesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListPackages(\Google\Cloud\ArtifactRegistry\V1\ListPackagesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListPackages', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListPackagesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a package. - * @param \Google\Cloud\ArtifactRegistry\V1\GetPackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetPackage(\Google\Cloud\ArtifactRegistry\V1\GetPackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetPackage', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Package', 'decode'], - $metadata, $options); - } - - /** - * Deletes a package and all of its versions and tags. The returned operation - * will complete once the package has been deleted. - * @param \Google\Cloud\ArtifactRegistry\V1\DeletePackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeletePackage(\Google\Cloud\ArtifactRegistry\V1\DeletePackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/DeletePackage', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists versions. - * @param \Google\Cloud\ArtifactRegistry\V1\ListVersionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListVersions(\Google\Cloud\ArtifactRegistry\V1\ListVersionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListVersions', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListVersionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a version - * @param \Google\Cloud\ArtifactRegistry\V1\GetVersionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetVersion(\Google\Cloud\ArtifactRegistry\V1\GetVersionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetVersion', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Version', 'decode'], - $metadata, $options); - } - - /** - * Deletes a version and all of its content. The returned operation will - * complete once the version has been deleted. - * @param \Google\Cloud\ArtifactRegistry\V1\DeleteVersionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteVersion(\Google\Cloud\ArtifactRegistry\V1\DeleteVersionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/DeleteVersion', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists files. - * @param \Google\Cloud\ArtifactRegistry\V1\ListFilesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFiles(\Google\Cloud\ArtifactRegistry\V1\ListFilesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListFiles', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListFilesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a file. - * @param \Google\Cloud\ArtifactRegistry\V1\GetFileRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFile(\Google\Cloud\ArtifactRegistry\V1\GetFileRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetFile', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\File', 'decode'], - $metadata, $options); - } - - /** - * Lists tags. - * @param \Google\Cloud\ArtifactRegistry\V1\ListTagsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTags(\Google\Cloud\ArtifactRegistry\V1\ListTagsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListTags', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ListTagsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a tag. - * @param \Google\Cloud\ArtifactRegistry\V1\GetTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTag(\Google\Cloud\ArtifactRegistry\V1\GetTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Tag', 'decode'], - $metadata, $options); - } - - /** - * Creates a tag. - * @param \Google\Cloud\ArtifactRegistry\V1\CreateTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTag(\Google\Cloud\ArtifactRegistry\V1\CreateTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/CreateTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Tag', 'decode'], - $metadata, $options); - } - - /** - * Updates a tag. - * @param \Google\Cloud\ArtifactRegistry\V1\UpdateTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTag(\Google\Cloud\ArtifactRegistry\V1\UpdateTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\Tag', 'decode'], - $metadata, $options); - } - - /** - * Deletes a tag. - * @param \Google\Cloud\ArtifactRegistry\V1\DeleteTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTag(\Google\Cloud\ArtifactRegistry\V1\DeleteTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/DeleteTag', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Updates the IAM policy for a given resource. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Gets the IAM policy for a given resource. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Tests if the caller has a list of permissions on a resource. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves the Settings for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1\GetProjectSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetProjectSettings(\Google\Cloud\ArtifactRegistry\V1\GetProjectSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetProjectSettings', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ProjectSettings', 'decode'], - $metadata, $options); - } - - /** - * Updates the Settings for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1\UpdateProjectSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateProjectSettings(\Google\Cloud\ArtifactRegistry\V1\UpdateProjectSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateProjectSettings', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\ProjectSettings', 'decode'], - $metadata, $options); - } - - /** - * Retrieves the VPCSC Config for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1\GetVPCSCConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetVPCSCConfig(\Google\Cloud\ArtifactRegistry\V1\GetVPCSCConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetVPCSCConfig', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\VPCSCConfig', 'decode'], - $metadata, $options); - } - - /** - * Updates the VPCSC Config for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1\UpdateVPCSCConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateVPCSCConfig(\Google\Cloud\ArtifactRegistry\V1\UpdateVPCSCConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateVPCSCConfig', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1\VPCSCConfig', 'decode'], - $metadata, $options); - } - -} diff --git a/ArtifactRegistry/src/V1/BatchDeleteVersionsRequest.php b/ArtifactRegistry/src/V1/BatchDeleteVersionsRequest.php index a5c0ce417dcd..723201eacaeb 100644 --- a/ArtifactRegistry/src/V1/BatchDeleteVersionsRequest.php +++ b/ArtifactRegistry/src/V1/BatchDeleteVersionsRequest.php @@ -20,7 +20,7 @@ class BatchDeleteVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The names of the versions to delete. * A maximum of 10000 versions can be deleted in a batch. @@ -33,7 +33,7 @@ class BatchDeleteVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool validate_only = 3; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $parent The name of the repository holding all requested versions. diff --git a/ArtifactRegistry/src/V1/CleanupPolicy.php b/ArtifactRegistry/src/V1/CleanupPolicy.php index 9be654cb0c45..4b2b630b4d61 100644 --- a/ArtifactRegistry/src/V1/CleanupPolicy.php +++ b/ArtifactRegistry/src/V1/CleanupPolicy.php @@ -20,13 +20,13 @@ class CleanupPolicy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1; */ - private $id = ''; + protected $id = ''; /** * Policy action. * * Generated from protobuf field .google.devtools.artifactregistry.v1.CleanupPolicy.Action action = 3; */ - private $action = 0; + protected $action = 0; protected $condition_type; /** diff --git a/ArtifactRegistry/src/V1/CleanupPolicy/Action.php b/ArtifactRegistry/src/V1/CleanupPolicy/Action.php index e879ac0ca239..32d26e285052 100644 --- a/ArtifactRegistry/src/V1/CleanupPolicy/Action.php +++ b/ArtifactRegistry/src/V1/CleanupPolicy/Action.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Action::class, \Google\Cloud\ArtifactRegistry\V1\CleanupPolicy_Action::class); diff --git a/ArtifactRegistry/src/V1/CleanupPolicyCondition.php b/ArtifactRegistry/src/V1/CleanupPolicyCondition.php index 884037598baf..768afa66b916 100644 --- a/ArtifactRegistry/src/V1/CleanupPolicyCondition.php +++ b/ArtifactRegistry/src/V1/CleanupPolicyCondition.php @@ -22,7 +22,7 @@ class CleanupPolicyCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional .google.devtools.artifactregistry.v1.CleanupPolicyCondition.TagState tag_state = 2; */ - private $tag_state = null; + protected $tag_state = null; /** * Match versions by tag prefix. Applied on any prefix match. * @@ -46,13 +46,13 @@ class CleanupPolicyCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional .google.protobuf.Duration older_than = 6; */ - private $older_than = null; + protected $older_than = null; /** * Match versions newer than a duration. * * Generated from protobuf field optional .google.protobuf.Duration newer_than = 7; */ - private $newer_than = null; + protected $newer_than = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/CleanupPolicyCondition/TagState.php b/ArtifactRegistry/src/V1/CleanupPolicyCondition/TagState.php index 9a02a60e43c3..603ecfb2cce3 100644 --- a/ArtifactRegistry/src/V1/CleanupPolicyCondition/TagState.php +++ b/ArtifactRegistry/src/V1/CleanupPolicyCondition/TagState.php @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TagState::class, \Google\Cloud\ArtifactRegistry\V1\CleanupPolicyCondition_TagState::class); diff --git a/ArtifactRegistry/src/V1/CleanupPolicyMostRecentVersions.php b/ArtifactRegistry/src/V1/CleanupPolicyMostRecentVersions.php index 256703149a3c..7177ec80be40 100644 --- a/ArtifactRegistry/src/V1/CleanupPolicyMostRecentVersions.php +++ b/ArtifactRegistry/src/V1/CleanupPolicyMostRecentVersions.php @@ -27,7 +27,7 @@ class CleanupPolicyMostRecentVersions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional int32 keep_count = 2; */ - private $keep_count = null; + protected $keep_count = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php b/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php index 2bf40b1de27c..8ef0e0bde17b 100644 --- a/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php +++ b/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php @@ -1,6 +1,6 @@ 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; @@ -262,8 +264,12 @@ private function createOperationsClient(array $options) * * @return string The formatted docker_image resource. */ - public static function dockerImageName(string $project, string $location, string $repository, string $dockerImage): string - { + public static function dockerImageName( + string $project, + string $location, + string $repository, + string $dockerImage + ): string { return self::getPathTemplate('dockerImage')->render([ 'project' => $project, 'location' => $location, @@ -321,8 +327,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted maven_artifact resource. */ - public static function mavenArtifactName(string $project, string $location, string $repository, string $mavenArtifact): string - { + public static function mavenArtifactName( + string $project, + string $location, + string $repository, + string $mavenArtifact + ): string { return self::getPathTemplate('mavenArtifact')->render([ 'project' => $project, 'location' => $location, @@ -342,8 +352,12 @@ public static function mavenArtifactName(string $project, string $location, stri * * @return string The formatted npm_package resource. */ - public static function npmPackageName(string $project, string $location, string $repository, string $npmPackage): string - { + public static function npmPackageName( + string $project, + string $location, + string $repository, + string $npmPackage + ): string { return self::getPathTemplate('npmPackage')->render([ 'project' => $project, 'location' => $location, @@ -399,8 +413,12 @@ public static function projectSettingsName(string $project): string * * @return string The formatted python_package resource. */ - public static function pythonPackageName(string $project, string $location, string $repository, string $pythonPackage): string - { + public static function pythonPackageName( + string $project, + string $location, + string $repository, + string $pythonPackage + ): string { return self::getPathTemplate('pythonPackage')->render([ 'project' => $project, 'location' => $location, @@ -459,8 +477,13 @@ public static function secretVersionName(string $project, string $secret, string * * @return string The formatted tag resource. */ - public static function tagName(string $project, string $location, string $repository, string $package, string $tag): string - { + public static function tagName( + string $project, + string $location, + string $repository, + string $package, + string $tag + ): string { return self::getPathTemplate('tag')->render([ 'project' => $project, 'location' => $location, @@ -482,8 +505,13 @@ public static function tagName(string $project, string $location, string $reposi * * @return string The formatted version resource. */ - public static function versionName(string $project, string $location, string $repository, string $package, string $version): string - { + public static function versionName( + string $project, + string $location, + string $repository, + string $package, + string $version + ): string { return self::getPathTemplate('version')->render([ 'project' => $project, 'location' => $location, @@ -1455,8 +1483,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(); } @@ -1482,8 +1512,10 @@ public function testIamPermissions(TestIamPermissionsRequest $request, array $ca * * @throws ApiException Thrown if the API call fails. */ - public function updateProjectSettings(UpdateProjectSettingsRequest $request, array $callOptions = []): ProjectSettings - { + public function updateProjectSettings( + UpdateProjectSettingsRequest $request, + array $callOptions = [] + ): ProjectSettings { return $this->startApiCall('UpdateProjectSettings', $request, $callOptions)->wait(); } diff --git a/ArtifactRegistry/src/V1/CreateRepositoryRequest.php b/ArtifactRegistry/src/V1/CreateRepositoryRequest.php index 9d74f8efdb82..65a034b5daab 100644 --- a/ArtifactRegistry/src/V1/CreateRepositoryRequest.php +++ b/ArtifactRegistry/src/V1/CreateRepositoryRequest.php @@ -21,19 +21,19 @@ class CreateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The repository id to use for this repository. * * Generated from protobuf field string repository_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository_id = ''; + protected $repository_id = ''; /** * Required. The repository to be created. * * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository repository = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository = null; + protected $repository = null; /** * @param string $parent Required. The name of the parent resource where the repository will be diff --git a/ArtifactRegistry/src/V1/CreateTagRequest.php b/ArtifactRegistry/src/V1/CreateTagRequest.php index f2a0b641395d..731776f2ec05 100644 --- a/ArtifactRegistry/src/V1/CreateTagRequest.php +++ b/ArtifactRegistry/src/V1/CreateTagRequest.php @@ -20,19 +20,19 @@ class CreateTagRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * The tag id to use for this repository. * * Generated from protobuf field string tag_id = 2; */ - private $tag_id = ''; + protected $tag_id = ''; /** * The tag to be created. * * Generated from protobuf field .google.devtools.artifactregistry.v1.Tag tag = 3; */ - private $tag = null; + protected $tag = null; /** * @param string $parent The name of the parent resource where the tag will be created. diff --git a/ArtifactRegistry/src/V1/DeletePackageRequest.php b/ArtifactRegistry/src/V1/DeletePackageRequest.php index cd5d727f1c10..fe1c79b9ac60 100644 --- a/ArtifactRegistry/src/V1/DeletePackageRequest.php +++ b/ArtifactRegistry/src/V1/DeletePackageRequest.php @@ -20,7 +20,7 @@ class DeletePackageRequest 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 name of the package to delete. Please see diff --git a/ArtifactRegistry/src/V1/DeleteRepositoryRequest.php b/ArtifactRegistry/src/V1/DeleteRepositoryRequest.php index d325e71b4d1a..2d627544d77a 100644 --- a/ArtifactRegistry/src/V1/DeleteRepositoryRequest.php +++ b/ArtifactRegistry/src/V1/DeleteRepositoryRequest.php @@ -20,7 +20,7 @@ class DeleteRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the repository to delete. Please see diff --git a/ArtifactRegistry/src/V1/DeleteTagRequest.php b/ArtifactRegistry/src/V1/DeleteTagRequest.php index b04c2d5e3417..d358ac8e1a2c 100644 --- a/ArtifactRegistry/src/V1/DeleteTagRequest.php +++ b/ArtifactRegistry/src/V1/DeleteTagRequest.php @@ -20,7 +20,7 @@ class DeleteTagRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * @param string $name The name of the tag to delete. diff --git a/ArtifactRegistry/src/V1/DeleteVersionRequest.php b/ArtifactRegistry/src/V1/DeleteVersionRequest.php index c370bca3848d..4964e3e74200 100644 --- a/ArtifactRegistry/src/V1/DeleteVersionRequest.php +++ b/ArtifactRegistry/src/V1/DeleteVersionRequest.php @@ -20,14 +20,14 @@ class DeleteVersionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * By default, a version that is tagged may not be deleted. If force=true, the * version and any tags pointing to the version are deleted. * * Generated from protobuf field bool force = 2; */ - private $force = false; + protected $force = false; /** * @param string $name The name of the version to delete. diff --git a/ArtifactRegistry/src/V1/DockerImage.php b/ArtifactRegistry/src/V1/DockerImage.php index 036b685c4915..9637bc23a46d 100644 --- a/ArtifactRegistry/src/V1/DockerImage.php +++ b/ArtifactRegistry/src/V1/DockerImage.php @@ -34,7 +34,7 @@ class DockerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. URL to access the image. * Example: @@ -42,7 +42,7 @@ class DockerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $uri = ''; + protected $uri = ''; /** * Tags attached to this image. * @@ -56,13 +56,13 @@ class DockerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 image_size_bytes = 4; */ - private $image_size_bytes = 0; + protected $image_size_bytes = 0; /** * Time the image was uploaded. * * Generated from protobuf field .google.protobuf.Timestamp upload_time = 5; */ - private $upload_time = null; + protected $upload_time = null; /** * Media type of this image, e.g. * "application/vnd.docker.distribution.manifest.v2+json". @@ -71,7 +71,7 @@ class DockerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string media_type = 6; */ - private $media_type = ''; + protected $media_type = ''; /** * The time this image was built. * This field is returned as the 'metadata.buildTime' field in the @@ -81,13 +81,13 @@ class DockerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp build_time = 7; */ - private $build_time = null; + protected $build_time = null; /** * Output only. The time when the docker image was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/File.php b/ArtifactRegistry/src/V1/File.php index aacd601a85c6..a9aa22d95500 100644 --- a/ArtifactRegistry/src/V1/File.php +++ b/ArtifactRegistry/src/V1/File.php @@ -22,13 +22,13 @@ class File extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The size of the File in bytes. * * Generated from protobuf field int64 size_bytes = 3; */ - private $size_bytes = 0; + protected $size_bytes = 0; /** * The hashes of the file content. * @@ -40,26 +40,26 @@ class File extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the File was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The name of the Package or Version that owns this file, if any. * * Generated from protobuf field string owner = 7; */ - private $owner = ''; + protected $owner = ''; /** * Output only. The time when the last attempt to refresh the file's data was * made. Only set when the repository is remote. * * Generated from protobuf field .google.protobuf.Timestamp fetch_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $fetch_time = null; + protected $fetch_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/GetDockerImageRequest.php b/ArtifactRegistry/src/V1/GetDockerImageRequest.php index 93baa0715edc..61b5cf12ccfd 100644 --- a/ArtifactRegistry/src/V1/GetDockerImageRequest.php +++ b/ArtifactRegistry/src/V1/GetDockerImageRequest.php @@ -20,7 +20,7 @@ class GetDockerImageRequest 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 name of the docker images. Please see diff --git a/ArtifactRegistry/src/V1/GetFileRequest.php b/ArtifactRegistry/src/V1/GetFileRequest.php index 763e239ddd95..dfb6c5bd26ac 100644 --- a/ArtifactRegistry/src/V1/GetFileRequest.php +++ b/ArtifactRegistry/src/V1/GetFileRequest.php @@ -20,7 +20,7 @@ class GetFileRequest 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 name of the file to retrieve. Please see diff --git a/ArtifactRegistry/src/V1/GetMavenArtifactRequest.php b/ArtifactRegistry/src/V1/GetMavenArtifactRequest.php index 81b23e3d99d6..33f61844532d 100644 --- a/ArtifactRegistry/src/V1/GetMavenArtifactRequest.php +++ b/ArtifactRegistry/src/V1/GetMavenArtifactRequest.php @@ -20,7 +20,7 @@ class GetMavenArtifactRequest 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 name of the maven artifact. Please see diff --git a/ArtifactRegistry/src/V1/GetNpmPackageRequest.php b/ArtifactRegistry/src/V1/GetNpmPackageRequest.php index 481778356a00..19e47bc35963 100644 --- a/ArtifactRegistry/src/V1/GetNpmPackageRequest.php +++ b/ArtifactRegistry/src/V1/GetNpmPackageRequest.php @@ -20,7 +20,7 @@ class GetNpmPackageRequest 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 name of the npm package. Please see diff --git a/ArtifactRegistry/src/V1/GetPackageRequest.php b/ArtifactRegistry/src/V1/GetPackageRequest.php index ca55baadd1cb..d1cb4907aeb9 100644 --- a/ArtifactRegistry/src/V1/GetPackageRequest.php +++ b/ArtifactRegistry/src/V1/GetPackageRequest.php @@ -20,7 +20,7 @@ class GetPackageRequest 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 name of the package to retrieve. Please see diff --git a/ArtifactRegistry/src/V1/GetProjectSettingsRequest.php b/ArtifactRegistry/src/V1/GetProjectSettingsRequest.php index 2c985ed4c451..98fd5df8ddc6 100644 --- a/ArtifactRegistry/src/V1/GetProjectSettingsRequest.php +++ b/ArtifactRegistry/src/V1/GetProjectSettingsRequest.php @@ -20,7 +20,7 @@ class GetProjectSettingsRequest 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 name of the projectSettings resource. Please see diff --git a/ArtifactRegistry/src/V1/GetPythonPackageRequest.php b/ArtifactRegistry/src/V1/GetPythonPackageRequest.php index eb29a291ef2b..cc414d1512f2 100644 --- a/ArtifactRegistry/src/V1/GetPythonPackageRequest.php +++ b/ArtifactRegistry/src/V1/GetPythonPackageRequest.php @@ -20,7 +20,7 @@ class GetPythonPackageRequest 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 name of the python package. Please see diff --git a/ArtifactRegistry/src/V1/GetRepositoryRequest.php b/ArtifactRegistry/src/V1/GetRepositoryRequest.php index a8d2dd01e291..3d634bac4006 100644 --- a/ArtifactRegistry/src/V1/GetRepositoryRequest.php +++ b/ArtifactRegistry/src/V1/GetRepositoryRequest.php @@ -20,7 +20,7 @@ class GetRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the repository to retrieve. Please see diff --git a/ArtifactRegistry/src/V1/GetTagRequest.php b/ArtifactRegistry/src/V1/GetTagRequest.php index 4e14051ace39..1f8670ee2d17 100644 --- a/ArtifactRegistry/src/V1/GetTagRequest.php +++ b/ArtifactRegistry/src/V1/GetTagRequest.php @@ -20,7 +20,7 @@ class GetTagRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * @param string $name The name of the tag to retrieve. diff --git a/ArtifactRegistry/src/V1/GetVPCSCConfigRequest.php b/ArtifactRegistry/src/V1/GetVPCSCConfigRequest.php index c042439898e8..15127233c42b 100644 --- a/ArtifactRegistry/src/V1/GetVPCSCConfigRequest.php +++ b/ArtifactRegistry/src/V1/GetVPCSCConfigRequest.php @@ -20,7 +20,7 @@ class GetVPCSCConfigRequest 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 name of the VPCSCConfig resource. Please see diff --git a/ArtifactRegistry/src/V1/GetVersionRequest.php b/ArtifactRegistry/src/V1/GetVersionRequest.php index 69b3d32b7ff0..c41a97ec0384 100644 --- a/ArtifactRegistry/src/V1/GetVersionRequest.php +++ b/ArtifactRegistry/src/V1/GetVersionRequest.php @@ -20,13 +20,13 @@ class GetVersionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The view that should be returned in the response. * * Generated from protobuf field .google.devtools.artifactregistry.v1.VersionView view = 2; */ - private $view = 0; + protected $view = 0; /** * @param string $name The name of the version to retrieve. diff --git a/ArtifactRegistry/src/V1/Hash.php b/ArtifactRegistry/src/V1/Hash.php index 9ab59f95dcd2..79bcb7533540 100644 --- a/ArtifactRegistry/src/V1/Hash.php +++ b/ArtifactRegistry/src/V1/Hash.php @@ -20,13 +20,13 @@ class Hash extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.Hash.HashType type = 1; */ - private $type = 0; + protected $type = 0; /** * The hash value. * * Generated from protobuf field bytes value = 2; */ - private $value = ''; + protected $value = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/Hash/HashType.php b/ArtifactRegistry/src/V1/Hash/HashType.php index 51fcd6f07fc3..84d9f35c2818 100644 --- a/ArtifactRegistry/src/V1/Hash/HashType.php +++ b/ArtifactRegistry/src/V1/Hash/HashType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HashType::class, \Google\Cloud\ArtifactRegistry\V1\Hash_HashType::class); diff --git a/ArtifactRegistry/src/V1/ImportAptArtifactsErrorInfo.php b/ArtifactRegistry/src/V1/ImportAptArtifactsErrorInfo.php index 3fa98d6f5c00..eb25e2abc7e3 100644 --- a/ArtifactRegistry/src/V1/ImportAptArtifactsErrorInfo.php +++ b/ArtifactRegistry/src/V1/ImportAptArtifactsErrorInfo.php @@ -20,7 +20,7 @@ class ImportAptArtifactsErrorInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.rpc.Status error = 2; */ - private $error = null; + protected $error = null; protected $source; /** diff --git a/ArtifactRegistry/src/V1/ImportAptArtifactsGcsSource.php b/ArtifactRegistry/src/V1/ImportAptArtifactsGcsSource.php index 0a3036bf77c6..0d7d9bee210a 100644 --- a/ArtifactRegistry/src/V1/ImportAptArtifactsGcsSource.php +++ b/ArtifactRegistry/src/V1/ImportAptArtifactsGcsSource.php @@ -26,7 +26,7 @@ class ImportAptArtifactsGcsSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool use_wildcards = 2; */ - private $use_wildcards = false; + protected $use_wildcards = false; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ImportAptArtifactsRequest.php b/ArtifactRegistry/src/V1/ImportAptArtifactsRequest.php index 6a4a07eb8067..fc3e346ecd7c 100644 --- a/ArtifactRegistry/src/V1/ImportAptArtifactsRequest.php +++ b/ArtifactRegistry/src/V1/ImportAptArtifactsRequest.php @@ -20,7 +20,7 @@ class ImportAptArtifactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; protected $source; /** diff --git a/ArtifactRegistry/src/V1/ImportYumArtifactsErrorInfo.php b/ArtifactRegistry/src/V1/ImportYumArtifactsErrorInfo.php index 748801707ca3..1a2af81059d7 100644 --- a/ArtifactRegistry/src/V1/ImportYumArtifactsErrorInfo.php +++ b/ArtifactRegistry/src/V1/ImportYumArtifactsErrorInfo.php @@ -20,7 +20,7 @@ class ImportYumArtifactsErrorInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.rpc.Status error = 2; */ - private $error = null; + protected $error = null; protected $source; /** diff --git a/ArtifactRegistry/src/V1/ImportYumArtifactsGcsSource.php b/ArtifactRegistry/src/V1/ImportYumArtifactsGcsSource.php index 766c697927e9..5260dca32be4 100644 --- a/ArtifactRegistry/src/V1/ImportYumArtifactsGcsSource.php +++ b/ArtifactRegistry/src/V1/ImportYumArtifactsGcsSource.php @@ -26,7 +26,7 @@ class ImportYumArtifactsGcsSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool use_wildcards = 2; */ - private $use_wildcards = false; + protected $use_wildcards = false; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ImportYumArtifactsRequest.php b/ArtifactRegistry/src/V1/ImportYumArtifactsRequest.php index bc4fba037d5b..a9852949319c 100644 --- a/ArtifactRegistry/src/V1/ImportYumArtifactsRequest.php +++ b/ArtifactRegistry/src/V1/ImportYumArtifactsRequest.php @@ -20,7 +20,7 @@ class ImportYumArtifactsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; protected $source; /** diff --git a/ArtifactRegistry/src/V1/ListDockerImagesRequest.php b/ArtifactRegistry/src/V1/ListDockerImagesRequest.php index ff73977e5df1..6b0dff272eab 100644 --- a/ArtifactRegistry/src/V1/ListDockerImagesRequest.php +++ b/ArtifactRegistry/src/V1/ListDockerImagesRequest.php @@ -21,25 +21,25 @@ class ListDockerImagesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of artifacts to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * The field to order the results by. * * Generated from protobuf field string order_by = 4; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The name of the parent resource whose docker images will be diff --git a/ArtifactRegistry/src/V1/ListDockerImagesResponse.php b/ArtifactRegistry/src/V1/ListDockerImagesResponse.php index 32460b5c4103..2ccec19eb3ee 100644 --- a/ArtifactRegistry/src/V1/ListDockerImagesResponse.php +++ b/ArtifactRegistry/src/V1/ListDockerImagesResponse.php @@ -27,7 +27,7 @@ class ListDockerImagesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListFilesRequest.php b/ArtifactRegistry/src/V1/ListFilesRequest.php index 31f8a7eeb749..f8cf0a6173ca 100644 --- a/ArtifactRegistry/src/V1/ListFilesRequest.php +++ b/ArtifactRegistry/src/V1/ListFilesRequest.php @@ -21,7 +21,7 @@ class ListFilesRequest 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 = ''; /** * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: @@ -35,25 +35,25 @@ class ListFilesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of files to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * The field to order the results by. * * Generated from protobuf field string order_by = 5; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent Required. The name of the repository whose files will be listed. For diff --git a/ArtifactRegistry/src/V1/ListFilesResponse.php b/ArtifactRegistry/src/V1/ListFilesResponse.php index 8ed6ed608ede..96f058260762 100644 --- a/ArtifactRegistry/src/V1/ListFilesResponse.php +++ b/ArtifactRegistry/src/V1/ListFilesResponse.php @@ -27,7 +27,7 @@ class ListFilesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php b/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php index 010b068680ab..4db5ada82688 100644 --- a/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php +++ b/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php @@ -21,19 +21,19 @@ class ListMavenArtifactsRequest 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 = ''; /** * The maximum number of artifacts to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The name of the parent resource whose maven artifacts will be diff --git a/ArtifactRegistry/src/V1/ListMavenArtifactsResponse.php b/ArtifactRegistry/src/V1/ListMavenArtifactsResponse.php index cb3f930a7dd3..b1de1f21db3d 100644 --- a/ArtifactRegistry/src/V1/ListMavenArtifactsResponse.php +++ b/ArtifactRegistry/src/V1/ListMavenArtifactsResponse.php @@ -27,7 +27,7 @@ class ListMavenArtifactsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php b/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php index 6631badb0e31..66ab4c44a7c4 100644 --- a/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php +++ b/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php @@ -21,19 +21,19 @@ class ListNpmPackagesRequest 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 = ''; /** * The maximum number of artifacts to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The name of the parent resource whose npm packages will be diff --git a/ArtifactRegistry/src/V1/ListNpmPackagesResponse.php b/ArtifactRegistry/src/V1/ListNpmPackagesResponse.php index 246166ff20db..ad1c6898e324 100644 --- a/ArtifactRegistry/src/V1/ListNpmPackagesResponse.php +++ b/ArtifactRegistry/src/V1/ListNpmPackagesResponse.php @@ -27,7 +27,7 @@ class ListNpmPackagesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListPackagesRequest.php b/ArtifactRegistry/src/V1/ListPackagesRequest.php index d2a6f0f0b2b3..cf8929daaf9d 100644 --- a/ArtifactRegistry/src/V1/ListPackagesRequest.php +++ b/ArtifactRegistry/src/V1/ListPackagesRequest.php @@ -20,19 +20,19 @@ class ListPackagesRequest 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 = ''; /** * The maximum number of packages to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The name of the parent resource whose packages will be listed. Please see diff --git a/ArtifactRegistry/src/V1/ListPackagesResponse.php b/ArtifactRegistry/src/V1/ListPackagesResponse.php index ad39ce5ef351..8822cdbba69f 100644 --- a/ArtifactRegistry/src/V1/ListPackagesResponse.php +++ b/ArtifactRegistry/src/V1/ListPackagesResponse.php @@ -27,7 +27,7 @@ class ListPackagesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php b/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php index 91fc8ff849d0..a49653837a14 100644 --- a/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php +++ b/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php @@ -21,19 +21,19 @@ class ListPythonPackagesRequest 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 = ''; /** * The maximum number of artifacts to return. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The name of the parent resource whose python packages will be diff --git a/ArtifactRegistry/src/V1/ListPythonPackagesResponse.php b/ArtifactRegistry/src/V1/ListPythonPackagesResponse.php index e3bc4b6a5f6c..b985eecc48ea 100644 --- a/ArtifactRegistry/src/V1/ListPythonPackagesResponse.php +++ b/ArtifactRegistry/src/V1/ListPythonPackagesResponse.php @@ -27,7 +27,7 @@ class ListPythonPackagesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListRepositoriesRequest.php b/ArtifactRegistry/src/V1/ListRepositoriesRequest.php index 9a3013bc329c..6c4d1e49225d 100644 --- a/ArtifactRegistry/src/V1/ListRepositoriesRequest.php +++ b/ArtifactRegistry/src/V1/ListRepositoriesRequest.php @@ -21,19 +21,19 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of repositories to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The name of the parent resource whose repositories will be diff --git a/ArtifactRegistry/src/V1/ListRepositoriesResponse.php b/ArtifactRegistry/src/V1/ListRepositoriesResponse.php index 299768440de9..263872d9a2dc 100644 --- a/ArtifactRegistry/src/V1/ListRepositoriesResponse.php +++ b/ArtifactRegistry/src/V1/ListRepositoriesResponse.php @@ -27,7 +27,7 @@ class ListRepositoriesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListTagsRequest.php b/ArtifactRegistry/src/V1/ListTagsRequest.php index d823bad7f24a..3f5b8a81b0c6 100644 --- a/ArtifactRegistry/src/V1/ListTagsRequest.php +++ b/ArtifactRegistry/src/V1/ListTagsRequest.php @@ -22,7 +22,7 @@ class ListTagsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: @@ -33,19 +33,19 @@ class ListTagsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * The maximum number of tags to return. Maximum page size is 10,000. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent The name of the parent package whose tags will be listed. diff --git a/ArtifactRegistry/src/V1/ListTagsResponse.php b/ArtifactRegistry/src/V1/ListTagsResponse.php index c2696eb15f1d..5d1c4b49930c 100644 --- a/ArtifactRegistry/src/V1/ListTagsResponse.php +++ b/ArtifactRegistry/src/V1/ListTagsResponse.php @@ -27,7 +27,7 @@ class ListTagsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ListVersionsRequest.php b/ArtifactRegistry/src/V1/ListVersionsRequest.php index 19aa4a5d85bb..b10835ebe609 100644 --- a/ArtifactRegistry/src/V1/ListVersionsRequest.php +++ b/ArtifactRegistry/src/V1/ListVersionsRequest.php @@ -20,31 +20,31 @@ class ListVersionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * The maximum number of versions to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * The next_page_token value returned from a previous list request, if any. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * The view that should be returned in the response. * * Generated from protobuf field .google.devtools.artifactregistry.v1.VersionView view = 4; */ - private $view = 0; + protected $view = 0; /** * Optional. The field to order the results by. * * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $order_by = ''; + protected $order_by = ''; /** * @param string $parent The name of the parent resource whose versions will be listed. diff --git a/ArtifactRegistry/src/V1/ListVersionsResponse.php b/ArtifactRegistry/src/V1/ListVersionsResponse.php index fd6fc996a52c..3aaa352298a4 100644 --- a/ArtifactRegistry/src/V1/ListVersionsResponse.php +++ b/ArtifactRegistry/src/V1/ListVersionsResponse.php @@ -27,7 +27,7 @@ class ListVersionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/MavenArtifact.php b/ArtifactRegistry/src/V1/MavenArtifact.php index dc5d943f5dcc..6ade7c6ddb1e 100644 --- a/ArtifactRegistry/src/V1/MavenArtifact.php +++ b/ArtifactRegistry/src/V1/MavenArtifact.php @@ -27,7 +27,7 @@ class MavenArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. URL to access the pom file of the artifact. * Example: @@ -35,7 +35,7 @@ class MavenArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string pom_uri = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $pom_uri = ''; + protected $pom_uri = ''; /** * Group ID for the artifact. * Example: @@ -43,31 +43,31 @@ class MavenArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string group_id = 3; */ - private $group_id = ''; + protected $group_id = ''; /** * Artifact ID for the artifact. * * Generated from protobuf field string artifact_id = 4; */ - private $artifact_id = ''; + protected $artifact_id = ''; /** * Version of this artifact. * * Generated from protobuf field string version = 5; */ - private $version = ''; + protected $version = ''; /** * Output only. Time the artifact was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time the artifact was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/NpmPackage.php b/ArtifactRegistry/src/V1/NpmPackage.php index 5e00d0646b7e..ef9668517d0a 100644 --- a/ArtifactRegistry/src/V1/NpmPackage.php +++ b/ArtifactRegistry/src/V1/NpmPackage.php @@ -26,19 +26,19 @@ class NpmPackage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Package for the artifact. * * Generated from protobuf field string package_name = 3; */ - private $package_name = ''; + protected $package_name = ''; /** * Version of this package. * * Generated from protobuf field string version = 4; */ - private $version = ''; + protected $version = ''; /** * Tags attached to this package. * @@ -50,13 +50,13 @@ class NpmPackage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time the package was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/Package.php b/ArtifactRegistry/src/V1/Package.php index ac28a080f850..a61c4fe1b73a 100644 --- a/ArtifactRegistry/src/V1/Package.php +++ b/ArtifactRegistry/src/V1/Package.php @@ -22,26 +22,26 @@ class Package extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The display name of the package. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * The time when the package was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; */ - private $create_time = null; + protected $create_time = null; /** * The time when the package was last updated. This includes publishing a new * version of the package. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ProjectSettings.php b/ArtifactRegistry/src/V1/ProjectSettings.php index e9a64f8a8cf3..d9ff5a79afbf 100644 --- a/ArtifactRegistry/src/V1/ProjectSettings.php +++ b/ArtifactRegistry/src/V1/ProjectSettings.php @@ -24,13 +24,13 @@ class ProjectSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The redirection state of the legacy repositories in this project. * * Generated from protobuf field .google.devtools.artifactregistry.v1.ProjectSettings.RedirectionState legacy_redirection_state = 2; */ - private $legacy_redirection_state = 0; + protected $legacy_redirection_state = 0; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php b/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php index 111982d6d491..e07820abc46e 100644 --- a/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php +++ b/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RedirectionState::class, \Google\Cloud\ArtifactRegistry\V1\ProjectSettings_RedirectionState::class); diff --git a/ArtifactRegistry/src/V1/PythonPackage.php b/ArtifactRegistry/src/V1/PythonPackage.php index c700bddba577..208ad38fd84c 100644 --- a/ArtifactRegistry/src/V1/PythonPackage.php +++ b/ArtifactRegistry/src/V1/PythonPackage.php @@ -28,7 +28,7 @@ class PythonPackage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. URL to access the package. * Example: @@ -36,31 +36,31 @@ class PythonPackage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $uri = ''; + protected $uri = ''; /** * Package for the artifact. * * Generated from protobuf field string package_name = 3; */ - private $package_name = ''; + protected $package_name = ''; /** * Version of this package. * * Generated from protobuf field string version = 4; */ - private $version = ''; + protected $version = ''; /** * Output only. Time the package was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Time the package was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php index 5f03fc03310d..cb55a85f5d2b 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php @@ -20,13 +20,13 @@ class RemoteRepositoryConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 1; */ - private $description = ''; + protected $description = ''; /** * Optional. The credentials used to access the remote repository. * * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials upstream_credentials = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $upstream_credentials = null; + protected $upstream_credentials = null; protected $remote_source; /** diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php index e4ff37453569..18e276a813fc 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AptRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_AptRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository.php index f3d02fce05a0..f60518a37a4a 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository.php @@ -21,13 +21,13 @@ class PublicRepository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.RepositoryBase repository_base = 1; */ - private $repository_base = 0; + protected $repository_base = 0; /** * A custom field to define a path to a specific repository from the base. * * Generated from protobuf field string repository_path = 2; */ - private $repository_path = ''; + protected $repository_path = ''; /** * Constructor. @@ -100,6 +100,4 @@ public function setRepositoryPath($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_AptRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php index bfac3b3c00f2..54db0e457c47 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RepositoryBase::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_AptRepository_PublicRepository_RepositoryBase::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php index f3aa08487fec..07f77336e9c7 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DockerRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_DockerRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository/PublicRepository.php index 82a2deb86984..4d954a9f3918 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository/PublicRepository.php @@ -53,6 +53,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_DockerRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php index a8bd17ce0816..85653c2ba49d 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MavenRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_MavenRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository/PublicRepository.php index 7756888aacf6..7b25a3fb3142 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository/PublicRepository.php @@ -53,6 +53,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_MavenRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php index df82dde05d50..9dabce6bd8f3 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NpmRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_NpmRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository/PublicRepository.php index 35a37914d7d1..4c0f8ad74199 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository/PublicRepository.php @@ -52,6 +52,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_NpmRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php index 112d8e310400..8dd53a3ffb4d 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PythonRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_PythonRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository/PublicRepository.php index 1a20ffd2e141..0c0f019d3aa9 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository/PublicRepository.php @@ -52,6 +52,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_PythonRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials.php index f4b88b8352ad..7d2d010db09e 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials.php @@ -73,6 +73,4 @@ public function getCredentials() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UpstreamCredentials::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_UpstreamCredentials::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials/UsernamePasswordCredentials.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials/UsernamePasswordCredentials.php index 03f346069806..ed75420760fd 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials/UsernamePasswordCredentials.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/UpstreamCredentials/UsernamePasswordCredentials.php @@ -20,7 +20,7 @@ class UsernamePasswordCredentials extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string username = 1; */ - private $username = ''; + protected $username = ''; /** * The Secret Manager key version that holds the password to access the * remote repository. Must be in the format of @@ -28,7 +28,7 @@ class UsernamePasswordCredentials extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string password_secret_version = 2 [(.google.api.resource_reference) = { */ - private $password_secret_version = ''; + protected $password_secret_version = ''; /** * Constructor. @@ -107,6 +107,4 @@ public function setPasswordSecretVersion($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UsernamePasswordCredentials::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_UpstreamCredentials_UsernamePasswordCredentials::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php index 85505dc27beb..a9792a1236b4 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php @@ -76,6 +76,4 @@ public function getUpstream() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(YumRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_YumRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository.php index ec5e8961c537..49be52dee114 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository.php @@ -21,13 +21,13 @@ class PublicRepository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.RepositoryBase repository_base = 1; */ - private $repository_base = 0; + protected $repository_base = 0; /** * A custom field to define a path to a specific repository from the base. * * Generated from protobuf field string repository_path = 2; */ - private $repository_path = ''; + protected $repository_path = ''; /** * Constructor. @@ -100,6 +100,4 @@ public function setRepositoryPath($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PublicRepository::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_YumRepository_PublicRepository::class); diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository/RepositoryBase.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository/RepositoryBase.php index 938be50a17f8..7a57cf061198 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository/RepositoryBase.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/PublicRepository/RepositoryBase.php @@ -87,6 +87,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RepositoryBase::class, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig_YumRepository_PublicRepository_RepositoryBase::class); diff --git a/ArtifactRegistry/src/V1/Repository.php b/ArtifactRegistry/src/V1/Repository.php index 9854921dd605..b162598ad0f5 100644 --- a/ArtifactRegistry/src/V1/Repository.php +++ b/ArtifactRegistry/src/V1/Repository.php @@ -21,19 +21,19 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Optional. The format of packages that are stored in the repository. * * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.Format format = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $format = 0; + protected $format = 0; /** * The user-provided description of the repository. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * Labels with user-defined metadata. * This field may contain up to 64 entries. Label keys and values may be no @@ -49,13 +49,13 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time when the repository was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * The Cloud KMS resource name of the customer managed encryption key that's * used to encrypt the contents of the Repository. Has the form: @@ -64,13 +64,13 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kms_key_name = 8; */ - private $kms_key_name = ''; + protected $kms_key_name = ''; /** * Optional. The mode of the repository. * * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.Mode mode = 10 [(.google.api.field_behavior) = OPTIONAL]; */ - private $mode = 0; + protected $mode = 0; /** * Optional. Cleanup policies for this repository. Cleanup policies indicate * when certain package versions can be automatically deleted. Map keys are @@ -87,20 +87,20 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 size_bytes = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $size_bytes = 0; + protected $size_bytes = 0; /** * Output only. If set, the repository satisfies physical zone separation. * * Generated from protobuf field bool satisfies_pzs = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $satisfies_pzs = false; + protected $satisfies_pzs = false; /** * Optional. If true, the cleanup pipeline is prevented from deleting versions * in this repository. * * Generated from protobuf field bool cleanup_policy_dry_run = 18 [(.google.api.field_behavior) = OPTIONAL]; */ - private $cleanup_policy_dry_run = false; + protected $cleanup_policy_dry_run = false; protected $format_config; protected $mode_config; diff --git a/ArtifactRegistry/src/V1/Repository/DockerRepositoryConfig.php b/ArtifactRegistry/src/V1/Repository/DockerRepositoryConfig.php index 8111fd29bab9..d81fb3345003 100644 --- a/ArtifactRegistry/src/V1/Repository/DockerRepositoryConfig.php +++ b/ArtifactRegistry/src/V1/Repository/DockerRepositoryConfig.php @@ -24,7 +24,7 @@ class DockerRepositoryConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool immutable_tags = 1; */ - private $immutable_tags = false; + protected $immutable_tags = false; /** * Constructor. @@ -75,6 +75,4 @@ public function setImmutableTags($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DockerRepositoryConfig::class, \Google\Cloud\ArtifactRegistry\V1\Repository_DockerRepositoryConfig::class); diff --git a/ArtifactRegistry/src/V1/Repository/Format.php b/ArtifactRegistry/src/V1/Repository/Format.php index 20aa9b235548..6fc8c1369014 100644 --- a/ArtifactRegistry/src/V1/Repository/Format.php +++ b/ArtifactRegistry/src/V1/Repository/Format.php @@ -101,6 +101,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Format::class, \Google\Cloud\ArtifactRegistry\V1\Repository_Format::class); diff --git a/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig.php b/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig.php index 1dc575167345..00844c17eaaa 100644 --- a/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig.php +++ b/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig.php @@ -23,13 +23,13 @@ class MavenRepositoryConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool allow_snapshot_overwrites = 1; */ - private $allow_snapshot_overwrites = false; + protected $allow_snapshot_overwrites = false; /** * Version policy defines the versions that the registry will accept. * * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.VersionPolicy version_policy = 2; */ - private $version_policy = 0; + protected $version_policy = 0; /** * Constructor. @@ -105,6 +105,4 @@ public function setVersionPolicy($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MavenRepositoryConfig::class, \Google\Cloud\ArtifactRegistry\V1\Repository_MavenRepositoryConfig::class); diff --git a/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig/VersionPolicy.php b/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig/VersionPolicy.php index f31177cd8212..c59076e33839 100644 --- a/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig/VersionPolicy.php +++ b/ArtifactRegistry/src/V1/Repository/MavenRepositoryConfig/VersionPolicy.php @@ -61,6 +61,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(VersionPolicy::class, \Google\Cloud\ArtifactRegistry\V1\Repository_MavenRepositoryConfig_VersionPolicy::class); diff --git a/ArtifactRegistry/src/V1/Repository/Mode.php b/ArtifactRegistry/src/V1/Repository/Mode.php index b4830a8974a9..eb6554e12f24 100644 --- a/ArtifactRegistry/src/V1/Repository/Mode.php +++ b/ArtifactRegistry/src/V1/Repository/Mode.php @@ -67,6 +67,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Mode::class, \Google\Cloud\ArtifactRegistry\V1\Repository_Mode::class); diff --git a/ArtifactRegistry/src/V1/Tag.php b/ArtifactRegistry/src/V1/Tag.php index a0f36f6551c9..01d7525b1fee 100644 --- a/ArtifactRegistry/src/V1/Tag.php +++ b/ArtifactRegistry/src/V1/Tag.php @@ -25,7 +25,7 @@ class Tag extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The name of the version the tag refers to, for example: * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" @@ -34,7 +34,7 @@ class Tag extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 2; */ - private $version = ''; + protected $version = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/UpdateProjectSettingsRequest.php b/ArtifactRegistry/src/V1/UpdateProjectSettingsRequest.php index 170780c1977c..77413896bc4a 100644 --- a/ArtifactRegistry/src/V1/UpdateProjectSettingsRequest.php +++ b/ArtifactRegistry/src/V1/UpdateProjectSettingsRequest.php @@ -20,13 +20,13 @@ class UpdateProjectSettingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.ProjectSettings project_settings = 2; */ - private $project_settings = null; + protected $project_settings = null; /** * Field mask to support partial updates. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\ArtifactRegistry\V1\ProjectSettings $projectSettings The project settings. diff --git a/ArtifactRegistry/src/V1/UpdateRepositoryRequest.php b/ArtifactRegistry/src/V1/UpdateRepositoryRequest.php index 249a68d8a627..c0156c13d4c5 100644 --- a/ArtifactRegistry/src/V1/UpdateRepositoryRequest.php +++ b/ArtifactRegistry/src/V1/UpdateRepositoryRequest.php @@ -20,7 +20,7 @@ class UpdateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository repository = 1; */ - private $repository = null; + protected $repository = null; /** * The update mask applies to the resource. For the `FieldMask` definition, * see @@ -28,7 +28,7 @@ class UpdateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\ArtifactRegistry\V1\Repository $repository The repository that replaces the resource on the server. diff --git a/ArtifactRegistry/src/V1/UpdateTagRequest.php b/ArtifactRegistry/src/V1/UpdateTagRequest.php index b9ed0350e838..d9315b739945 100644 --- a/ArtifactRegistry/src/V1/UpdateTagRequest.php +++ b/ArtifactRegistry/src/V1/UpdateTagRequest.php @@ -20,7 +20,7 @@ class UpdateTagRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.Tag tag = 1; */ - private $tag = null; + protected $tag = null; /** * The update mask applies to the resource. For the `FieldMask` definition, * see @@ -28,7 +28,7 @@ class UpdateTagRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\ArtifactRegistry\V1\Tag $tag The tag that replaces the resource on the server. diff --git a/ArtifactRegistry/src/V1/UpdateVPCSCConfigRequest.php b/ArtifactRegistry/src/V1/UpdateVPCSCConfigRequest.php index 64fcf395ecbc..bce2a364212f 100644 --- a/ArtifactRegistry/src/V1/UpdateVPCSCConfigRequest.php +++ b/ArtifactRegistry/src/V1/UpdateVPCSCConfigRequest.php @@ -20,13 +20,13 @@ class UpdateVPCSCConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.artifactregistry.v1.VPCSCConfig vpcsc_config = 1; */ - private $vpcsc_config = null; + protected $vpcsc_config = null; /** * Field mask to support partial updates. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\ArtifactRegistry\V1\VPCSCConfig $vpcscConfig The project config. diff --git a/ArtifactRegistry/src/V1/UpstreamPolicy.php b/ArtifactRegistry/src/V1/UpstreamPolicy.php index cfd7fbcf1563..909b306d0796 100644 --- a/ArtifactRegistry/src/V1/UpstreamPolicy.php +++ b/ArtifactRegistry/src/V1/UpstreamPolicy.php @@ -20,20 +20,20 @@ class UpstreamPolicy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1; */ - private $id = ''; + protected $id = ''; /** * A reference to the repository resource, for example: * `projects/p1/locations/us-central1/repositories/repo1`. * * Generated from protobuf field string repository = 2 [(.google.api.resource_reference) = { */ - private $repository = ''; + protected $repository = ''; /** * Entries with a greater priority value take precedence in the pull order. * * Generated from protobuf field int32 priority = 3; */ - private $priority = 0; + protected $priority = 0; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/VPCSCConfig.php b/ArtifactRegistry/src/V1/VPCSCConfig.php index 666ce5c4a7d1..ceb797f0ad22 100644 --- a/ArtifactRegistry/src/V1/VPCSCConfig.php +++ b/ArtifactRegistry/src/V1/VPCSCConfig.php @@ -24,14 +24,14 @@ class VPCSCConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The project per location VPC SC policy that defines the VPC SC behavior for * the Remote Repository (Allow/Deny). * * Generated from protobuf field .google.devtools.artifactregistry.v1.VPCSCConfig.VPCSCPolicy vpcsc_policy = 2; */ - private $vpcsc_policy = 0; + protected $vpcsc_policy = 0; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/VPCSCConfig/VPCSCPolicy.php b/ArtifactRegistry/src/V1/VPCSCConfig/VPCSCPolicy.php index b42a04df0262..450db453f7bc 100644 --- a/ArtifactRegistry/src/V1/VPCSCConfig/VPCSCPolicy.php +++ b/ArtifactRegistry/src/V1/VPCSCConfig/VPCSCPolicy.php @@ -63,6 +63,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(VPCSCPolicy::class, \Google\Cloud\ArtifactRegistry\V1\VPCSCConfig_VPCSCPolicy::class); diff --git a/ArtifactRegistry/src/V1/Version.php b/ArtifactRegistry/src/V1/Version.php index 26d12fd0f97d..d0e6b33aa05a 100644 --- a/ArtifactRegistry/src/V1/Version.php +++ b/ArtifactRegistry/src/V1/Version.php @@ -25,25 +25,25 @@ class Version extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Optional. Description of the version, as specified in its metadata. * * Generated from protobuf field string description = 3; */ - private $description = ''; + protected $description = ''; /** * The time when the version was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; */ - private $create_time = null; + protected $create_time = null; /** * The time when the version was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; */ - private $update_time = null; + protected $update_time = null; /** * Output only. A list of related tags. Will contain up to 100 tags that * reference this version. @@ -60,7 +60,7 @@ class Version extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $metadata = null; + protected $metadata = null; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/YumArtifact.php b/ArtifactRegistry/src/V1/YumArtifact.php index 7c7ac761b7da..b50bad3012ac 100644 --- a/ArtifactRegistry/src/V1/YumArtifact.php +++ b/ArtifactRegistry/src/V1/YumArtifact.php @@ -20,25 +20,25 @@ class YumArtifact extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Output only. The yum package name of the artifact. * * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $package_name = ''; + protected $package_name = ''; /** * Output only. An artifact is a binary or source package. * * Generated from protobuf field .google.devtools.artifactregistry.v1.YumArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $package_type = 0; + protected $package_type = 0; /** * Output only. Operating system architecture of the artifact. * * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $architecture = ''; + protected $architecture = ''; /** * Constructor. diff --git a/ArtifactRegistry/src/V1/YumArtifact/PackageType.php b/ArtifactRegistry/src/V1/YumArtifact/PackageType.php index 3e2b075bd74b..5c17f3f677d0 100644 --- a/ArtifactRegistry/src/V1/YumArtifact/PackageType.php +++ b/ArtifactRegistry/src/V1/YumArtifact/PackageType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PackageType::class, \Google\Cloud\ArtifactRegistry\V1\YumArtifact_PackageType::class); diff --git a/ArtifactRegistry/src/V1beta2/AptArtifact.php b/ArtifactRegistry/src/V1beta2/AptArtifact.php deleted file mode 100644 index 95e358de484d..000000000000 --- a/ArtifactRegistry/src/V1beta2/AptArtifact.php +++ /dev/null @@ -1,239 +0,0 @@ -google.devtools.artifactregistry.v1beta2.AptArtifact - */ -class AptArtifact extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * Output only. The Apt package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $package_name = ''; - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $package_type = 0; - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $architecture = ''; - /** - * Output only. Repository component of the artifact. - * - * Generated from protobuf field string component = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $component = ''; - /** - * Output only. Contents of the artifact's control metadata file. - * - * Generated from protobuf field bytes control_file = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $control_file = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The Artifact Registry resource name of the artifact. - * @type string $package_name - * Output only. The Apt package name of the artifact. - * @type int $package_type - * Output only. An artifact is a binary or source package. - * @type string $architecture - * Output only. Operating system architecture of the artifact. - * @type string $component - * Output only. Repository component of the artifact. - * @type string $control_file - * Output only. Contents of the artifact's control metadata file. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The Apt package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getPackageName() - { - return $this->package_name; - } - - /** - * Output only. The Apt package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPackageName($var) - { - GPBUtil::checkString($var, True); - $this->package_name = $var; - - return $this; - } - - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getPackageType() - { - return $this->package_type; - } - - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setPackageType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\AptArtifact\PackageType::class); - $this->package_type = $var; - - return $this; - } - - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getArchitecture() - { - return $this->architecture; - } - - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setArchitecture($var) - { - GPBUtil::checkString($var, True); - $this->architecture = $var; - - return $this; - } - - /** - * Output only. Repository component of the artifact. - * - * Generated from protobuf field string component = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getComponent() - { - return $this->component; - } - - /** - * Output only. Repository component of the artifact. - * - * Generated from protobuf field string component = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setComponent($var) - { - GPBUtil::checkString($var, True); - $this->component = $var; - - return $this; - } - - /** - * Output only. Contents of the artifact's control metadata file. - * - * Generated from protobuf field bytes control_file = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getControlFile() - { - return $this->control_file; - } - - /** - * Output only. Contents of the artifact's control metadata file. - * - * Generated from protobuf field bytes control_file = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setControlFile($var) - { - GPBUtil::checkString($var, False); - $this->control_file = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/AptArtifact/PackageType.php b/ArtifactRegistry/src/V1beta2/AptArtifact/PackageType.php deleted file mode 100644 index bbc443e0e109..000000000000 --- a/ArtifactRegistry/src/V1beta2/AptArtifact/PackageType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.devtools.artifactregistry.v1beta2.AptArtifact.PackageType - */ -class PackageType -{ - /** - * Package type is not specified. - * - * Generated from protobuf enum PACKAGE_TYPE_UNSPECIFIED = 0; - */ - const PACKAGE_TYPE_UNSPECIFIED = 0; - /** - * Binary package. - * - * Generated from protobuf enum BINARY = 1; - */ - const BINARY = 1; - /** - * Source package. - * - * Generated from protobuf enum SOURCE = 2; - */ - const SOURCE = 2; - - private static $valueToName = [ - self::PACKAGE_TYPE_UNSPECIFIED => 'PACKAGE_TYPE_UNSPECIFIED', - self::BINARY => 'BINARY', - self::SOURCE => 'SOURCE', - ]; - - 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(PackageType::class, \Google\Cloud\ArtifactRegistry\V1beta2\AptArtifact_PackageType::class); - diff --git a/ArtifactRegistry/src/V1beta2/AptArtifact_PackageType.php b/ArtifactRegistry/src/V1beta2/AptArtifact_PackageType.php deleted file mode 100644 index 8dbb125dad92..000000000000 --- a/ArtifactRegistry/src/V1beta2/AptArtifact_PackageType.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ImportAptArtifacts', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Imports Yum (RPM) artifacts. The returned Operation will complete once the - * resources are imported. Package, Version, and File resources are created - * based on the imported artifacts. Imported artifacts that conflict with - * existing resources are ignored. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ImportYumArtifacts(\Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ImportYumArtifacts', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists repositories. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ListRepositoriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListRepositories(\Google\Cloud\ArtifactRegistry\V1beta2\ListRepositoriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListRepositories', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ListRepositoriesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a repository. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetRepository(\Google\Cloud\ArtifactRegistry\V1beta2\GetRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetRepository', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Repository', 'decode'], - $metadata, $options); - } - - /** - * Creates a repository. The returned Operation will finish once the - * repository has been created. Its response will be the created Repository. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\CreateRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateRepository(\Google\Cloud\ArtifactRegistry\V1beta2\CreateRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/CreateRepository', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates a repository. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\UpdateRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateRepository(\Google\Cloud\ArtifactRegistry\V1beta2\UpdateRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateRepository', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Repository', 'decode'], - $metadata, $options); - } - - /** - * Deletes a repository and all of its contents. The returned Operation will - * finish once the repository has been deleted. It will not have any Operation - * metadata and will return a google.protobuf.Empty response. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\DeleteRepositoryRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteRepository(\Google\Cloud\ArtifactRegistry\V1beta2\DeleteRepositoryRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteRepository', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists packages. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ListPackagesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListPackages(\Google\Cloud\ArtifactRegistry\V1beta2\ListPackagesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListPackages', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ListPackagesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a package. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetPackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetPackage(\Google\Cloud\ArtifactRegistry\V1beta2\GetPackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetPackage', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Package', 'decode'], - $metadata, $options); - } - - /** - * Deletes a package and all of its versions and tags. The returned operation - * will complete once the package has been deleted. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\DeletePackageRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeletePackage(\Google\Cloud\ArtifactRegistry\V1beta2\DeletePackageRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeletePackage', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists versions. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ListVersionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListVersions(\Google\Cloud\ArtifactRegistry\V1beta2\ListVersionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListVersions', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ListVersionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a version - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetVersionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetVersion(\Google\Cloud\ArtifactRegistry\V1beta2\GetVersionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetVersion', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Version', 'decode'], - $metadata, $options); - } - - /** - * Deletes a version and all of its content. The returned operation will - * complete once the version has been deleted. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\DeleteVersionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteVersion(\Google\Cloud\ArtifactRegistry\V1beta2\DeleteVersionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteVersion', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Lists files. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ListFilesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFiles(\Google\Cloud\ArtifactRegistry\V1beta2\ListFilesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListFiles', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ListFilesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a file. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetFileRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFile(\Google\Cloud\ArtifactRegistry\V1beta2\GetFileRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetFile', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\File', 'decode'], - $metadata, $options); - } - - /** - * Lists tags. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ListTagsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTags(\Google\Cloud\ArtifactRegistry\V1beta2\ListTagsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListTags', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ListTagsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a tag. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTag(\Google\Cloud\ArtifactRegistry\V1beta2\GetTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Tag', 'decode'], - $metadata, $options); - } - - /** - * Creates a tag. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\CreateTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTag(\Google\Cloud\ArtifactRegistry\V1beta2\CreateTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/CreateTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Tag', 'decode'], - $metadata, $options); - } - - /** - * Updates a tag. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\UpdateTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTag(\Google\Cloud\ArtifactRegistry\V1beta2\UpdateTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateTag', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\Tag', 'decode'], - $metadata, $options); - } - - /** - * Deletes a tag. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\DeleteTagRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTag(\Google\Cloud\ArtifactRegistry\V1beta2\DeleteTagRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteTag', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Updates the IAM policy for a given resource. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Gets the IAM policy for a given resource. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Tests if the caller has a list of permissions on a resource. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves the Settings for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\GetProjectSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetProjectSettings(\Google\Cloud\ArtifactRegistry\V1beta2\GetProjectSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetProjectSettings', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings', 'decode'], - $metadata, $options); - } - - /** - * Updates the Settings for the Project. - * @param \Google\Cloud\ArtifactRegistry\V1beta2\UpdateProjectSettingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateProjectSettings(\Google\Cloud\ArtifactRegistry\V1beta2\UpdateProjectSettingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateProjectSettings', - $argument, - ['\Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings', 'decode'], - $metadata, $options); - } - -} diff --git a/ArtifactRegistry/src/V1beta2/CreateRepositoryRequest.php b/ArtifactRegistry/src/V1beta2/CreateRepositoryRequest.php deleted file mode 100644 index e96787f60dee..000000000000 --- a/ArtifactRegistry/src/V1beta2/CreateRepositoryRequest.php +++ /dev/null @@ -1,145 +0,0 @@ -google.devtools.artifactregistry.v1beta2.CreateRepositoryRequest - */ -class CreateRepositoryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource where the repository will be created. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * The repository id to use for this repository. - * - * Generated from protobuf field string repository_id = 2; - */ - private $repository_id = ''; - /** - * The repository to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 3; - */ - private $repository = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource where the repository will be created. - * @type string $repository_id - * The repository id to use for this repository. - * @type \Google\Cloud\ArtifactRegistry\V1beta2\Repository $repository - * The repository to be created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource where the repository will be created. - * - * 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 name of the parent resource where the repository will be created. - * - * 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; - } - - /** - * The repository id to use for this repository. - * - * Generated from protobuf field string repository_id = 2; - * @return string - */ - public function getRepositoryId() - { - return $this->repository_id; - } - - /** - * The repository id to use for this repository. - * - * Generated from protobuf field string repository_id = 2; - * @param string $var - * @return $this - */ - public function setRepositoryId($var) - { - GPBUtil::checkString($var, True); - $this->repository_id = $var; - - return $this; - } - - /** - * The repository to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 3; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Repository|null - */ - public function getRepository() - { - return $this->repository; - } - - public function hasRepository() - { - return isset($this->repository); - } - - public function clearRepository() - { - unset($this->repository); - } - - /** - * The repository to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 3; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\Repository $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\Repository::class); - $this->repository = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/CreateTagRequest.php b/ArtifactRegistry/src/V1beta2/CreateTagRequest.php deleted file mode 100644 index 530103e2ba3a..000000000000 --- a/ArtifactRegistry/src/V1beta2/CreateTagRequest.php +++ /dev/null @@ -1,145 +0,0 @@ -google.devtools.artifactregistry.v1beta2.CreateTagRequest - */ -class CreateTagRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource where the tag will be created. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - /** - * The tag id to use for this repository. - * - * Generated from protobuf field string tag_id = 2; - */ - private $tag_id = ''; - /** - * The tag to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 3; - */ - private $tag = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The name of the parent resource where the tag will be created. - * @type string $tag_id - * The tag id to use for this repository. - * @type \Google\Cloud\ArtifactRegistry\V1beta2\Tag $tag - * The tag to be created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The name of the parent resource where the tag will be created. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource where the tag will be created. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The tag id to use for this repository. - * - * Generated from protobuf field string tag_id = 2; - * @return string - */ - public function getTagId() - { - return $this->tag_id; - } - - /** - * The tag id to use for this repository. - * - * Generated from protobuf field string tag_id = 2; - * @param string $var - * @return $this - */ - public function setTagId($var) - { - GPBUtil::checkString($var, True); - $this->tag_id = $var; - - return $this; - } - - /** - * The tag to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 3; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Tag|null - */ - public function getTag() - { - return $this->tag; - } - - public function hasTag() - { - return isset($this->tag); - } - - public function clearTag() - { - unset($this->tag); - } - - /** - * The tag to be created. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 3; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\Tag $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\Tag::class); - $this->tag = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/DeletePackageRequest.php b/ArtifactRegistry/src/V1beta2/DeletePackageRequest.php deleted file mode 100644 index 05cc5acafe72..000000000000 --- a/ArtifactRegistry/src/V1beta2/DeletePackageRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.DeletePackageRequest - */ -class DeletePackageRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the package to delete. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the package to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Package::initOnce(); - parent::__construct($data); - } - - /** - * The name of the package to delete. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the package to delete. - * - * 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; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/DeleteRepositoryRequest.php b/ArtifactRegistry/src/V1beta2/DeleteRepositoryRequest.php deleted file mode 100644 index cbe81a5e95d2..000000000000 --- a/ArtifactRegistry/src/V1beta2/DeleteRepositoryRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.DeleteRepositoryRequest - */ -class DeleteRepositoryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the repository to delete. - * - * 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 name of the repository to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the repository to delete. - * - * 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 name of the repository to delete. - * - * 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/ArtifactRegistry/src/V1beta2/DeleteTagRequest.php b/ArtifactRegistry/src/V1beta2/DeleteTagRequest.php deleted file mode 100644 index d07f92a00ac9..000000000000 --- a/ArtifactRegistry/src/V1beta2/DeleteTagRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.DeleteTagRequest - */ -class DeleteTagRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the tag to delete. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the tag to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The name of the tag to delete. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the tag to delete. - * - * 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; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/DeleteVersionRequest.php b/ArtifactRegistry/src/V1beta2/DeleteVersionRequest.php deleted file mode 100644 index 68ebb8aef235..000000000000 --- a/ArtifactRegistry/src/V1beta2/DeleteVersionRequest.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.DeleteVersionRequest - */ -class DeleteVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the version to delete. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * By default, a version that is tagged may not be deleted. If force=true, the - * version and any tags pointing to the version are deleted. - * - * Generated from protobuf field bool force = 2; - */ - private $force = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the version to delete. - * @type bool $force - * By default, a version that is tagged may not be deleted. If force=true, the - * version and any tags pointing to the version are deleted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Version::initOnce(); - parent::__construct($data); - } - - /** - * The name of the version to delete. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the version to delete. - * - * 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; - } - - /** - * By default, a version that is tagged may not be deleted. If force=true, the - * version and any tags pointing to the version are deleted. - * - * Generated from protobuf field bool force = 2; - * @return bool - */ - public function getForce() - { - return $this->force; - } - - /** - * By default, a version that is tagged may not be deleted. If force=true, the - * version and any tags pointing to the version are deleted. - * - * Generated from protobuf field bool force = 2; - * @param bool $var - * @return $this - */ - public function setForce($var) - { - GPBUtil::checkBool($var); - $this->force = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/File.php b/ArtifactRegistry/src/V1beta2/File.php deleted file mode 100644 index bb0abb82f784..000000000000 --- a/ArtifactRegistry/src/V1beta2/File.php +++ /dev/null @@ -1,265 +0,0 @@ -google.devtools.artifactregistry.v1beta2.File - */ -class File extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". - * If the file ID part contains slashes, they are escaped. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The size of the File in bytes. - * - * Generated from protobuf field int64 size_bytes = 3; - */ - private $size_bytes = 0; - /** - * The hashes of the file content. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Hash hashes = 4; - */ - private $hashes; - /** - * The time when the File was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - */ - private $create_time = null; - /** - * The time when the File was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - */ - private $update_time = null; - /** - * The name of the Package or Version that owns this file, if any. - * - * Generated from protobuf field string owner = 7; - */ - private $owner = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". - * If the file ID part contains slashes, they are escaped. - * @type int|string $size_bytes - * The size of the File in bytes. - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Hash>|\Google\Protobuf\Internal\RepeatedField $hashes - * The hashes of the file content. - * @type \Google\Protobuf\Timestamp $create_time - * The time when the File was created. - * @type \Google\Protobuf\Timestamp $update_time - * The time when the File was last updated. - * @type string $owner - * The name of the Package or Version that owns this file, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\File::initOnce(); - parent::__construct($data); - } - - /** - * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". - * If the file ID part contains slashes, they are escaped. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". - * If the file ID part contains slashes, they are escaped. - * - * 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 size of the File in bytes. - * - * Generated from protobuf field int64 size_bytes = 3; - * @return int|string - */ - public function getSizeBytes() - { - return $this->size_bytes; - } - - /** - * The size of the File in bytes. - * - * Generated from protobuf field int64 size_bytes = 3; - * @param int|string $var - * @return $this - */ - public function setSizeBytes($var) - { - GPBUtil::checkInt64($var); - $this->size_bytes = $var; - - return $this; - } - - /** - * The hashes of the file content. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Hash hashes = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getHashes() - { - return $this->hashes; - } - - /** - * The hashes of the file content. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Hash hashes = 4; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Hash>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setHashes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Hash::class); - $this->hashes = $arr; - - return $this; - } - - /** - * The time when the File was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @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); - } - - /** - * The time when the File was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time when the File was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @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); - } - - /** - * The time when the File was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * The name of the Package or Version that owns this file, if any. - * - * Generated from protobuf field string owner = 7; - * @return string - */ - public function getOwner() - { - return $this->owner; - } - - /** - * The name of the Package or Version that owns this file, if any. - * - * Generated from protobuf field string owner = 7; - * @param string $var - * @return $this - */ - public function setOwner($var) - { - GPBUtil::checkString($var, True); - $this->owner = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Gapic/ArtifactRegistryGapicClient.php b/ArtifactRegistry/src/V1beta2/Gapic/ArtifactRegistryGapicClient.php deleted file mode 100644 index 4f01891ec21d..000000000000 --- a/ArtifactRegistry/src/V1beta2/Gapic/ArtifactRegistryGapicClient.php +++ /dev/null @@ -1,2128 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $operationResponse = $artifactRegistryClient->createRepository($formattedParent); - * $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 = $artifactRegistryClient->createRepository($formattedParent); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'createRepository'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->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 ArtifactRegistryGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.devtools.artifactregistry.v1beta2.ArtifactRegistry'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'artifactregistry.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'artifactregistry.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', - 'https://www.googleapis.com/auth/cloud-platform.read-only', - ]; - - private static $locationNameTemplate; - - private static $projectSettingsNameTemplate; - - private static $repositoryNameTemplate; - - private static $tagNameTemplate; - - 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/artifact_registry_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/artifact_registry_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/artifact_registry_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/artifact_registry_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getProjectSettingsNameTemplate() - { - if (self::$projectSettingsNameTemplate == null) { - self::$projectSettingsNameTemplate = new PathTemplate('projects/{project}/projectSettings'); - } - - return self::$projectSettingsNameTemplate; - } - - private static function getRepositoryNameTemplate() - { - if (self::$repositoryNameTemplate == null) { - self::$repositoryNameTemplate = new PathTemplate('projects/{project}/locations/{location}/repositories/{repository}'); - } - - return self::$repositoryNameTemplate; - } - - private static function getTagNameTemplate() - { - if (self::$tagNameTemplate == null) { - self::$tagNameTemplate = new PathTemplate('projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}'); - } - - return self::$tagNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'projectSettings' => self::getProjectSettingsNameTemplate(), - 'repository' => self::getRepositoryNameTemplate(), - 'tag' => self::getTagNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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 - * project_settings resource. - * - * @param string $project - * - * @return string The formatted project_settings resource. - * - * @experimental - */ - public static function projectSettingsName($project) - { - return self::getProjectSettingsNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a repository - * resource. - * - * @param string $project - * @param string $location - * @param string $repository - * - * @return string The formatted repository resource. - * - * @experimental - */ - public static function repositoryName($project, $location, $repository) - { - return self::getRepositoryNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'repository' => $repository, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a tag - * resource. - * - * @param string $project - * @param string $location - * @param string $repository - * @param string $package - * @param string $tag - * - * @return string The formatted tag resource. - * - * @experimental - */ - public static function tagName($project, $location, $repository, $package, $tag) - { - return self::getTagNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'repository' => $repository, - 'package' => $package, - 'tag' => $tag, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: projects/{project}/locations/{location} - * - projectSettings: projects/{project}/projectSettings - * - repository: projects/{project}/locations/{location}/repositories/{repository} - * - tag: projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag} - * - * 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 'artifactregistry.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 repository. The returned Operation will finish once the - * repository has been created. Its response will be the created Repository. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $formattedParent = $artifactRegistryClient->locationName('[PROJECT]', '[LOCATION]'); - * $operationResponse = $artifactRegistryClient->createRepository($formattedParent); - * $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 = $artifactRegistryClient->createRepository($formattedParent); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'createRepository'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource where the repository will be created. - * @param array $optionalArgs { - * Optional. - * - * @type string $repositoryId - * The repository id to use for this repository. - * @type Repository $repository - * The repository to be created. - * @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 createRepository($parent, array $optionalArgs = []) - { - $request = new CreateRepositoryRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['repositoryId'])) { - $request->setRepositoryId($optionalArgs['repositoryId']); - } - - if (isset($optionalArgs['repository'])) { - $request->setRepository($optionalArgs['repository']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateRepository', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a tag. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->createTag(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The name of the parent resource where the tag will be created. - * @type string $tagId - * The tag id to use for this repository. - * @type Tag $tag - * The tag to be created. - * @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\ArtifactRegistry\V1beta2\Tag - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createTag(array $optionalArgs = []) - { - $request = new CreateTagRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['tagId'])) { - $request->setTagId($optionalArgs['tagId']); - } - - if (isset($optionalArgs['tag'])) { - $request->setTag($optionalArgs['tag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateTag', Tag::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a package and all of its versions and tags. The returned operation - * will complete once the package has been deleted. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $operationResponse = $artifactRegistryClient->deletePackage(); - * $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 = $artifactRegistryClient->deletePackage(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'deletePackage'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the package to delete. - * @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 deletePackage(array $optionalArgs = []) - { - $request = new DeletePackageRequest(); - $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->startOperationsCall('DeletePackage', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a repository and all of its contents. The returned Operation will - * finish once the repository has been deleted. It will not have any Operation - * metadata and will return a google.protobuf.Empty response. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $formattedName = $artifactRegistryClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $operationResponse = $artifactRegistryClient->deleteRepository($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 = $artifactRegistryClient->deleteRepository($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'deleteRepository'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the repository to delete. - * @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 deleteRepository($name, array $optionalArgs = []) - { - $request = new DeleteRepositoryRequest(); - $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->startOperationsCall('DeleteRepository', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a tag. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $artifactRegistryClient->deleteTag(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the tag to delete. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteTag(array $optionalArgs = []) - { - $request = new DeleteTagRequest(); - $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('DeleteTag', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a version and all of its content. The returned operation will - * complete once the version has been deleted. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $operationResponse = $artifactRegistryClient->deleteVersion(); - * $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 = $artifactRegistryClient->deleteVersion(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'deleteVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the version to delete. - * @type bool $force - * By default, a version that is tagged may not be deleted. If force=true, the - * version and any tags pointing to the version are deleted. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteVersion(array $optionalArgs = []) - { - $request = new DeleteVersionRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets a file. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->getFile(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the file to retrieve. - * @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\ArtifactRegistry\V1beta2\File - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getFile(array $optionalArgs = []) - { - $request = new GetFileRequest(); - $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('GetFile', File::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the IAM policy for a given resource. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $resource = 'resource'; - * $response = $artifactRegistryClient->getIamPolicy($resource); - * } finally { - * $artifactRegistryClient->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)->wait(); - } - - /** - * Gets a package. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->getPackage(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the package to retrieve. - * @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\ArtifactRegistry\V1beta2\Package - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getPackage(array $optionalArgs = []) - { - $request = new GetPackageRequest(); - $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('GetPackage', Package::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves the Settings for the Project. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $formattedName = $artifactRegistryClient->projectSettingsName('[PROJECT]'); - * $response = $artifactRegistryClient->getProjectSettings($formattedName); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the projectSettings 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\Cloud\ArtifactRegistry\V1beta2\ProjectSettings - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getProjectSettings($name, array $optionalArgs = []) - { - $request = new GetProjectSettingsRequest(); - $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('GetProjectSettings', ProjectSettings::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a repository. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $formattedName = $artifactRegistryClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - * $response = $artifactRegistryClient->getRepository($formattedName); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the repository to retrieve. - * @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\ArtifactRegistry\V1beta2\Repository - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getRepository($name, array $optionalArgs = []) - { - $request = new GetRepositoryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetRepository', Repository::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a tag. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->getTag(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the tag to retrieve. - * @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\ArtifactRegistry\V1beta2\Tag - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getTag(array $optionalArgs = []) - { - $request = new GetTagRequest(); - $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('GetTag', Tag::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a version - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->getVersion(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the version to retrieve. - * @type int $view - * The view that should be returned in the response. - * For allowed values, use constants defined on {@see \Google\Cloud\ArtifactRegistry\V1beta2\VersionView} - * @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\ArtifactRegistry\V1beta2\Version - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getVersion(array $optionalArgs = []) - { - $request = new GetVersionRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetVersion', Version::class, $optionalArgs, $request)->wait(); - } - - /** - * Imports Apt artifacts. The returned Operation will complete once the - * resources are imported. Package, Version, and File resources are created - * based on the imported artifacts. Imported artifacts that conflict with - * existing resources are ignored. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $operationResponse = $artifactRegistryClient->importAptArtifacts(); - * $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 = $artifactRegistryClient->importAptArtifacts(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'importAptArtifacts'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type ImportAptArtifactsGcsSource $gcsSource - * Google Cloud Storage location where input content is located. - * @type string $parent - * The name of the parent resource where the artifacts will be imported. - * @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 importAptArtifacts(array $optionalArgs = []) - { - $request = new ImportAptArtifactsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['gcsSource'])) { - $request->setGcsSource($optionalArgs['gcsSource']); - } - - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ImportAptArtifacts', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Imports Yum (RPM) artifacts. The returned Operation will complete once the - * resources are imported. Package, Version, and File resources are created - * based on the imported artifacts. Imported artifacts that conflict with - * existing resources are ignored. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $operationResponse = $artifactRegistryClient->importYumArtifacts(); - * $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 = $artifactRegistryClient->importYumArtifacts(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $artifactRegistryClient->resumeOperation($operationName, 'importYumArtifacts'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type ImportYumArtifactsGcsSource $gcsSource - * Google Cloud Storage location where input content is located. - * @type string $parent - * The name of the parent resource where the artifacts will be imported. - * @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 importYumArtifacts(array $optionalArgs = []) - { - $request = new ImportYumArtifactsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['gcsSource'])) { - $request->setGcsSource($optionalArgs['gcsSource']); - } - - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ImportYumArtifacts', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Lists files. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listFiles(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listFiles(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The name of the repository whose files will be listed. For example: - * "projects/p1/locations/us-central1/repositories/repo1 - * @type string $filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * - * * `name` - * * `owner` - * - * An example of using a filter: - * - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. - * @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 listFiles(array $optionalArgs = []) - { - $request = new ListFilesRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - 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('ListFiles', $optionalArgs, ListFilesResponse::class, $request); - } - - /** - * Lists packages. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listPackages(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listPackages(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The name of the parent resource whose packages will be listed. - * @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 listPackages(array $optionalArgs = []) - { - $request = new ListPackagesRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListPackages', $optionalArgs, ListPackagesResponse::class, $request); - } - - /** - * Lists repositories. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $formattedParent = $artifactRegistryClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listRepositories($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listRepositories($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the parent resource whose repositories will be listed. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listRepositories($parent, array $optionalArgs = []) - { - $request = new ListRepositoriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListRepositories', $optionalArgs, ListRepositoriesResponse::class, $request); - } - - /** - * Lists tags. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listTags(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listTags(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The name of the parent resource whose tags will be listed. - * @type string $filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * - * * `version` - * - * An example of using a filter: - * - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. - * @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 listTags(array $optionalArgs = []) - { - $request = new ListTagsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - 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('ListTags', $optionalArgs, ListTagsResponse::class, $request); - } - - /** - * Lists versions. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listVersions(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listVersions(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The name of the parent resource whose versions will be listed. - * @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 int $view - * The view that should be returned in the response. - * For allowed values, use constants defined on {@see \Google\Cloud\ArtifactRegistry\V1beta2\VersionView} - * @type string $orderBy - * Optional. The field to order the results by. - * @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 listVersions(array $optionalArgs = []) - { - $request = new ListVersionsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - 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('ListVersions', $optionalArgs, ListVersionsResponse::class, $request); - } - - /** - * Updates the IAM policy for a given resource. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $artifactRegistryClient->setIamPolicy($resource, $policy); - * } finally { - * $artifactRegistryClient->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)->wait(); - } - - /** - * Tests if the caller has a list of permissions on a resource. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $artifactRegistryClient->testIamPermissions($resource, $permissions); - * } finally { - * $artifactRegistryClient->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)->wait(); - } - - /** - * Updates the Settings for the Project. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->updateProjectSettings(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type ProjectSettings $projectSettings - * The project settings. - * @type FieldMask $updateMask - * Field mask to support partial updates. - * @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\ArtifactRegistry\V1beta2\ProjectSettings - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateProjectSettings(array $optionalArgs = []) - { - $request = new UpdateProjectSettingsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectSettings'])) { - $request->setProjectSettings($optionalArgs['projectSettings']); - } - - 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('UpdateProjectSettings', ProjectSettings::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a repository. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->updateRepository(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type Repository $repository - * The repository that replaces the resource on the server. - * @type FieldMask $updateMask - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * @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\ArtifactRegistry\V1beta2\Repository - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateRepository(array $optionalArgs = []) - { - $request = new UpdateRepositoryRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['repository'])) { - $request->setRepository($optionalArgs['repository']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateRepository', Repository::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a tag. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->updateTag(); - * } finally { - * $artifactRegistryClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type Tag $tag - * The tag that replaces the resource on the server. - * @type FieldMask $updateMask - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * @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\ArtifactRegistry\V1beta2\Tag - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateTag(array $optionalArgs = []) - { - $request = new UpdateTagRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['tag'])) { - $request->setTag($optionalArgs['tag']); - } - - 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('UpdateTag', Tag::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * $response = $artifactRegistryClient->getLocation(); - * } finally { - * $artifactRegistryClient->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: - * ``` - * $artifactRegistryClient = new ArtifactRegistryClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $artifactRegistryClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $artifactRegistryClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $artifactRegistryClient->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'); - } -} diff --git a/ArtifactRegistry/src/V1beta2/GetFileRequest.php b/ArtifactRegistry/src/V1beta2/GetFileRequest.php deleted file mode 100644 index 5fcadade74ea..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetFileRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetFileRequest - */ -class GetFileRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the file to retrieve. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the file to retrieve. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\File::initOnce(); - parent::__construct($data); - } - - /** - * The name of the file to retrieve. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the file to retrieve. - * - * 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; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/GetPackageRequest.php b/ArtifactRegistry/src/V1beta2/GetPackageRequest.php deleted file mode 100644 index 059c98de95bd..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetPackageRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetPackageRequest - */ -class GetPackageRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the package to retrieve. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the package to retrieve. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Package::initOnce(); - parent::__construct($data); - } - - /** - * The name of the package to retrieve. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the package to retrieve. - * - * 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; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/GetProjectSettingsRequest.php b/ArtifactRegistry/src/V1beta2/GetProjectSettingsRequest.php deleted file mode 100644 index 5e8116ace16a..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetProjectSettingsRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetProjectSettingsRequest - */ -class GetProjectSettingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the projectSettings resource. - * - * 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 name of the projectSettings resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Settings::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the projectSettings resource. - * - * 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 name of the projectSettings resource. - * - * 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/ArtifactRegistry/src/V1beta2/GetRepositoryRequest.php b/ArtifactRegistry/src/V1beta2/GetRepositoryRequest.php deleted file mode 100644 index c887770f2b21..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetRepositoryRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetRepositoryRequest - */ -class GetRepositoryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the repository to retrieve. - * - * 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 name of the repository to retrieve. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the repository to retrieve. - * - * 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 name of the repository to retrieve. - * - * 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/ArtifactRegistry/src/V1beta2/GetTagRequest.php b/ArtifactRegistry/src/V1beta2/GetTagRequest.php deleted file mode 100644 index e9c9dd17a090..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetTagRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetTagRequest - */ -class GetTagRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the tag to retrieve. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the tag to retrieve. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The name of the tag to retrieve. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the tag to retrieve. - * - * 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; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/GetVersionRequest.php b/ArtifactRegistry/src/V1beta2/GetVersionRequest.php deleted file mode 100644 index bb912979f041..000000000000 --- a/ArtifactRegistry/src/V1beta2/GetVersionRequest.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.GetVersionRequest - */ -class GetVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the version to retrieve. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 2; - */ - private $view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the version to retrieve. - * @type int $view - * The view that should be returned in the response. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Version::initOnce(); - parent::__construct($data); - } - - /** - * The name of the version to retrieve. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the version to retrieve. - * - * 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 view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 2; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 2; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\VersionView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Hash.php b/ArtifactRegistry/src/V1beta2/Hash.php deleted file mode 100644 index 666877fbae30..000000000000 --- a/ArtifactRegistry/src/V1beta2/Hash.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Hash - */ -class Hash extends \Google\Protobuf\Internal\Message -{ - /** - * The algorithm used to compute the hash value. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Hash.HashType type = 1; - */ - private $type = 0; - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - */ - private $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $type - * The algorithm used to compute the hash value. - * @type string $value - * The hash value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\File::initOnce(); - parent::__construct($data); - } - - /** - * The algorithm used to compute the hash value. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Hash.HashType type = 1; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The algorithm used to compute the hash value. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Hash.HashType type = 1; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\Hash\HashType::class); - $this->type = $var; - - return $this; - } - - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, False); - $this->value = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Hash/HashType.php b/ArtifactRegistry/src/V1beta2/Hash/HashType.php deleted file mode 100644 index bf8d013dc3d2..000000000000 --- a/ArtifactRegistry/src/V1beta2/Hash/HashType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Hash.HashType - */ -class HashType -{ - /** - * Unspecified. - * - * Generated from protobuf enum HASH_TYPE_UNSPECIFIED = 0; - */ - const HASH_TYPE_UNSPECIFIED = 0; - /** - * SHA256 hash. - * - * Generated from protobuf enum SHA256 = 1; - */ - const SHA256 = 1; - /** - * MD5 hash. - * - * Generated from protobuf enum MD5 = 2; - */ - const MD5 = 2; - - private static $valueToName = [ - self::HASH_TYPE_UNSPECIFIED => 'HASH_TYPE_UNSPECIFIED', - self::SHA256 => 'SHA256', - self::MD5 => 'MD5', - ]; - - 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(HashType::class, \Google\Cloud\ArtifactRegistry\V1beta2\Hash_HashType::class); - diff --git a/ArtifactRegistry/src/V1beta2/Hash_HashType.php b/ArtifactRegistry/src/V1beta2/Hash_HashType.php deleted file mode 100644 index b88cd4be1d96..000000000000 --- a/ArtifactRegistry/src/V1beta2/Hash_HashType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo - */ -class ImportAptArtifactsErrorInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - */ - private $error = null; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource $gcs_source - * Google Cloud Storage location requested. - * @type \Google\Rpc\Status $error - * The detailed error status. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage location requested. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource gcs_source = 1; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource|null - */ - public function getGcsSource() - { - return $this->readOneof(1); - } - - public function hasGcsSource() - { - return $this->hasOneof(1); - } - - /** - * Google Cloud Storage location requested. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource gcs_source = 1; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->error = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsGcsSource.php b/ArtifactRegistry/src/V1beta2/ImportAptArtifactsGcsSource.php deleted file mode 100644 index 04ecc8177ccc..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsGcsSource.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource - */ -class ImportAptArtifactsGcsSource extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - */ - private $uris; - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - */ - private $use_wildcards = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $uris - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * @type bool $use_wildcards - * Supports URI wildcards for matching multiple objects from a single URI. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUris() - { - return $this->uris; - } - - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUris($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->uris = $arr; - - return $this; - } - - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - * @return bool - */ - public function getUseWildcards() - { - return $this->use_wildcards; - } - - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - * @param bool $var - * @return $this - */ - public function setUseWildcards($var) - { - GPBUtil::checkBool($var); - $this->use_wildcards = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsMetadata.php b/ArtifactRegistry/src/V1beta2/ImportAptArtifactsMetadata.php deleted file mode 100644 index 82ea2506cca4..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportAptArtifactsMetadata - */ -class ImportAptArtifactsMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsRequest.php b/ArtifactRegistry/src/V1beta2/ImportAptArtifactsRequest.php deleted file mode 100644 index 609c7e632718..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportAptArtifactsRequest - */ -class ImportAptArtifactsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource $gcs_source - * Google Cloud Storage location where input content is located. - * @type string $parent - * The name of the parent resource where the artifacts will be imported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage location where input content is located. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource gcs_source = 2; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource|null - */ - public function getGcsSource() - { - return $this->readOneof(2); - } - - public function hasGcsSource() - { - return $this->hasOneof(2); - } - - /** - * Google Cloud Storage location where input content is located. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource gcs_source = 2; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsResponse.php b/ArtifactRegistry/src/V1beta2/ImportAptArtifactsResponse.php deleted file mode 100644 index 9fc27ce1bca5..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportAptArtifactsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportAptArtifactsResponse - */ -class ImportAptArtifactsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The Apt artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.AptArtifact apt_artifacts = 1; - */ - private $apt_artifacts; - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo errors = 2; - */ - private $errors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\AptArtifact>|\Google\Protobuf\Internal\RepeatedField $apt_artifacts - * The Apt artifacts imported. - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsErrorInfo>|\Google\Protobuf\Internal\RepeatedField $errors - * Detailed error info for artifacts that were not imported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce(); - parent::__construct($data); - } - - /** - * The Apt artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.AptArtifact apt_artifacts = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAptArtifacts() - { - return $this->apt_artifacts; - } - - /** - * The Apt artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.AptArtifact apt_artifacts = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\AptArtifact>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAptArtifacts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\AptArtifact::class); - $this->apt_artifacts = $arr; - - return $this; - } - - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo errors = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo errors = 2; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsErrorInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsErrorInfo::class); - $this->errors = $arr; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsErrorInfo.php b/ArtifactRegistry/src/V1beta2/ImportYumArtifactsErrorInfo.php deleted file mode 100644 index b8b08575396d..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsErrorInfo.php +++ /dev/null @@ -1,119 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo - */ -class ImportYumArtifactsErrorInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - */ - private $error = null; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource $gcs_source - * Google Cloud Storage location requested. - * @type \Google\Rpc\Status $error - * The detailed error status. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage location requested. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource gcs_source = 1; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource|null - */ - public function getGcsSource() - { - return $this->readOneof(1); - } - - public function hasGcsSource() - { - return $this->hasOneof(1); - } - - /** - * Google Cloud Storage location requested. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource gcs_source = 1; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * The detailed error status. - * - * Generated from protobuf field .google.rpc.Status error = 2; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->error = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsGcsSource.php b/ArtifactRegistry/src/V1beta2/ImportYumArtifactsGcsSource.php deleted file mode 100644 index 7cda21a8fad9..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsGcsSource.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource - */ -class ImportYumArtifactsGcsSource extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - */ - private $uris; - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - */ - private $use_wildcards = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $uris - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * @type bool $use_wildcards - * Supports URI wildcards for matching multiple objects from a single URI. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUris() - { - return $this->uris; - } - - /** - * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - * - * Generated from protobuf field repeated string uris = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUris($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->uris = $arr; - - return $this; - } - - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - * @return bool - */ - public function getUseWildcards() - { - return $this->use_wildcards; - } - - /** - * Supports URI wildcards for matching multiple objects from a single URI. - * - * Generated from protobuf field bool use_wildcards = 2; - * @param bool $var - * @return $this - */ - public function setUseWildcards($var) - { - GPBUtil::checkBool($var); - $this->use_wildcards = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsMetadata.php b/ArtifactRegistry/src/V1beta2/ImportYumArtifactsMetadata.php deleted file mode 100644 index 9ad88cd05b9f..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportYumArtifactsMetadata - */ -class ImportYumArtifactsMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsRequest.php b/ArtifactRegistry/src/V1beta2/ImportYumArtifactsRequest.php deleted file mode 100644 index 9fb722be4c58..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsRequest.php +++ /dev/null @@ -1,109 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportYumArtifactsRequest - */ -class ImportYumArtifactsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource $gcs_source - * Google Cloud Storage location where input content is located. - * @type string $parent - * The name of the parent resource where the artifacts will be imported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage location where input content is located. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource gcs_source = 2; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource|null - */ - public function getGcsSource() - { - return $this->readOneof(2); - } - - public function hasGcsSource() - { - return $this->hasOneof(2); - } - - /** - * Google Cloud Storage location where input content is located. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsGcsSource gcs_source = 2; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsGcsSource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource where the artifacts will be imported. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsResponse.php b/ArtifactRegistry/src/V1beta2/ImportYumArtifactsResponse.php deleted file mode 100644 index e0ba4b63b2c8..000000000000 --- a/ArtifactRegistry/src/V1beta2/ImportYumArtifactsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ImportYumArtifactsResponse - */ -class ImportYumArtifactsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The yum artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.YumArtifact yum_artifacts = 1; - */ - private $yum_artifacts; - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo errors = 2; - */ - private $errors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\YumArtifact>|\Google\Protobuf\Internal\RepeatedField $yum_artifacts - * The yum artifacts imported. - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsErrorInfo>|\Google\Protobuf\Internal\RepeatedField $errors - * Detailed error info for artifacts that were not imported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - - /** - * The yum artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.YumArtifact yum_artifacts = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getYumArtifacts() - { - return $this->yum_artifacts; - } - - /** - * The yum artifacts imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.YumArtifact yum_artifacts = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\YumArtifact>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setYumArtifacts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\YumArtifact::class); - $this->yum_artifacts = $arr; - - return $this; - } - - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo errors = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Detailed error info for artifacts that were not imported. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.ImportYumArtifactsErrorInfo errors = 2; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsErrorInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsErrorInfo::class); - $this->errors = $arr; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListFilesRequest.php b/ArtifactRegistry/src/V1beta2/ListFilesRequest.php deleted file mode 100644 index 6c97dc8d1696..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListFilesRequest.php +++ /dev/null @@ -1,205 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListFilesRequest - */ -class ListFilesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the repository whose files will be listed. For example: - * "projects/p1/locations/us-central1/repositories/repo1 - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `name` - * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - */ - private $filter = ''; - /** - * The maximum number of files to return. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The name of the repository whose files will be listed. For example: - * "projects/p1/locations/us-central1/repositories/repo1 - * @type string $filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `name` - * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. - * @type int $page_size - * The maximum number of files to return. - * @type string $page_token - * The next_page_token value returned from a previous list request, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\File::initOnce(); - parent::__construct($data); - } - - /** - * The name of the repository whose files will be listed. For example: - * "projects/p1/locations/us-central1/repositories/repo1 - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the repository whose files will be listed. For example: - * "projects/p1/locations/us-central1/repositories/repo1 - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `name` - * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `name` - * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The maximum number of files to return. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of files to return. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListFilesResponse.php b/ArtifactRegistry/src/V1beta2/ListFilesResponse.php deleted file mode 100644 index b2acdbeb5e83..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListFilesResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListFilesResponse - */ -class ListFilesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The files returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.File files = 1; - */ - private $files; - /** - * The token to retrieve the next page of files, or empty if there are no - * more files to return. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\File>|\Google\Protobuf\Internal\RepeatedField $files - * The files returned. - * @type string $next_page_token - * The token to retrieve the next page of files, or empty if there are no - * more files to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\File::initOnce(); - parent::__construct($data); - } - - /** - * The files returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.File files = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFiles() - { - return $this->files; - } - - /** - * The files returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.File files = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\File>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFiles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\File::class); - $this->files = $arr; - - return $this; - } - - /** - * The token to retrieve the next page of files, or empty if there are no - * more files to return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to retrieve the next page of files, or empty if there are no - * more files to return. - * - * 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; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListPackagesRequest.php b/ArtifactRegistry/src/V1beta2/ListPackagesRequest.php deleted file mode 100644 index 3a8f63870fd4..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListPackagesRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListPackagesRequest - */ -class ListPackagesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource whose packages will be listed. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - /** - * The maximum number of packages to return. - * Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The name of the parent resource whose packages will be listed. - * @type int $page_size - * The maximum number of packages to return. - * Maximum page size is 10,000. - * @type string $page_token - * The next_page_token value returned from a previous list request, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Package::initOnce(); - parent::__construct($data); - } - - /** - * The name of the parent resource whose packages will be listed. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource whose packages will be listed. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of packages to return. - * Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of packages to return. - * Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListPackagesResponse.php b/ArtifactRegistry/src/V1beta2/ListPackagesResponse.php deleted file mode 100644 index 9d404fa391a1..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListPackagesResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListPackagesResponse - */ -class ListPackagesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The packages returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Package packages = 1; - */ - private $packages; - /** - * The token to retrieve the next page of packages, or empty if there are no - * more packages to return. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Package>|\Google\Protobuf\Internal\RepeatedField $packages - * The packages returned. - * @type string $next_page_token - * The token to retrieve the next page of packages, or empty if there are no - * more packages to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Package::initOnce(); - parent::__construct($data); - } - - /** - * The packages returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Package packages = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPackages() - { - return $this->packages; - } - - /** - * The packages returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Package packages = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Package>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPackages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Package::class); - $this->packages = $arr; - - return $this; - } - - /** - * The token to retrieve the next page of packages, or empty if there are no - * more packages to return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to retrieve the next page of packages, or empty if there are no - * more packages to return. - * - * 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; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListRepositoriesRequest.php b/ArtifactRegistry/src/V1beta2/ListRepositoriesRequest.php deleted file mode 100644 index ee38a3e8ab87..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListRepositoriesRequest.php +++ /dev/null @@ -1,135 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListRepositoriesRequest - */ -class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the parent resource whose repositories will be listed. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * The maximum number of repositories to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the parent resource whose repositories will be listed. - * @type int $page_size - * The maximum number of repositories to return. Maximum page size is 1,000. - * @type string $page_token - * The next_page_token value returned from a previous list request, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the parent resource whose repositories will be listed. - * - * 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 name of the parent resource whose repositories will be listed. - * - * 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; - } - - /** - * The maximum number of repositories to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of repositories to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListRepositoriesResponse.php b/ArtifactRegistry/src/V1beta2/ListRepositoriesResponse.php deleted file mode 100644 index 337a371c23a7..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListRepositoriesResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListRepositoriesResponse - */ -class ListRepositoriesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The repositories returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Repository repositories = 1; - */ - private $repositories; - /** - * The token to retrieve the next page of repositories, or empty if there are - * no more repositories to return. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Repository>|\Google\Protobuf\Internal\RepeatedField $repositories - * The repositories returned. - * @type string $next_page_token - * The token to retrieve the next page of repositories, or empty if there are - * no more repositories to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * The repositories returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Repository repositories = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRepositories() - { - return $this->repositories; - } - - /** - * The repositories returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Repository repositories = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Repository>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRepositories($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Repository::class); - $this->repositories = $arr; - - return $this; - } - - /** - * The token to retrieve the next page of repositories, or empty if there are - * no more repositories to return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to retrieve the next page of repositories, or empty if there are - * no more repositories to return. - * - * 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; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListTagsRequest.php b/ArtifactRegistry/src/V1beta2/ListTagsRequest.php deleted file mode 100644 index 1212c472ed43..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListTagsRequest.php +++ /dev/null @@ -1,189 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListTagsRequest - */ -class ListTagsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource whose tags will be listed. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - */ - private $filter = ''; - /** - * The maximum number of tags to return. Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The name of the parent resource whose tags will be listed. - * @type string $filter - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. - * @type int $page_size - * The maximum number of tags to return. Maximum page size is 10,000. - * @type string $page_token - * The next_page_token value returned from a previous list request, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The name of the parent resource whose tags will be listed. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource whose tags will be listed. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * An expression for filtering the results of the request. Filter rules are - * case insensitive. The fields eligible for filtering are: - * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The maximum number of tags to return. Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of tags to return. Maximum page size is 10,000. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListTagsResponse.php b/ArtifactRegistry/src/V1beta2/ListTagsResponse.php deleted file mode 100644 index 12887c6976c8..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListTagsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListTagsResponse - */ -class ListTagsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The tags returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag tags = 1; - */ - private $tags; - /** - * The token to retrieve the next page of tags, or empty if there are no - * more tags to return. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Tag>|\Google\Protobuf\Internal\RepeatedField $tags - * The tags returned. - * @type string $next_page_token - * The token to retrieve the next page of tags, or empty if there are no - * more tags to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The tags returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag tags = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTags() - { - return $this->tags; - } - - /** - * The tags returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag tags = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Tag>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Tag::class); - $this->tags = $arr; - - return $this; - } - - /** - * The token to retrieve the next page of tags, or empty if there are no - * more tags to return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to retrieve the next page of tags, or empty if there are no - * more tags to return. - * - * 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; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ListVersionsRequest.php b/ArtifactRegistry/src/V1beta2/ListVersionsRequest.php deleted file mode 100644 index 90b25b764721..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListVersionsRequest.php +++ /dev/null @@ -1,203 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListVersionsRequest - */ -class ListVersionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the parent resource whose versions will be listed. - * - * Generated from protobuf field string parent = 1; - */ - private $parent = ''; - /** - * The maximum number of versions to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - /** - * The view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 4; - */ - private $view = 0; - /** - * Optional. The field to order the results by. - * - * 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 - * The name of the parent resource whose versions will be listed. - * @type int $page_size - * The maximum number of versions to return. Maximum page size is 1,000. - * @type string $page_token - * The next_page_token value returned from a previous list request, if any. - * @type int $view - * The view that should be returned in the response. - * @type string $order_by - * Optional. The field to order the results by. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Version::initOnce(); - parent::__construct($data); - } - - /** - * The name of the parent resource whose versions will be listed. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The name of the parent resource whose versions will be listed. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of versions to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of versions to return. Maximum page size is 1,000. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The next_page_token value returned from a previous list request, if any. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 4; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The view that should be returned in the response. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.VersionView view = 4; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\VersionView::class); - $this->view = $var; - - return $this; - } - - /** - * Optional. The field to order the results by. - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. The field to order the results by. - * - * 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/ArtifactRegistry/src/V1beta2/ListVersionsResponse.php b/ArtifactRegistry/src/V1beta2/ListVersionsResponse.php deleted file mode 100644 index 60eb07d871a8..000000000000 --- a/ArtifactRegistry/src/V1beta2/ListVersionsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ListVersionsResponse - */ -class ListVersionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The versions returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Version versions = 1; - */ - private $versions; - /** - * The token to retrieve the next page of versions, or empty if there are no - * more versions to return. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Version>|\Google\Protobuf\Internal\RepeatedField $versions - * The versions returned. - * @type string $next_page_token - * The token to retrieve the next page of versions, or empty if there are no - * more versions to return. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Version::initOnce(); - parent::__construct($data); - } - - /** - * The versions returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Version versions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVersions() - { - return $this->versions; - } - - /** - * The versions returned. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Version versions = 1; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Version>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Version::class); - $this->versions = $arr; - - return $this; - } - - /** - * The token to retrieve the next page of versions, or empty if there are no - * more versions to return. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to retrieve the next page of versions, or empty if there are no - * more versions to return. - * - * 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; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/OperationMetadata.php b/ArtifactRegistry/src/V1beta2/OperationMetadata.php deleted file mode 100644 index 4ddb09fc46da..000000000000 --- a/ArtifactRegistry/src/V1beta2/OperationMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.devtools.artifactregistry.v1beta2.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Service::initOnce(); - parent::__construct($data); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Package.php b/ArtifactRegistry/src/V1beta2/Package.php deleted file mode 100644 index 78b70d30c9f5..000000000000 --- a/ArtifactRegistry/src/V1beta2/Package.php +++ /dev/null @@ -1,197 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Package - */ -class Package extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the package, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1". - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The display name of the package. - * - * Generated from protobuf field string display_name = 2; - */ - private $display_name = ''; - /** - * The time when the package was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - */ - private $create_time = null; - /** - * The time when the package was last updated. This includes publishing a new - * version of the package. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - */ - private $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the package, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1". - * @type string $display_name - * The display name of the package. - * @type \Google\Protobuf\Timestamp $create_time - * The time when the package was created. - * @type \Google\Protobuf\Timestamp $update_time - * The time when the package was last updated. This includes publishing a new - * version of the package. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Package::initOnce(); - parent::__construct($data); - } - - /** - * The name of the package, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1". - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the package, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1". - * - * 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 display name of the package. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The display name of the package. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The time when the package was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @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); - } - - /** - * The time when the package was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time when the package was last updated. This includes publishing a new - * version of the package. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @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); - } - - /** - * The time when the package was last updated. This includes publishing a new - * version of the package. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ProjectSettings.php b/ArtifactRegistry/src/V1beta2/ProjectSettings.php deleted file mode 100644 index 35382b3d31b5..000000000000 --- a/ArtifactRegistry/src/V1beta2/ProjectSettings.php +++ /dev/null @@ -1,117 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ProjectSettings - */ -class ProjectSettings extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the project's settings. - * Always of the form: - * projects/{project-id}/projectSettings - * In update request: never set - * In response: always set - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The redirection state of the legacy repositories in this project. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState legacy_redirection_state = 2; - */ - private $legacy_redirection_state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the project's settings. - * Always of the form: - * projects/{project-id}/projectSettings - * In update request: never set - * In response: always set - * @type int $legacy_redirection_state - * The redirection state of the legacy repositories in this project. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Settings::initOnce(); - parent::__construct($data); - } - - /** - * The name of the project's settings. - * Always of the form: - * projects/{project-id}/projectSettings - * In update request: never set - * In response: always set - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the project's settings. - * Always of the form: - * projects/{project-id}/projectSettings - * In update request: never set - * In response: always set - * - * 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 redirection state of the legacy repositories in this project. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState legacy_redirection_state = 2; - * @return int - */ - public function getLegacyRedirectionState() - { - return $this->legacy_redirection_state; - } - - /** - * The redirection state of the legacy repositories in this project. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState legacy_redirection_state = 2; - * @param int $var - * @return $this - */ - public function setLegacyRedirectionState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings\RedirectionState::class); - $this->legacy_redirection_state = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/ProjectSettings/RedirectionState.php b/ArtifactRegistry/src/V1beta2/ProjectSettings/RedirectionState.php deleted file mode 100644 index 63c66fb968b9..000000000000 --- a/ArtifactRegistry/src/V1beta2/ProjectSettings/RedirectionState.php +++ /dev/null @@ -1,71 +0,0 @@ -google.devtools.artifactregistry.v1beta2.ProjectSettings.RedirectionState - */ -class RedirectionState -{ - /** - * No redirection status has been set. - * - * Generated from protobuf enum REDIRECTION_STATE_UNSPECIFIED = 0; - */ - const REDIRECTION_STATE_UNSPECIFIED = 0; - /** - * Redirection is disabled. - * - * Generated from protobuf enum REDIRECTION_FROM_GCR_IO_DISABLED = 1; - */ - const REDIRECTION_FROM_GCR_IO_DISABLED = 1; - /** - * Redirection is enabled. - * - * Generated from protobuf enum REDIRECTION_FROM_GCR_IO_ENABLED = 2; - */ - const REDIRECTION_FROM_GCR_IO_ENABLED = 2; - /** - * Redirection is enabled, and has been finalized so cannot be reverted. - * - * Generated from protobuf enum REDIRECTION_FROM_GCR_IO_FINALIZED = 3; - */ - const REDIRECTION_FROM_GCR_IO_FINALIZED = 3; - - private static $valueToName = [ - self::REDIRECTION_STATE_UNSPECIFIED => 'REDIRECTION_STATE_UNSPECIFIED', - self::REDIRECTION_FROM_GCR_IO_DISABLED => 'REDIRECTION_FROM_GCR_IO_DISABLED', - self::REDIRECTION_FROM_GCR_IO_ENABLED => 'REDIRECTION_FROM_GCR_IO_ENABLED', - self::REDIRECTION_FROM_GCR_IO_FINALIZED => 'REDIRECTION_FROM_GCR_IO_FINALIZED', - ]; - - 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(RedirectionState::class, \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings_RedirectionState::class); - diff --git a/ArtifactRegistry/src/V1beta2/ProjectSettings_RedirectionState.php b/ArtifactRegistry/src/V1beta2/ProjectSettings_RedirectionState.php deleted file mode 100644 index 0ed24bea5283..000000000000 --- a/ArtifactRegistry/src/V1beta2/ProjectSettings_RedirectionState.php +++ /dev/null @@ -1,16 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Repository - */ -class Repository extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the repository, for example: - * "projects/p1/locations/us-central1/repositories/repo1". - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The format of packages that are stored in the repository. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.Format format = 2; - */ - private $format = 0; - /** - * The user-provided description of the repository. - * - * Generated from protobuf field string description = 3; - */ - private $description = ''; - /** - * Labels with user-defined metadata. - * This field may contain up to 64 entries. Label keys and values may be no - * longer than 63 characters. Label keys must begin with a lowercase letter - * and may only contain lowercase letters, numeric characters, underscores, - * and dashes. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * The time when the repository was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - */ - private $create_time = null; - /** - * The time when the repository was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - */ - private $update_time = null; - /** - * The Cloud KMS resource name of the customer managed encryption key that’s - * used to encrypt the contents of the Repository. Has the form: - * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. - * This value may not be changed after the Repository has been created. - * - * Generated from protobuf field string kms_key_name = 8; - */ - private $kms_key_name = ''; - protected $format_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\Repository\MavenRepositoryConfig $maven_config - * Maven repository config contains repository level configuration - * for the repositories of maven type. - * @type string $name - * The name of the repository, for example: - * "projects/p1/locations/us-central1/repositories/repo1". - * @type int $format - * The format of packages that are stored in the repository. - * @type string $description - * The user-provided description of the repository. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels with user-defined metadata. - * This field may contain up to 64 entries. Label keys and values may be no - * longer than 63 characters. Label keys must begin with a lowercase letter - * and may only contain lowercase letters, numeric characters, underscores, - * and dashes. - * @type \Google\Protobuf\Timestamp $create_time - * The time when the repository was created. - * @type \Google\Protobuf\Timestamp $update_time - * The time when the repository was last updated. - * @type string $kms_key_name - * The Cloud KMS resource name of the customer managed encryption key that’s - * used to encrypt the contents of the Repository. Has the form: - * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. - * This value may not be changed after the Repository has been created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * Maven repository config contains repository level configuration - * for the repositories of maven type. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig maven_config = 9; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Repository\MavenRepositoryConfig|null - */ - public function getMavenConfig() - { - return $this->readOneof(9); - } - - public function hasMavenConfig() - { - return $this->hasOneof(9); - } - - /** - * Maven repository config contains repository level configuration - * for the repositories of maven type. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig maven_config = 9; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\Repository\MavenRepositoryConfig $var - * @return $this - */ - public function setMavenConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\Repository\MavenRepositoryConfig::class); - $this->writeOneof(9, $var); - - return $this; - } - - /** - * The name of the repository, for example: - * "projects/p1/locations/us-central1/repositories/repo1". - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the repository, for example: - * "projects/p1/locations/us-central1/repositories/repo1". - * - * 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 format of packages that are stored in the repository. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.Format format = 2; - * @return int - */ - public function getFormat() - { - return $this->format; - } - - /** - * The format of packages that are stored in the repository. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.Format format = 2; - * @param int $var - * @return $this - */ - public function setFormat($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\Repository\Format::class); - $this->format = $var; - - return $this; - } - - /** - * The user-provided description of the repository. - * - * Generated from protobuf field string description = 3; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The user-provided description of the repository. - * - * Generated from protobuf field string description = 3; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Labels with user-defined metadata. - * This field may contain up to 64 entries. Label keys and values may be no - * longer than 63 characters. Label keys must begin with a lowercase letter - * and may only contain lowercase letters, numeric characters, underscores, - * and dashes. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels with user-defined metadata. - * This field may contain up to 64 entries. Label keys and values may be no - * longer than 63 characters. Label keys must begin with a lowercase letter - * and may only contain lowercase letters, numeric characters, underscores, - * and dashes. - * - * 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; - } - - /** - * The time when the repository was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @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); - } - - /** - * The time when the repository was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time when the repository was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @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); - } - - /** - * The time when the repository was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * The Cloud KMS resource name of the customer managed encryption key that’s - * used to encrypt the contents of the Repository. Has the form: - * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. - * This value may not be changed after the Repository has been created. - * - * Generated from protobuf field string kms_key_name = 8; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * The Cloud KMS resource name of the customer managed encryption key that’s - * used to encrypt the contents of the Repository. Has the form: - * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. - * This value may not be changed after the Repository has been created. - * - * Generated from protobuf field string kms_key_name = 8; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - - /** - * @return string - */ - public function getFormatConfig() - { - return $this->whichOneof("format_config"); - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Repository/Format.php b/ArtifactRegistry/src/V1beta2/Repository/Format.php deleted file mode 100644 index f0e7144895af..000000000000 --- a/ArtifactRegistry/src/V1beta2/Repository/Format.php +++ /dev/null @@ -1,92 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Repository.Format - */ -class Format -{ - /** - * Unspecified package format. - * - * Generated from protobuf enum FORMAT_UNSPECIFIED = 0; - */ - const FORMAT_UNSPECIFIED = 0; - /** - * Docker package format. - * - * Generated from protobuf enum DOCKER = 1; - */ - const DOCKER = 1; - /** - * Maven package format. - * - * Generated from protobuf enum MAVEN = 2; - */ - const MAVEN = 2; - /** - * NPM package format. - * - * Generated from protobuf enum NPM = 3; - */ - const NPM = 3; - /** - * APT package format. - * - * Generated from protobuf enum APT = 5; - */ - const APT = 5; - /** - * YUM package format. - * - * Generated from protobuf enum YUM = 6; - */ - const YUM = 6; - /** - * Python package format. - * - * Generated from protobuf enum PYTHON = 8; - */ - const PYTHON = 8; - - private static $valueToName = [ - self::FORMAT_UNSPECIFIED => 'FORMAT_UNSPECIFIED', - self::DOCKER => 'DOCKER', - self::MAVEN => 'MAVEN', - self::NPM => 'NPM', - self::APT => 'APT', - self::YUM => 'YUM', - self::PYTHON => 'PYTHON', - ]; - - 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(Format::class, \Google\Cloud\ArtifactRegistry\V1beta2\Repository_Format::class); - diff --git a/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig.php b/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig.php deleted file mode 100644 index cfc8302d1b41..000000000000 --- a/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig.php +++ /dev/null @@ -1,110 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig - */ -class MavenRepositoryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The repository with this flag will allow publishing - * the same snapshot versions. - * - * Generated from protobuf field bool allow_snapshot_overwrites = 1; - */ - private $allow_snapshot_overwrites = false; - /** - * Version policy defines the versions that the registry will accept. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy version_policy = 2; - */ - private $version_policy = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $allow_snapshot_overwrites - * The repository with this flag will allow publishing - * the same snapshot versions. - * @type int $version_policy - * Version policy defines the versions that the registry will accept. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * The repository with this flag will allow publishing - * the same snapshot versions. - * - * Generated from protobuf field bool allow_snapshot_overwrites = 1; - * @return bool - */ - public function getAllowSnapshotOverwrites() - { - return $this->allow_snapshot_overwrites; - } - - /** - * The repository with this flag will allow publishing - * the same snapshot versions. - * - * Generated from protobuf field bool allow_snapshot_overwrites = 1; - * @param bool $var - * @return $this - */ - public function setAllowSnapshotOverwrites($var) - { - GPBUtil::checkBool($var); - $this->allow_snapshot_overwrites = $var; - - return $this; - } - - /** - * Version policy defines the versions that the registry will accept. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy version_policy = 2; - * @return int - */ - public function getVersionPolicy() - { - return $this->version_policy; - } - - /** - * Version policy defines the versions that the registry will accept. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy version_policy = 2; - * @param int $var - * @return $this - */ - public function setVersionPolicy($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\Repository\MavenRepositoryConfig\VersionPolicy::class); - $this->version_policy = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MavenRepositoryConfig::class, \Google\Cloud\ArtifactRegistry\V1beta2\Repository_MavenRepositoryConfig::class); - diff --git a/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig/VersionPolicy.php b/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig/VersionPolicy.php deleted file mode 100644 index 0fd8426ce626..000000000000 --- a/ArtifactRegistry/src/V1beta2/Repository/MavenRepositoryConfig/VersionPolicy.php +++ /dev/null @@ -1,66 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Repository.MavenRepositoryConfig.VersionPolicy - */ -class VersionPolicy -{ - /** - * VERSION_POLICY_UNSPECIFIED - the version policy is not defined. - * When the version policy is not defined, no validation is performed - * for the versions. - * - * Generated from protobuf enum VERSION_POLICY_UNSPECIFIED = 0; - */ - const VERSION_POLICY_UNSPECIFIED = 0; - /** - * RELEASE - repository will accept only Release versions. - * - * Generated from protobuf enum RELEASE = 1; - */ - const RELEASE = 1; - /** - * SNAPSHOT - repository will accept only Snapshot versions. - * - * Generated from protobuf enum SNAPSHOT = 2; - */ - const SNAPSHOT = 2; - - private static $valueToName = [ - self::VERSION_POLICY_UNSPECIFIED => 'VERSION_POLICY_UNSPECIFIED', - self::RELEASE => 'RELEASE', - self::SNAPSHOT => 'SNAPSHOT', - ]; - - 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(VersionPolicy::class, \Google\Cloud\ArtifactRegistry\V1beta2\Repository_MavenRepositoryConfig_VersionPolicy::class); - diff --git a/ArtifactRegistry/src/V1beta2/Repository_Format.php b/ArtifactRegistry/src/V1beta2/Repository_Format.php deleted file mode 100644 index 4d3d83b8716c..000000000000 --- a/ArtifactRegistry/src/V1beta2/Repository_Format.php +++ /dev/null @@ -1,16 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Tag - */ -class Tag extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the tag, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". - * If the package part contains slashes, the slashes are escaped. - * The tag part can only have characters in [a-zA-Z0-9\-._~:@], anything else - * must be URL encoded. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * Generated from protobuf field string version = 2; - */ - private $version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the tag, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". - * If the package part contains slashes, the slashes are escaped. - * The tag part can only have characters in [a-zA-Z0-9\-._~:@], anything else - * must be URL encoded. - * @type string $version - * The name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The name of the tag, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". - * If the package part contains slashes, the slashes are escaped. - * The tag part can only have characters in [a-zA-Z0-9\-._~:@], anything else - * must be URL encoded. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the tag, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". - * If the package part contains slashes, the slashes are escaped. - * The tag part can only have characters in [a-zA-Z0-9\-._~:@], anything else - * must be URL encoded. - * - * 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 name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * Generated from protobuf field string version = 2; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * Generated from protobuf field string version = 2; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/UpdateProjectSettingsRequest.php b/ArtifactRegistry/src/V1beta2/UpdateProjectSettingsRequest.php deleted file mode 100644 index a171a387495a..000000000000 --- a/ArtifactRegistry/src/V1beta2/UpdateProjectSettingsRequest.php +++ /dev/null @@ -1,121 +0,0 @@ -google.devtools.artifactregistry.v1beta2.UpdateProjectSettingsRequest - */ -class UpdateProjectSettingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The project settings. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings project_settings = 2; - */ - private $project_settings = null; - /** - * Field mask to support partial updates. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings $project_settings - * The project settings. - * @type \Google\Protobuf\FieldMask $update_mask - * Field mask to support partial updates. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Settings::initOnce(); - parent::__construct($data); - } - - /** - * The project settings. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings project_settings = 2; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings|null - */ - public function getProjectSettings() - { - return $this->project_settings; - } - - public function hasProjectSettings() - { - return isset($this->project_settings); - } - - public function clearProjectSettings() - { - unset($this->project_settings); - } - - /** - * The project settings. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.ProjectSettings project_settings = 2; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings $var - * @return $this - */ - public function setProjectSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\ProjectSettings::class); - $this->project_settings = $var; - - return $this; - } - - /** - * Field mask to support partial updates. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; - * @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); - } - - /** - * Field mask to support partial updates. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/UpdateRepositoryRequest.php b/ArtifactRegistry/src/V1beta2/UpdateRepositoryRequest.php deleted file mode 100644 index f10bbce98dc9..000000000000 --- a/ArtifactRegistry/src/V1beta2/UpdateRepositoryRequest.php +++ /dev/null @@ -1,129 +0,0 @@ -google.devtools.artifactregistry.v1beta2.UpdateRepositoryRequest - */ -class UpdateRepositoryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The repository that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 1; - */ - private $repository = null; - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\Repository $repository - * The repository that replaces the resource on the server. - * @type \Google\Protobuf\FieldMask $update_mask - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Repository::initOnce(); - parent::__construct($data); - } - - /** - * The repository that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 1; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Repository|null - */ - public function getRepository() - { - return $this->repository; - } - - public function hasRepository() - { - return isset($this->repository); - } - - public function clearRepository() - { - unset($this->repository); - } - - /** - * The repository that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Repository repository = 1; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\Repository $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\Repository::class); - $this->repository = $var; - - return $this; - } - - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/UpdateTagRequest.php b/ArtifactRegistry/src/V1beta2/UpdateTagRequest.php deleted file mode 100644 index 0ee71a51ac92..000000000000 --- a/ArtifactRegistry/src/V1beta2/UpdateTagRequest.php +++ /dev/null @@ -1,129 +0,0 @@ -google.devtools.artifactregistry.v1beta2.UpdateTagRequest - */ -class UpdateTagRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The tag that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 1; - */ - private $tag = null; - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\ArtifactRegistry\V1beta2\Tag $tag - * The tag that replaces the resource on the server. - * @type \Google\Protobuf\FieldMask $update_mask - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Tag::initOnce(); - parent::__construct($data); - } - - /** - * The tag that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 1; - * @return \Google\Cloud\ArtifactRegistry\V1beta2\Tag|null - */ - public function getTag() - { - return $this->tag; - } - - public function hasTag() - { - return isset($this->tag); - } - - public function clearTag() - { - unset($this->tag); - } - - /** - * The tag that replaces the resource on the server. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.Tag tag = 1; - * @param \Google\Cloud\ArtifactRegistry\V1beta2\Tag $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\Tag::class); - $this->tag = $var; - - return $this; - } - - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/Version.php b/ArtifactRegistry/src/V1beta2/Version.php deleted file mode 100644 index d04ce13e5d7e..000000000000 --- a/ArtifactRegistry/src/V1beta2/Version.php +++ /dev/null @@ -1,297 +0,0 @@ -google.devtools.artifactregistry.v1beta2.Version - */ -class Version extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * Optional. Description of the version, as specified in its metadata. - * - * Generated from protobuf field string description = 3; - */ - private $description = ''; - /** - * The time when the version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - */ - private $create_time = null; - /** - * The time when the version was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - */ - private $update_time = null; - /** - * Output only. A list of related tags. Will contain up to 100 tags that - * reference this version. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag related_tags = 7; - */ - private $related_tags; - /** - * Output only. Repository-specific Metadata stored against this version. - * The fields returned are defined by the underlying repository-specific - * resource. Currently, the only resource in use is - * [DockerImage][google.devtools.artifactregistry.v1.DockerImage] - * - * Generated from protobuf field .google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $metadata = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * @type string $description - * Optional. Description of the version, as specified in its metadata. - * @type \Google\Protobuf\Timestamp $create_time - * The time when the version was created. - * @type \Google\Protobuf\Timestamp $update_time - * The time when the version was last updated. - * @type array<\Google\Cloud\ArtifactRegistry\V1beta2\Tag>|\Google\Protobuf\Internal\RepeatedField $related_tags - * Output only. A list of related tags. Will contain up to 100 tags that - * reference this version. - * @type \Google\Protobuf\Struct $metadata - * Output only. Repository-specific Metadata stored against this version. - * The fields returned are defined by the underlying repository-specific - * resource. Currently, the only resource in use is - * [DockerImage][google.devtools.artifactregistry.v1.DockerImage] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Version::initOnce(); - parent::__construct($data); - } - - /** - * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". - * If the package or version ID parts contain slashes, the slashes are - * escaped. - * - * 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; - } - - /** - * Optional. Description of the version, as specified in its metadata. - * - * Generated from protobuf field string description = 3; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. Description of the version, as specified in its metadata. - * - * Generated from protobuf field string description = 3; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * The time when the version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @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); - } - - /** - * The time when the version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time when the version was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @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); - } - - /** - * The time when the version was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @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. A list of related tags. Will contain up to 100 tags that - * reference this version. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag related_tags = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRelatedTags() - { - return $this->related_tags; - } - - /** - * Output only. A list of related tags. Will contain up to 100 tags that - * reference this version. - * - * Generated from protobuf field repeated .google.devtools.artifactregistry.v1beta2.Tag related_tags = 7; - * @param array<\Google\Cloud\ArtifactRegistry\V1beta2\Tag>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRelatedTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Tag::class); - $this->related_tags = $arr; - - return $this; - } - - /** - * Output only. Repository-specific Metadata stored against this version. - * The fields returned are defined by the underlying repository-specific - * resource. Currently, the only resource in use is - * [DockerImage][google.devtools.artifactregistry.v1.DockerImage] - * - * Generated from protobuf field .google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Struct|null - */ - public function getMetadata() - { - return $this->metadata; - } - - public function hasMetadata() - { - return isset($this->metadata); - } - - public function clearMetadata() - { - unset($this->metadata); - } - - /** - * Output only. Repository-specific Metadata stored against this version. - * The fields returned are defined by the underlying repository-specific - * resource. Currently, the only resource in use is - * [DockerImage][google.devtools.artifactregistry.v1.DockerImage] - * - * Generated from protobuf field .google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->metadata = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/VersionView.php b/ArtifactRegistry/src/V1beta2/VersionView.php deleted file mode 100644 index 9de024bf381d..000000000000 --- a/ArtifactRegistry/src/V1beta2/VersionView.php +++ /dev/null @@ -1,63 +0,0 @@ -google.devtools.artifactregistry.v1beta2.VersionView - */ -class VersionView -{ - /** - * The default / unset value. - * The API will default to the BASIC view. - * - * Generated from protobuf enum VERSION_VIEW_UNSPECIFIED = 0; - */ - const VERSION_VIEW_UNSPECIFIED = 0; - /** - * Includes basic information about the version, but not any related tags. - * - * Generated from protobuf enum BASIC = 1; - */ - const BASIC = 1; - /** - * Include everything. - * - * Generated from protobuf enum FULL = 2; - */ - const FULL = 2; - - private static $valueToName = [ - self::VERSION_VIEW_UNSPECIFIED => 'VERSION_VIEW_UNSPECIFIED', - self::BASIC => 'BASIC', - self::FULL => 'FULL', - ]; - - 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); - } -} - diff --git a/ArtifactRegistry/src/V1beta2/YumArtifact.php b/ArtifactRegistry/src/V1beta2/YumArtifact.php deleted file mode 100644 index f8d44fa515b9..000000000000 --- a/ArtifactRegistry/src/V1beta2/YumArtifact.php +++ /dev/null @@ -1,169 +0,0 @@ -google.devtools.artifactregistry.v1beta2.YumArtifact - */ -class YumArtifact extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * Output only. The yum package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $package_name = ''; - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $package_type = 0; - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $architecture = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The Artifact Registry resource name of the artifact. - * @type string $package_name - * Output only. The yum package name of the artifact. - * @type int $package_type - * Output only. An artifact is a binary or source package. - * @type string $architecture - * Output only. Operating system architecture of the artifact. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\YumArtifact::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The Artifact Registry resource name of the artifact. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The yum package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getPackageName() - { - return $this->package_name; - } - - /** - * Output only. The yum package name of the artifact. - * - * Generated from protobuf field string package_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPackageName($var) - { - GPBUtil::checkString($var, True); - $this->package_name = $var; - - return $this; - } - - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getPackageType() - { - return $this->package_type; - } - - /** - * Output only. An artifact is a binary or source package. - * - * Generated from protobuf field .google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setPackageType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1beta2\YumArtifact\PackageType::class); - $this->package_type = $var; - - return $this; - } - - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getArchitecture() - { - return $this->architecture; - } - - /** - * Output only. Operating system architecture of the artifact. - * - * Generated from protobuf field string architecture = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setArchitecture($var) - { - GPBUtil::checkString($var, True); - $this->architecture = $var; - - return $this; - } - -} - diff --git a/ArtifactRegistry/src/V1beta2/YumArtifact/PackageType.php b/ArtifactRegistry/src/V1beta2/YumArtifact/PackageType.php deleted file mode 100644 index 6b7517f0879e..000000000000 --- a/ArtifactRegistry/src/V1beta2/YumArtifact/PackageType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.devtools.artifactregistry.v1beta2.YumArtifact.PackageType - */ -class PackageType -{ - /** - * Package type is not specified. - * - * Generated from protobuf enum PACKAGE_TYPE_UNSPECIFIED = 0; - */ - const PACKAGE_TYPE_UNSPECIFIED = 0; - /** - * Binary package (.rpm). - * - * Generated from protobuf enum BINARY = 1; - */ - const BINARY = 1; - /** - * Source package (.srpm). - * - * Generated from protobuf enum SOURCE = 2; - */ - const SOURCE = 2; - - private static $valueToName = [ - self::PACKAGE_TYPE_UNSPECIFIED => 'PACKAGE_TYPE_UNSPECIFIED', - self::BINARY => 'BINARY', - self::SOURCE => 'SOURCE', - ]; - - 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(PackageType::class, \Google\Cloud\ArtifactRegistry\V1beta2\YumArtifact_PackageType::class); - diff --git a/ArtifactRegistry/src/V1beta2/YumArtifact_PackageType.php b/ArtifactRegistry/src/V1beta2/YumArtifact_PackageType.php deleted file mode 100644 index 9b9ef4559029..000000000000 --- a/ArtifactRegistry/src/V1beta2/YumArtifact_PackageType.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - 'google.devtools.artifactregistry.v1beta2.ArtifactRegistry' => [ - 'CreateRepository' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\Repository', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeletePackage' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteRepository' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteVersion' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ImportAptArtifacts' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsResponse', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ImportYumArtifacts' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsResponse', - 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1beta2\ImportYumArtifactsMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListFiles' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFiles', - ], - ], - 'ListPackages' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getPackages', - ], - ], - 'ListRepositories' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getRepositories', - ], - ], - 'ListTags' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTags', - ], - ], - 'ListVersions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getVersions', - ], - ], - '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', - ], - ], - ], -]; diff --git a/ArtifactRegistry/src/V1beta2/resources/artifact_registry_rest_client_config.php b/ArtifactRegistry/src/V1beta2/resources/artifact_registry_rest_client_config.php deleted file mode 100644 index 9e1bfa389e17..000000000000 --- a/ArtifactRegistry/src/V1beta2/resources/artifact_registry_rest_client_config.php +++ /dev/null @@ -1,353 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.devtools.artifactregistry.v1beta2.ArtifactRegistry' => [ - 'CreateRepository' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*}/repositories', - 'body' => 'repository', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateTag' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/tags', - 'body' => 'tag', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeletePackage' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteRepository' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteTag' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteVersion' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/versions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetFile' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/files/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{resource=projects/*/locations/*/repositories/*}:getIamPolicy', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetPackage' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetProjectSettings' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/projectSettings}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetRepository' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetTag' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetVersion' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/repositories/*/packages/*/versions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ImportAptArtifacts' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*}/aptArtifacts:import', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ImportYumArtifacts' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*}/yumArtifacts:import', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListFiles' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*}/files', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListPackages' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*}/packages', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListRepositories' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*}/repositories', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListTags' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/tags', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListVersions' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{parent=projects/*/locations/*/repositories/*/packages/*}/versions', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{resource=projects/*/locations/*/repositories/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta2/{resource=projects/*/locations/*/repositories/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateProjectSettings' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta2/{project_settings.name=projects/*/projectSettings}', - 'body' => 'project_settings', - 'placeholders' => [ - 'project_settings.name' => [ - 'getters' => [ - 'getProjectSettings', - 'getName', - ], - ], - ], - ], - 'UpdateRepository' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta2/{repository.name=projects/*/locations/*/repositories/*}', - 'body' => 'repository', - 'placeholders' => [ - 'repository.name' => [ - 'getters' => [ - 'getRepository', - 'getName', - ], - ], - ], - ], - 'UpdateTag' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta2/{tag.name=projects/*/locations/*/repositories/*/packages/*/tags/*}', - 'body' => 'tag', - 'placeholders' => [ - 'tag.name' => [ - 'getters' => [ - 'getTag', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php b/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php index 8be9c2477e14..f718ccb27026 100644 --- a/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php +++ b/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return ArtifactRegistryClient */ @@ -160,8 +162,7 @@ public function batchDeleteVersionsTest() $formattedNames = [ $gapicClient->versionName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]', '[VERSION]'), ]; - $request = (new BatchDeleteVersionsRequest()) - ->setNames($formattedNames); + $request = (new BatchDeleteVersionsRequest())->setNames($formattedNames); $response = $gapicClient->batchDeleteVersions($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -171,7 +172,10 @@ public function batchDeleteVersionsTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/BatchDeleteVersions', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.artifactregistry.v1.ArtifactRegistry/BatchDeleteVersions', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getNames(); $this->assertProtobufEquals($formattedNames, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); @@ -217,19 +221,21 @@ public function batchDeleteVersionsExceptionTest() $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 $formattedNames = [ $gapicClient->versionName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]', '[VERSION]'), ]; - $request = (new BatchDeleteVersionsRequest()) - ->setNames($formattedNames); + $request = (new BatchDeleteVersionsRequest())->setNames($formattedNames); $response = $gapicClient->batchDeleteVersions($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -295,8 +301,7 @@ public function createRepositoryTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new CreateRepositoryRequest()) - ->setParent($formattedParent); + $request = (new CreateRepositoryRequest())->setParent($formattedParent); $response = $gapicClient->createRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -352,17 +357,19 @@ public function createRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new CreateRepositoryRequest()) - ->setParent($formattedParent); + $request = (new CreateRepositoryRequest())->setParent($formattedParent); $response = $gapicClient->createRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -422,12 +429,15 @@ public function createTagExceptionTest() $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 CreateTagRequest(); try { @@ -474,8 +484,7 @@ public function deletePackageTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->packageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]'); - $request = (new DeletePackageRequest()) - ->setName($formattedName); + $request = (new DeletePackageRequest())->setName($formattedName); $response = $gapicClient->deletePackage($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -531,17 +540,19 @@ public function deletePackageExceptionTest() $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->packageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]'); - $request = (new DeletePackageRequest()) - ->setName($formattedName); + $request = (new DeletePackageRequest())->setName($formattedName); $response = $gapicClient->deletePackage($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -595,8 +606,7 @@ public function deleteRepositoryTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new DeleteRepositoryRequest()) - ->setName($formattedName); + $request = (new DeleteRepositoryRequest())->setName($formattedName); $response = $gapicClient->deleteRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -652,17 +662,19 @@ public function deleteRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new DeleteRepositoryRequest()) - ->setName($formattedName); + $request = (new DeleteRepositoryRequest())->setName($formattedName); $response = $gapicClient->deleteRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -717,12 +729,15 @@ public function deleteTagExceptionTest() $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 DeleteTagRequest(); try { @@ -821,12 +836,15 @@ public function deleteVersionExceptionTest() $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); $request = new DeleteVersionRequest(); $response = $gapicClient->deleteVersion($request); @@ -872,8 +890,7 @@ public function getDockerImageTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->dockerImageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[DOCKER_IMAGE]'); - $request = (new GetDockerImageRequest()) - ->setName($formattedName); + $request = (new GetDockerImageRequest())->setName($formattedName); $response = $gapicClient->getDockerImage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -897,17 +914,19 @@ public function getDockerImageExceptionTest() $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->dockerImageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[DOCKER_IMAGE]'); - $request = (new GetDockerImageRequest()) - ->setName($formattedName); + $request = (new GetDockerImageRequest())->setName($formattedName); try { $gapicClient->getDockerImage($request); // If the $gapicClient method call did not throw, fail the test @@ -940,8 +959,7 @@ public function getFileTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->fileName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[FILE]'); - $request = (new GetFileRequest()) - ->setName($formattedName); + $request = (new GetFileRequest())->setName($formattedName); $response = $gapicClient->getFile($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -965,17 +983,19 @@ public function getFileExceptionTest() $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->fileName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[FILE]'); - $request = (new GetFileRequest()) - ->setName($formattedName); + $request = (new GetFileRequest())->setName($formattedName); try { $gapicClient->getFile($request); // If the $gapicClient method call did not throw, fail the test @@ -1006,8 +1026,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(); @@ -1031,17 +1050,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 @@ -1078,8 +1099,7 @@ public function getMavenArtifactTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->mavenArtifactName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[MAVEN_ARTIFACT]'); - $request = (new GetMavenArtifactRequest()) - ->setName($formattedName); + $request = (new GetMavenArtifactRequest())->setName($formattedName); $response = $gapicClient->getMavenArtifact($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1103,17 +1123,19 @@ public function getMavenArtifactExceptionTest() $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->mavenArtifactName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[MAVEN_ARTIFACT]'); - $request = (new GetMavenArtifactRequest()) - ->setName($formattedName); + $request = (new GetMavenArtifactRequest())->setName($formattedName); try { $gapicClient->getMavenArtifact($request); // If the $gapicClient method call did not throw, fail the test @@ -1146,8 +1168,7 @@ public function getNpmPackageTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->npmPackageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[NPM_PACKAGE]'); - $request = (new GetNpmPackageRequest()) - ->setName($formattedName); + $request = (new GetNpmPackageRequest())->setName($formattedName); $response = $gapicClient->getNpmPackage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1171,17 +1192,19 @@ public function getNpmPackageExceptionTest() $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->npmPackageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[NPM_PACKAGE]'); - $request = (new GetNpmPackageRequest()) - ->setName($formattedName); + $request = (new GetNpmPackageRequest())->setName($formattedName); try { $gapicClient->getNpmPackage($request); // If the $gapicClient method call did not throw, fail the test @@ -1212,8 +1235,7 @@ public function getPackageTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->packageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]'); - $request = (new GetPackageRequest()) - ->setName($formattedName); + $request = (new GetPackageRequest())->setName($formattedName); $response = $gapicClient->getPackage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1237,17 +1259,19 @@ public function getPackageExceptionTest() $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->packageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]'); - $request = (new GetPackageRequest()) - ->setName($formattedName); + $request = (new GetPackageRequest())->setName($formattedName); try { $gapicClient->getPackage($request); // If the $gapicClient method call did not throw, fail the test @@ -1276,8 +1300,7 @@ public function getProjectSettingsTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->projectSettingsName('[PROJECT]'); - $request = (new GetProjectSettingsRequest()) - ->setName($formattedName); + $request = (new GetProjectSettingsRequest())->setName($formattedName); $response = $gapicClient->getProjectSettings($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1301,17 +1324,19 @@ public function getProjectSettingsExceptionTest() $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->projectSettingsName('[PROJECT]'); - $request = (new GetProjectSettingsRequest()) - ->setName($formattedName); + $request = (new GetProjectSettingsRequest())->setName($formattedName); try { $gapicClient->getProjectSettings($request); // If the $gapicClient method call did not throw, fail the test @@ -1346,8 +1371,7 @@ public function getPythonPackageTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->pythonPackageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PYTHON_PACKAGE]'); - $request = (new GetPythonPackageRequest()) - ->setName($formattedName); + $request = (new GetPythonPackageRequest())->setName($formattedName); $response = $gapicClient->getPythonPackage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1371,17 +1395,19 @@ public function getPythonPackageExceptionTest() $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->pythonPackageName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PYTHON_PACKAGE]'); - $request = (new GetPythonPackageRequest()) - ->setName($formattedName); + $request = (new GetPythonPackageRequest())->setName($formattedName); try { $gapicClient->getPythonPackage($request); // If the $gapicClient method call did not throw, fail the test @@ -1420,8 +1446,7 @@ public function getRepositoryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new GetRepositoryRequest()) - ->setName($formattedName); + $request = (new GetRepositoryRequest())->setName($formattedName); $response = $gapicClient->getRepository($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1445,17 +1470,19 @@ public function getRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new GetRepositoryRequest()) - ->setName($formattedName); + $request = (new GetRepositoryRequest())->setName($formattedName); try { $gapicClient->getRepository($request); // If the $gapicClient method call did not throw, fail the test @@ -1506,12 +1533,15 @@ public function getTagExceptionTest() $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 GetTagRequest(); try { @@ -1542,8 +1572,7 @@ public function getVPCSCConfigTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->vpcscConfigName('[PROJECT]', '[LOCATION]'); - $request = (new GetVPCSCConfigRequest()) - ->setName($formattedName); + $request = (new GetVPCSCConfigRequest())->setName($formattedName); $response = $gapicClient->getVPCSCConfig($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1567,17 +1596,19 @@ public function getVPCSCConfigExceptionTest() $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->vpcscConfigName('[PROJECT]', '[LOCATION]'); - $request = (new GetVPCSCConfigRequest()) - ->setName($formattedName); + $request = (new GetVPCSCConfigRequest())->setName($formattedName); try { $gapicClient->getVPCSCConfig($request); // If the $gapicClient method call did not throw, fail the test @@ -1628,12 +1659,15 @@ public function getVersionExceptionTest() $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 GetVersionRequest(); try { @@ -1688,7 +1722,10 @@ public function importAptArtifactsTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportAptArtifacts', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportAptArtifacts', + $actualApiFuncCall + ); $expectedOperationsRequestObject = new GetOperationRequest(); $expectedOperationsRequestObject->setName('operations/importAptArtifactsTest'); $response->pollUntilComplete([ @@ -1732,12 +1769,15 @@ public function importAptArtifactsExceptionTest() $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); $request = new ImportAptArtifactsRequest(); $response = $gapicClient->importAptArtifacts($request); @@ -1801,7 +1841,10 @@ public function importYumArtifactsTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportYumArtifacts', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.artifactregistry.v1.ArtifactRegistry/ImportYumArtifacts', + $actualApiFuncCall + ); $expectedOperationsRequestObject = new GetOperationRequest(); $expectedOperationsRequestObject->setName('operations/importYumArtifactsTest'); $response->pollUntilComplete([ @@ -1845,12 +1888,15 @@ public function importYumArtifactsExceptionTest() $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); $request = new ImportYumArtifactsRequest(); $response = $gapicClient->importYumArtifacts($request); @@ -1886,17 +1932,14 @@ public function listDockerImagesTest() // Mock response $nextPageToken = ''; $dockerImagesElement = new DockerImage(); - $dockerImages = [ - $dockerImagesElement, - ]; + $dockerImages = [$dockerImagesElement]; $expectedResponse = new ListDockerImagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setDockerImages($dockerImages); $transport->addResponse($expectedResponse); // Mock request $parent = 'parent-995424086'; - $request = (new ListDockerImagesRequest()) - ->setParent($parent); + $request = (new ListDockerImagesRequest())->setParent($parent); $response = $gapicClient->listDockerImages($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1923,17 +1966,19 @@ public function listDockerImagesExceptionTest() $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 $parent = 'parent-995424086'; - $request = (new ListDockerImagesRequest()) - ->setParent($parent); + $request = (new ListDockerImagesRequest())->setParent($parent); try { $gapicClient->listDockerImages($request); // If the $gapicClient method call did not throw, fail the test @@ -1958,17 +2003,14 @@ public function listFilesTest() // Mock response $nextPageToken = ''; $filesElement = new File(); - $files = [ - $filesElement, - ]; + $files = [$filesElement]; $expectedResponse = new ListFilesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFiles($files); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListFilesRequest()) - ->setParent($formattedParent); + $request = (new ListFilesRequest())->setParent($formattedParent); $response = $gapicClient->listFiles($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1995,17 +2037,19 @@ public function listFilesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListFilesRequest()) - ->setParent($formattedParent); + $request = (new ListFilesRequest())->setParent($formattedParent); try { $gapicClient->listFiles($request); // If the $gapicClient method call did not throw, fail the test @@ -2030,17 +2074,14 @@ public function listMavenArtifactsTest() // Mock response $nextPageToken = ''; $mavenArtifactsElement = new MavenArtifact(); - $mavenArtifacts = [ - $mavenArtifactsElement, - ]; + $mavenArtifacts = [$mavenArtifactsElement]; $expectedResponse = new ListMavenArtifactsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMavenArtifacts($mavenArtifacts); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListMavenArtifactsRequest()) - ->setParent($formattedParent); + $request = (new ListMavenArtifactsRequest())->setParent($formattedParent); $response = $gapicClient->listMavenArtifacts($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2067,17 +2108,19 @@ public function listMavenArtifactsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListMavenArtifactsRequest()) - ->setParent($formattedParent); + $request = (new ListMavenArtifactsRequest())->setParent($formattedParent); try { $gapicClient->listMavenArtifacts($request); // If the $gapicClient method call did not throw, fail the test @@ -2102,17 +2145,14 @@ public function listNpmPackagesTest() // Mock response $nextPageToken = ''; $npmPackagesElement = new NpmPackage(); - $npmPackages = [ - $npmPackagesElement, - ]; + $npmPackages = [$npmPackagesElement]; $expectedResponse = new ListNpmPackagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setNpmPackages($npmPackages); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListNpmPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListNpmPackagesRequest())->setParent($formattedParent); $response = $gapicClient->listNpmPackages($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2139,17 +2179,19 @@ public function listNpmPackagesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListNpmPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListNpmPackagesRequest())->setParent($formattedParent); try { $gapicClient->listNpmPackages($request); // If the $gapicClient method call did not throw, fail the test @@ -2174,17 +2216,14 @@ public function listPackagesTest() // Mock response $nextPageToken = ''; $packagesElement = new Package(); - $packages = [ - $packagesElement, - ]; + $packages = [$packagesElement]; $expectedResponse = new ListPackagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setPackages($packages); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListPackagesRequest())->setParent($formattedParent); $response = $gapicClient->listPackages($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2211,17 +2250,19 @@ public function listPackagesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListPackagesRequest())->setParent($formattedParent); try { $gapicClient->listPackages($request); // If the $gapicClient method call did not throw, fail the test @@ -2246,17 +2287,14 @@ public function listPythonPackagesTest() // Mock response $nextPageToken = ''; $pythonPackagesElement = new PythonPackage(); - $pythonPackages = [ - $pythonPackagesElement, - ]; + $pythonPackages = [$pythonPackagesElement]; $expectedResponse = new ListPythonPackagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setPythonPackages($pythonPackages); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListPythonPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListPythonPackagesRequest())->setParent($formattedParent); $response = $gapicClient->listPythonPackages($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2283,17 +2321,19 @@ public function listPythonPackagesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListPythonPackagesRequest()) - ->setParent($formattedParent); + $request = (new ListPythonPackagesRequest())->setParent($formattedParent); try { $gapicClient->listPythonPackages($request); // If the $gapicClient method call did not throw, fail the test @@ -2318,17 +2358,14 @@ public function listRepositoriesTest() // Mock response $nextPageToken = ''; $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; + $repositories = [$repositoriesElement]; $expectedResponse = new ListRepositoriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setRepositories($repositories); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListRepositoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); $response = $gapicClient->listRepositories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2355,17 +2392,19 @@ public function listRepositoriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListRepositoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); try { $gapicClient->listRepositories($request); // If the $gapicClient method call did not throw, fail the test @@ -2390,9 +2429,7 @@ public function listTagsTest() // Mock response $nextPageToken = ''; $tagsElement = new Tag(); - $tags = [ - $tagsElement, - ]; + $tags = [$tagsElement]; $expectedResponse = new ListTagsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTags($tags); @@ -2422,12 +2459,15 @@ public function listTagsExceptionTest() $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 ListTagsRequest(); try { @@ -2454,9 +2494,7 @@ public function listVersionsTest() // Mock response $nextPageToken = ''; $versionsElement = new Version(); - $versions = [ - $versionsElement, - ]; + $versions = [$versionsElement]; $expectedResponse = new ListVersionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setVersions($versions); @@ -2486,12 +2524,15 @@ public function listVersionsExceptionTest() $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 ListVersionsRequest(); try { @@ -2525,9 +2566,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(); @@ -2553,19 +2592,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 @@ -2593,9 +2633,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(); @@ -2621,19 +2659,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 @@ -2667,7 +2706,10 @@ public function updateProjectSettingsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateProjectSettings', $actualFuncCall); + $this->assertSame( + '/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateProjectSettings', + $actualFuncCall + ); $this->assertTrue($transport->isExhausted()); } @@ -2682,12 +2724,15 @@ public function updateProjectSettingsExceptionTest() $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 UpdateProjectSettingsRequest(); try { @@ -2748,12 +2793,15 @@ public function updateRepositoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new UpdateRepositoryRequest(); try { @@ -2806,12 +2854,15 @@ public function updateTagExceptionTest() $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 UpdateTagRequest(); try { @@ -2862,12 +2913,15 @@ public function updateVPCSCConfigExceptionTest() $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 UpdateVPCSCConfigRequest(); try { @@ -2922,12 +2976,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 { @@ -2954,9 +3011,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -2986,12 +3041,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 { @@ -3040,8 +3098,7 @@ public function batchDeleteVersionsAsyncTest() $formattedNames = [ $gapicClient->versionName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[PACKAGE]', '[VERSION]'), ]; - $request = (new BatchDeleteVersionsRequest()) - ->setNames($formattedNames); + $request = (new BatchDeleteVersionsRequest())->setNames($formattedNames); $response = $gapicClient->batchDeleteVersionsAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3051,7 +3108,10 @@ public function batchDeleteVersionsAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/BatchDeleteVersions', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.artifactregistry.v1.ArtifactRegistry/BatchDeleteVersions', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getNames(); $this->assertProtobufEquals($formattedNames, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); diff --git a/ArtifactRegistry/tests/Unit/V1beta2/ArtifactRegistryClientTest.php b/ArtifactRegistry/tests/Unit/V1beta2/ArtifactRegistryClientTest.php deleted file mode 100644 index 24c868517e30..000000000000 --- a/ArtifactRegistry/tests/Unit/V1beta2/ArtifactRegistryClientTest.php +++ /dev/null @@ -1,2017 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ArtifactRegistryClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ArtifactRegistryClient($options); - } - - /** @test */ - public function createRepositoryTest() - { - $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/createRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $kmsKeyName = 'kmsKeyName2094986649'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setKmsKeyName($kmsKeyName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createRepositoryTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->createRepository($formattedParent); - $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.devtools.artifactregistry.v1beta2.ArtifactRegistry/CreateRepository', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createRepositoryTest'); - $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 createRepositoryExceptionTest() - { - $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/createRepositoryTest'); - $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]'); - $response = $gapicClient->createRepository($formattedParent); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createRepositoryTest'); - 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 createTagTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $version = 'version351608024'; - $expectedResponse = new Tag(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $transport->addResponse($expectedResponse); - $response = $gapicClient->createTag(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/CreateTag', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTagExceptionTest() - { - $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->createTag(); - // 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 deletePackageTest() - { - $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/deletePackageTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deletePackageTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $response = $gapicClient->deletePackage(); - $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.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeletePackage', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deletePackageTest'); - $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 deletePackageExceptionTest() - { - $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/deletePackageTest'); - $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); - $response = $gapicClient->deletePackage(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deletePackageTest'); - 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 deleteRepositoryTest() - { - $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/deleteRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteRepositoryTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->deleteRepository($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.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteRepository', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRepositoryTest'); - $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 deleteRepositoryExceptionTest() - { - $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/deleteRepositoryTest'); - $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->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->deleteRepository($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRepositoryTest'); - 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 deleteTagTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - $gapicClient->deleteTag(); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteTag', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTagExceptionTest() - { - $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->deleteTag(); - // 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 deleteVersionTest() - { - $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/deleteVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $response = $gapicClient->deleteVersion(); - $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.devtools.artifactregistry.v1beta2.ArtifactRegistry/DeleteVersion', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteVersionTest'); - $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 deleteVersionExceptionTest() - { - $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/deleteVersionTest'); - $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); - $response = $gapicClient->deleteVersion(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteVersionTest'); - 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 getFileTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $sizeBytes = 1796325715; - $owner = 'owner106164915'; - $expectedResponse = new File(); - $expectedResponse->setName($name2); - $expectedResponse->setSizeBytes($sizeBytes); - $expectedResponse->setOwner($owner); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getFile(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetFile', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFileExceptionTest() - { - $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->getFile(); - // 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.devtools.artifactregistry.v1beta2.ArtifactRegistry/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 getPackageTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Package(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getPackage(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetPackage', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPackageExceptionTest() - { - $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->getPackage(); - // 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 getProjectSettingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new ProjectSettings(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectSettingsName('[PROJECT]'); - $response = $gapicClient->getProjectSettings($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetProjectSettings', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProjectSettingsExceptionTest() - { - $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->projectSettingsName('[PROJECT]'); - try { - $gapicClient->getProjectSettings($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRepositoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $kmsKeyName = 'kmsKeyName2094986649'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setKmsKeyName($kmsKeyName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $response = $gapicClient->getRepository($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetRepository', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRepositoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - try { - $gapicClient->getRepository($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTagTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $version = 'version351608024'; - $expectedResponse = new Tag(); - $expectedResponse->setName($name2); - $expectedResponse->setVersion($version); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getTag(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetTag', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTagExceptionTest() - { - $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->getTag(); - // 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 getVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Version(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getVersion(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetVersion', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getVersionExceptionTest() - { - $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->getVersion(); - // 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 importAptArtifactsTest() - { - $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/importAptArtifactsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportAptArtifactsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importAptArtifactsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $response = $gapicClient->importAptArtifacts(); - $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.devtools.artifactregistry.v1beta2.ArtifactRegistry/ImportAptArtifacts', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importAptArtifactsTest'); - $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 importAptArtifactsExceptionTest() - { - $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/importAptArtifactsTest'); - $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); - $response = $gapicClient->importAptArtifacts(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importAptArtifactsTest'); - 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 importYumArtifactsTest() - { - $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/importYumArtifactsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportYumArtifactsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importYumArtifactsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $response = $gapicClient->importYumArtifacts(); - $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.devtools.artifactregistry.v1beta2.ArtifactRegistry/ImportYumArtifacts', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importYumArtifactsTest'); - $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 importYumArtifactsExceptionTest() - { - $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/importYumArtifactsTest'); - $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); - $response = $gapicClient->importYumArtifacts(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importYumArtifactsTest'); - 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 listFilesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $filesElement = new File(); - $files = [ - $filesElement, - ]; - $expectedResponse = new ListFilesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFiles($files); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listFiles(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFiles()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListFiles', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFilesExceptionTest() - { - $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->listFiles(); - // 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 listPackagesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $packagesElement = new Package(); - $packages = [ - $packagesElement, - ]; - $expectedResponse = new ListPackagesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setPackages($packages); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listPackages(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getPackages()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListPackages', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listPackagesExceptionTest() - { - $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->listPackages(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRepositoriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; - $expectedResponse = new ListRepositoriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRepositories($repositories); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listRepositories($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRepositories()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListRepositories', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRepositoriesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listRepositories($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tagsElement = new Tag(); - $tags = [ - $tagsElement, - ]; - $expectedResponse = new ListTagsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTags($tags); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listTags(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTags()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListTags', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTagsExceptionTest() - { - $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->listTags(); - // 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 listVersionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $versionsElement = new Version(); - $versions = [ - $versionsElement, - ]; - $expectedResponse = new ListVersionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setVersions($versions); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listVersions(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getVersions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/ListVersions', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listVersionsExceptionTest() - { - $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->listVersions(); - // 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.devtools.artifactregistry.v1beta2.ArtifactRegistry/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.devtools.artifactregistry.v1beta2.ArtifactRegistry/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()); - } - - /** @test */ - public function updateProjectSettingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new ProjectSettings(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - $response = $gapicClient->updateProjectSettings(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateProjectSettings', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateProjectSettingsExceptionTest() - { - $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->updateProjectSettings(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRepositoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $kmsKeyName = 'kmsKeyName2094986649'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setKmsKeyName($kmsKeyName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->updateRepository(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateRepository', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRepositoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->updateRepository(); - // 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 updateTagTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $version = 'version351608024'; - $expectedResponse = new Tag(); - $expectedResponse->setName($name); - $expectedResponse->setVersion($version); - $transport->addResponse($expectedResponse); - $response = $gapicClient->updateTag(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/UpdateTag', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateTagExceptionTest() - { - $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->updateTag(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}