From 3a7a27d2dc27f0ff91ceb1de288c3ff7bc51921d Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Thu, 13 Jun 2024 15:07:14 -0700 Subject: [PATCH] chore!: promote BinaryAuthorization to V1 (#7392) --- .repo-metadata-full.json | 2 +- BinaryAuthorization/.OwlBot.yaml | 2 +- BinaryAuthorization/README.md | 5 +- BinaryAuthorization/owlbot.py | 53 +- BinaryAuthorization/src/V1/AdmissionRule.php | 4 +- .../src/V1/AdmissionRule/EnforcementMode.php | 2 - .../src/V1/AdmissionRule/EvaluationMode.php | 2 - .../src/V1/AdmissionWhitelistPattern.php | 2 +- BinaryAuthorization/src/V1/Attestor.php | 6 +- .../src/V1/AttestorPublicKey.php | 4 +- .../BinauthzManagementServiceV1GrpcClient.php | 165 ---- .../BinauthzManagementServiceV1Client.php | 9 +- .../src/V1/Client/SystemPolicyV1Client.php | 6 +- .../V1/Client/ValidationHelperV1Client.php | 12 +- .../src/V1/CreateAttestorRequest.php | 6 +- .../src/V1/DeleteAttestorRequest.php | 2 +- .../src/V1/GetAttestorRequest.php | 2 +- .../src/V1/GetPolicyRequest.php | 2 +- .../src/V1/GetSystemPolicyRequest.php | 2 +- .../src/V1/ListAttestorsRequest.php | 6 +- .../src/V1/ListAttestorsResponse.php | 2 +- BinaryAuthorization/src/V1/PkixPublicKey.php | 4 +- .../V1/PkixPublicKey/SignatureAlgorithm.php | 2 - BinaryAuthorization/src/V1/Policy.php | 10 +- .../V1/Policy/GlobalPolicyEvaluationMode.php | 2 - .../src/V1/SystemPolicyV1GrpcClient.php | 50 -- .../src/V1/UpdateAttestorRequest.php | 2 +- .../src/V1/UpdatePolicyRequest.php | 2 +- .../src/V1/UserOwnedGrafeasNote.php | 4 +- .../ValidateAttestationOccurrenceRequest.php | 8 +- .../ValidateAttestationOccurrenceResponse.php | 4 +- .../Result.php | 2 - .../src/V1/ValidationHelperV1GrpcClient.php | 51 -- .../src/V1beta1/AdmissionRule.php | 164 ---- .../V1beta1/AdmissionRule/EnforcementMode.php | 66 -- .../V1beta1/AdmissionRule/EvaluationMode.php | 71 -- .../V1beta1/AdmissionRule_EnforcementMode.php | 16 - .../V1beta1/AdmissionRule_EvaluationMode.php | 16 - .../src/V1beta1/AdmissionWhitelistPattern.php | 92 --- BinaryAuthorization/src/V1beta1/Attestor.php | 197 ----- .../src/V1beta1/AttestorPublicKey.php | 234 ------ ...BinauthzManagementServiceV1Beta1Client.php | 36 - ...uthzManagementServiceV1Beta1GrpcClient.php | 165 ---- .../src/V1beta1/ContinuousValidationEvent.php | 108 --- .../ConfigErrorEvent.php | 71 -- .../ContinuousValidationPodEvent.php | 294 ------- .../ImageDetails.php | 240 ------ .../ImageDetails/AuditResult.php | 64 -- .../ImageDetails/CheckResult.php | 316 -------- .../CheckResult/CheckSetScope.php | 126 --- .../ImageDetails/CheckResult/CheckVerdict.php | 58 -- .../ImageDetails/ContainerType.php | 73 -- .../PolicyConformanceVerdict.php | 57 -- .../UnsupportedPolicyEvent.php | 70 -- ...tionEvent_ContinuousValidationPodEvent.php | 16 - ...tinuousValidationPodEvent_ImageDetails.php | 16 - ...ationPodEvent_ImageDetails_AuditResult.php | 16 - ...ationPodEvent_PolicyConformanceVerdict.php | 16 - ...ValidationEvent_UnsupportedPolicyEvent.php | 16 - .../src/V1beta1/CreateAttestorRequest.php | 153 ---- .../src/V1beta1/DeleteAttestorRequest.php | 71 -- ...thzManagementServiceV1Beta1GapicClient.php | 744 ------------------ .../Gapic/SystemPolicyV1Beta1GapicClient.php | 360 --------- .../src/V1beta1/GetAttestorRequest.php | 71 -- .../src/V1beta1/GetPolicyRequest.php | 71 -- .../src/V1beta1/GetSystemPolicyRequest.php | 71 -- .../src/V1beta1/ListAttestorsRequest.php | 151 ---- .../src/V1beta1/ListAttestorsResponse.php | 109 --- .../src/V1beta1/PkixPublicKey.php | 124 --- .../PkixPublicKey/SignatureAlgorithm.php | 153 ---- .../PkixPublicKey_SignatureAlgorithm.php | 16 - BinaryAuthorization/src/V1beta1/Policy.php | 469 ----------- .../Policy/GlobalPolicyEvaluationMode.php | 62 -- .../Policy_GlobalPolicyEvaluationMode.php | 16 - .../src/V1beta1/SystemPolicyV1Beta1Client.php | 36 - .../V1beta1/SystemPolicyV1Beta1GrpcClient.php | 50 -- .../src/V1beta1/UpdateAttestorRequest.php | 85 -- .../src/V1beta1/UpdatePolicyRequest.php | 85 -- .../src/V1beta1/UserOwnedDrydockNote.php | 208 ----- .../src/V1beta1/gapic_metadata.json | 67 -- ...gement_service_v1_beta1_client_config.json | 80 -- ...ent_service_v1_beta1_descriptor_config.php | 38 - ...nt_service_v1_beta1_rest_client_config.php | 171 ---- .../system_policy_v1_beta1_client_config.json | 27 - ...stem_policy_v1_beta1_descriptor_config.php | 27 - ...tem_policy_v1_beta1_rest_client_config.php | 97 --- .../BinauthzManagementServiceV1ClientTest.php | 191 +++-- .../V1/Client/SystemPolicyV1ClientTest.php | 30 +- .../Client/ValidationHelperV1ClientTest.php | 31 +- ...uthzManagementServiceV1Beta1ClientTest.php | 530 ------------- .../V1beta1/SystemPolicyV1Beta1ClientTest.php | 123 --- 91 files changed, 223 insertions(+), 7345 deletions(-) delete mode 100644 BinaryAuthorization/src/V1/BinauthzManagementServiceV1GrpcClient.php delete mode 100644 BinaryAuthorization/src/V1/SystemPolicyV1GrpcClient.php delete mode 100644 BinaryAuthorization/src/V1/ValidationHelperV1GrpcClient.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionRule.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionRule/EnforcementMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionRule/EvaluationMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionRule_EnforcementMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionRule_EvaluationMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/AdmissionWhitelistPattern.php delete mode 100644 BinaryAuthorization/src/V1beta1/Attestor.php delete mode 100644 BinaryAuthorization/src/V1beta1/AttestorPublicKey.php delete mode 100644 BinaryAuthorization/src/V1beta1/BinauthzManagementServiceV1Beta1Client.php delete mode 100644 BinaryAuthorization/src/V1beta1/BinauthzManagementServiceV1Beta1GrpcClient.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ConfigErrorEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/AuditResult.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckSetScope.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckVerdict.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/ContainerType.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/PolicyConformanceVerdict.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/UnsupportedPolicyEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_AuditResult.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent_PolicyConformanceVerdict.php delete mode 100644 BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_UnsupportedPolicyEvent.php delete mode 100644 BinaryAuthorization/src/V1beta1/CreateAttestorRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/DeleteAttestorRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/Gapic/BinauthzManagementServiceV1Beta1GapicClient.php delete mode 100644 BinaryAuthorization/src/V1beta1/Gapic/SystemPolicyV1Beta1GapicClient.php delete mode 100644 BinaryAuthorization/src/V1beta1/GetAttestorRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/GetPolicyRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/GetSystemPolicyRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/ListAttestorsRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/ListAttestorsResponse.php delete mode 100644 BinaryAuthorization/src/V1beta1/PkixPublicKey.php delete mode 100644 BinaryAuthorization/src/V1beta1/PkixPublicKey/SignatureAlgorithm.php delete mode 100644 BinaryAuthorization/src/V1beta1/PkixPublicKey_SignatureAlgorithm.php delete mode 100644 BinaryAuthorization/src/V1beta1/Policy.php delete mode 100644 BinaryAuthorization/src/V1beta1/Policy/GlobalPolicyEvaluationMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/Policy_GlobalPolicyEvaluationMode.php delete mode 100644 BinaryAuthorization/src/V1beta1/SystemPolicyV1Beta1Client.php delete mode 100644 BinaryAuthorization/src/V1beta1/SystemPolicyV1Beta1GrpcClient.php delete mode 100644 BinaryAuthorization/src/V1beta1/UpdateAttestorRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/UpdatePolicyRequest.php delete mode 100644 BinaryAuthorization/src/V1beta1/UserOwnedDrydockNote.php delete mode 100644 BinaryAuthorization/src/V1beta1/gapic_metadata.json delete mode 100644 BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_client_config.json delete mode 100644 BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_descriptor_config.php delete mode 100644 BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_rest_client_config.php delete mode 100644 BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_client_config.json delete mode 100644 BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_descriptor_config.php delete mode 100644 BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_rest_client_config.php delete mode 100644 BinaryAuthorization/tests/Unit/V1beta1/BinauthzManagementServiceV1Beta1ClientTest.php delete mode 100644 BinaryAuthorization/tests/Unit/V1beta1/SystemPolicyV1Beta1ClientTest.php diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index b6647af51d98..d4d681eaca8a 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -334,7 +334,7 @@ "BinaryAuthorization": { "language": "php", "distribution_name": "google/cloud-binary-authorization", - "release_level": "preview", + "release_level": "stable", "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-binary-authorization/latest", "library_type": "GAPIC_AUTO", "api_shortname": "binaryauthorization" diff --git a/BinaryAuthorization/.OwlBot.yaml b/BinaryAuthorization/.OwlBot.yaml index 1f0a56870827..7b11f6cdb06c 100644 --- a/BinaryAuthorization/.OwlBot.yaml +++ b/BinaryAuthorization/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/binaryauthorization/(v1|v1beta1)/.*-php/(.*) + - source: /google/cloud/binaryauthorization/(v1)/.*-php/(.*) dest: /owl-bot-staging/BinaryAuthorization/$1/$2 api-name: BinaryAuthorization diff --git a/BinaryAuthorization/README.md b/BinaryAuthorization/README.md index 3da954a9ddd9..8ec74bae2332 100644 --- a/BinaryAuthorization/README.md +++ b/BinaryAuthorization/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/BinaryAuthorization/owlbot.py b/BinaryAuthorization/owlbot.py index 1e6def5482ba..7f9c0ba5737a 100644 --- a/BinaryAuthorization/owlbot.py +++ b/BinaryAuthorization/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,34 +32,25 @@ php.owlbot_main(src=src, dest=dest) -# Change the wording for the deprecation warning. +# remove class_alias code s.replace( - 'src/*/*_*.php', - r'will be removed in the next major release', - 'will be removed in a future release') - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/BinaryAuthorization/src/V1/AdmissionRule.php b/BinaryAuthorization/src/V1/AdmissionRule.php index e6e3caecd4f9..9b64fe946629 100644 --- a/BinaryAuthorization/src/V1/AdmissionRule.php +++ b/BinaryAuthorization/src/V1/AdmissionRule.php @@ -25,7 +25,7 @@ class AdmissionRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $evaluation_mode = 0; + protected $evaluation_mode = 0; /** * Optional. The resource names of the attestors that must attest to * a container image, in the format `projects/*/attestors/*`. Each @@ -43,7 +43,7 @@ class AdmissionRule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $enforcement_mode = 0; + protected $enforcement_mode = 0; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/AdmissionRule/EnforcementMode.php b/BinaryAuthorization/src/V1/AdmissionRule/EnforcementMode.php index 577a398fc23c..c31a2c7c0a6d 100644 --- a/BinaryAuthorization/src/V1/AdmissionRule/EnforcementMode.php +++ b/BinaryAuthorization/src/V1/AdmissionRule/EnforcementMode.php @@ -61,6 +61,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EnforcementMode::class, \Google\Cloud\BinaryAuthorization\V1\AdmissionRule_EnforcementMode::class); diff --git a/BinaryAuthorization/src/V1/AdmissionRule/EvaluationMode.php b/BinaryAuthorization/src/V1/AdmissionRule/EvaluationMode.php index 81cc9a636e88..737802146bf5 100644 --- a/BinaryAuthorization/src/V1/AdmissionRule/EvaluationMode.php +++ b/BinaryAuthorization/src/V1/AdmissionRule/EvaluationMode.php @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EvaluationMode::class, \Google\Cloud\BinaryAuthorization\V1\AdmissionRule_EvaluationMode::class); diff --git a/BinaryAuthorization/src/V1/AdmissionWhitelistPattern.php b/BinaryAuthorization/src/V1/AdmissionWhitelistPattern.php index 91fd429c2b03..7d0e33969045 100644 --- a/BinaryAuthorization/src/V1/AdmissionWhitelistPattern.php +++ b/BinaryAuthorization/src/V1/AdmissionWhitelistPattern.php @@ -24,7 +24,7 @@ class AdmissionWhitelistPattern extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name_pattern = 1; */ - private $name_pattern = ''; + protected $name_pattern = ''; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/Attestor.php b/BinaryAuthorization/src/V1/Attestor.php index 65b2704c97e5..823512f34ddc 100644 --- a/BinaryAuthorization/src/V1/Attestor.php +++ b/BinaryAuthorization/src/V1/Attestor.php @@ -23,20 +23,20 @@ class Attestor extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Optional. A descriptive comment. This field may be updated. * The field may be displayed in chooser dialogs. * * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Output only. Time when the attestor was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; protected $attestor_type; /** diff --git a/BinaryAuthorization/src/V1/AttestorPublicKey.php b/BinaryAuthorization/src/V1/AttestorPublicKey.php index 52c44140174b..e667ea8a3f9c 100644 --- a/BinaryAuthorization/src/V1/AttestorPublicKey.php +++ b/BinaryAuthorization/src/V1/AttestorPublicKey.php @@ -21,7 +21,7 @@ class AttestorPublicKey extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $comment = ''; + protected $comment = ''; /** * The ID of this public key. * Signatures verified by BinAuthz must include the ID of the public key that @@ -33,7 +33,7 @@ class AttestorPublicKey extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 2; */ - private $id = ''; + protected $id = ''; protected $public_key; /** diff --git a/BinaryAuthorization/src/V1/BinauthzManagementServiceV1GrpcClient.php b/BinaryAuthorization/src/V1/BinauthzManagementServiceV1GrpcClient.php deleted file mode 100644 index a03bef983328..000000000000 --- a/BinaryAuthorization/src/V1/BinauthzManagementServiceV1GrpcClient.php +++ /dev/null @@ -1,165 +0,0 @@ -_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetPolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1.Policy], and returns a copy of the - * new [policy][google.cloud.binaryauthorization.v1.Policy]. A policy is always updated as a whole, to avoid race - * conditions with concurrent policy enforcement (or management!) - * requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT - * if the request is malformed. - * @param \Google\Cloud\BinaryAuthorization\V1\UpdatePolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdatePolicy(\Google\Cloud\BinaryAuthorization\V1\UpdatePolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdatePolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Creates an [attestor][google.cloud.binaryauthorization.v1.Attestor], and returns a copy of the new - * [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the project does not exist, - * INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the - * [attestor][google.cloud.binaryauthorization.v1.Attestor] already exists. - * @param \Google\Cloud\BinaryAuthorization\V1\CreateAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateAttestor(\Google\Cloud\BinaryAuthorization\V1\CreateAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/CreateAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Gets an [attestor][google.cloud.binaryauthorization.v1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1\GetAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetAttestor(\Google\Cloud\BinaryAuthorization\V1\GetAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Updates an [attestor][google.cloud.binaryauthorization.v1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1\UpdateAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateAttestor(\Google\Cloud\BinaryAuthorization\V1\UpdateAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdateAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Lists [attestors][google.cloud.binaryauthorization.v1.Attestor]. - * Returns INVALID_ARGUMENT if the project does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1\ListAttestorsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListAttestors(\Google\Cloud\BinaryAuthorization\V1\ListAttestorsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/ListAttestors', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\ListAttestorsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes an [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the - * [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1\DeleteAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteAttestor(\Google\Cloud\BinaryAuthorization\V1\DeleteAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/DeleteAttestor', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/BinaryAuthorization/src/V1/Client/BinauthzManagementServiceV1Client.php b/BinaryAuthorization/src/V1/Client/BinauthzManagementServiceV1Client.php index 1d90e15c6f2a..cdc693cc4c4b 100644 --- a/BinaryAuthorization/src/V1/Client/BinauthzManagementServiceV1Client.php +++ b/BinaryAuthorization/src/V1/Client/BinauthzManagementServiceV1Client.php @@ -1,6 +1,6 @@ [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/binauthz_management_service_v1_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/binauthz_management_service_v1_rest_client_config.php', ], ], ]; diff --git a/BinaryAuthorization/src/V1/Client/SystemPolicyV1Client.php b/BinaryAuthorization/src/V1/Client/SystemPolicyV1Client.php index 72a928dd6e0f..00cb8a0fb7ce 100644 --- a/BinaryAuthorization/src/V1/Client/SystemPolicyV1Client.php +++ b/BinaryAuthorization/src/V1/Client/SystemPolicyV1Client.php @@ -1,6 +1,6 @@ startApiCall('ValidateAttestationOccurrence', $request, $callOptions)->wait(); } } diff --git a/BinaryAuthorization/src/V1/CreateAttestorRequest.php b/BinaryAuthorization/src/V1/CreateAttestorRequest.php index b1e152f2c0e5..60d6da8c9ebf 100644 --- a/BinaryAuthorization/src/V1/CreateAttestorRequest.php +++ b/BinaryAuthorization/src/V1/CreateAttestorRequest.php @@ -20,13 +20,13 @@ class CreateAttestorRequest 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 [attestors][google.cloud.binaryauthorization.v1.Attestor] ID. * * Generated from protobuf field string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $attestor_id = ''; + protected $attestor_id = ''; /** * Required. The initial [attestor][google.cloud.binaryauthorization.v1.Attestor] value. The service will * overwrite the [attestor name][google.cloud.binaryauthorization.v1.Attestor.name] field with the resource name, @@ -34,7 +34,7 @@ class CreateAttestorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $attestor = null; + protected $attestor = null; /** * @param string $parent Required. The parent of this [attestor][google.cloud.binaryauthorization.v1.Attestor]. Please see diff --git a/BinaryAuthorization/src/V1/DeleteAttestorRequest.php b/BinaryAuthorization/src/V1/DeleteAttestorRequest.php index 5ca51bdbdf3b..b0df352faa1d 100644 --- a/BinaryAuthorization/src/V1/DeleteAttestorRequest.php +++ b/BinaryAuthorization/src/V1/DeleteAttestorRequest.php @@ -21,7 +21,7 @@ class DeleteAttestorRequest 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 [attestors][google.cloud.binaryauthorization.v1.Attestor] to delete, in the format diff --git a/BinaryAuthorization/src/V1/GetAttestorRequest.php b/BinaryAuthorization/src/V1/GetAttestorRequest.php index 78b587a54fca..1eca782c6323 100644 --- a/BinaryAuthorization/src/V1/GetAttestorRequest.php +++ b/BinaryAuthorization/src/V1/GetAttestorRequest.php @@ -21,7 +21,7 @@ class GetAttestorRequest 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 [attestor][google.cloud.binaryauthorization.v1.Attestor] to retrieve, in the format diff --git a/BinaryAuthorization/src/V1/GetPolicyRequest.php b/BinaryAuthorization/src/V1/GetPolicyRequest.php index 1a9f15fa322f..be8fcb28d126 100644 --- a/BinaryAuthorization/src/V1/GetPolicyRequest.php +++ b/BinaryAuthorization/src/V1/GetPolicyRequest.php @@ -21,7 +21,7 @@ class GetPolicyRequest 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 resource name of the [policy][google.cloud.binaryauthorization.v1.Policy] to retrieve, diff --git a/BinaryAuthorization/src/V1/GetSystemPolicyRequest.php b/BinaryAuthorization/src/V1/GetSystemPolicyRequest.php index b55d89db71e5..6a2924097b64 100644 --- a/BinaryAuthorization/src/V1/GetSystemPolicyRequest.php +++ b/BinaryAuthorization/src/V1/GetSystemPolicyRequest.php @@ -21,7 +21,7 @@ class GetSystemPolicyRequest 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 resource name, in the format `locations/*/policy`. diff --git a/BinaryAuthorization/src/V1/ListAttestorsRequest.php b/BinaryAuthorization/src/V1/ListAttestorsRequest.php index ad1a0f910876..0ec66e3b59bb 100644 --- a/BinaryAuthorization/src/V1/ListAttestorsRequest.php +++ b/BinaryAuthorization/src/V1/ListAttestorsRequest.php @@ -21,14 +21,14 @@ class ListAttestorsRequest 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 = ''; /** * Requested page size. The server may return fewer results than requested. If * unspecified, the server will pick an appropriate default. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * A token identifying a page of results the server should return. Typically, * this is the value of [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1.ListAttestorsResponse.next_page_token] returned @@ -36,7 +36,7 @@ class ListAttestorsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The resource name of the project associated with the diff --git a/BinaryAuthorization/src/V1/ListAttestorsResponse.php b/BinaryAuthorization/src/V1/ListAttestorsResponse.php index ff8e3b0d18a7..190c546198a4 100644 --- a/BinaryAuthorization/src/V1/ListAttestorsResponse.php +++ b/BinaryAuthorization/src/V1/ListAttestorsResponse.php @@ -28,7 +28,7 @@ class ListAttestorsResponse 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/BinaryAuthorization/src/V1/PkixPublicKey.php b/BinaryAuthorization/src/V1/PkixPublicKey.php index 61a460c84bf2..47ab5f4c9428 100644 --- a/BinaryAuthorization/src/V1/PkixPublicKey.php +++ b/BinaryAuthorization/src/V1/PkixPublicKey.php @@ -24,7 +24,7 @@ class PkixPublicKey extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string public_key_pem = 1; */ - private $public_key_pem = ''; + protected $public_key_pem = ''; /** * The signature algorithm used to verify a message against a signature using * this key. @@ -34,7 +34,7 @@ class PkixPublicKey extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; */ - private $signature_algorithm = 0; + protected $signature_algorithm = 0; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/PkixPublicKey/SignatureAlgorithm.php b/BinaryAuthorization/src/V1/PkixPublicKey/SignatureAlgorithm.php index 9e645d939452..ba315daf9ec3 100644 --- a/BinaryAuthorization/src/V1/PkixPublicKey/SignatureAlgorithm.php +++ b/BinaryAuthorization/src/V1/PkixPublicKey/SignatureAlgorithm.php @@ -148,6 +148,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SignatureAlgorithm::class, \Google\Cloud\BinaryAuthorization\V1\PkixPublicKey_SignatureAlgorithm::class); diff --git a/BinaryAuthorization/src/V1/Policy.php b/BinaryAuthorization/src/V1/Policy.php index 1b8e1fd2ec45..c7d740cd0928 100644 --- a/BinaryAuthorization/src/V1/Policy.php +++ b/BinaryAuthorization/src/V1/Policy.php @@ -21,13 +21,13 @@ class Policy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $name = ''; + protected $name = ''; /** * Optional. A descriptive comment. * * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $description = ''; + protected $description = ''; /** * Optional. Controls the evaluation of a Google-maintained global admission * policy for common system-level images. Images not covered by the global @@ -36,7 +36,7 @@ class Policy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; */ - private $global_policy_evaluation_mode = 0; + protected $global_policy_evaluation_mode = 0; /** * Optional. Admission policy allowlisting. A matching admission request will * always be permitted. This feature is typically used to exclude Google or @@ -87,13 +87,13 @@ class Policy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $default_admission_rule = null; + protected $default_admission_rule = null; /** * Output only. Time when the policy was last updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/Policy/GlobalPolicyEvaluationMode.php b/BinaryAuthorization/src/V1/Policy/GlobalPolicyEvaluationMode.php index 5239abed7073..7b0089d49505 100644 --- a/BinaryAuthorization/src/V1/Policy/GlobalPolicyEvaluationMode.php +++ b/BinaryAuthorization/src/V1/Policy/GlobalPolicyEvaluationMode.php @@ -57,6 +57,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GlobalPolicyEvaluationMode::class, \Google\Cloud\BinaryAuthorization\V1\Policy_GlobalPolicyEvaluationMode::class); diff --git a/BinaryAuthorization/src/V1/SystemPolicyV1GrpcClient.php b/BinaryAuthorization/src/V1/SystemPolicyV1GrpcClient.php deleted file mode 100644 index 163b4269b9fc..000000000000 --- a/BinaryAuthorization/src/V1/SystemPolicyV1GrpcClient.php +++ /dev/null @@ -1,50 +0,0 @@ -_simpleRequest('/google.cloud.binaryauthorization.v1.SystemPolicyV1/GetSystemPolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\Policy', 'decode'], - $metadata, $options); - } - -} diff --git a/BinaryAuthorization/src/V1/UpdateAttestorRequest.php b/BinaryAuthorization/src/V1/UpdateAttestorRequest.php index 9184fac9800f..370dfb0587a8 100644 --- a/BinaryAuthorization/src/V1/UpdateAttestorRequest.php +++ b/BinaryAuthorization/src/V1/UpdateAttestorRequest.php @@ -22,7 +22,7 @@ class UpdateAttestorRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $attestor = null; + protected $attestor = null; /** * @param \Google\Cloud\BinaryAuthorization\V1\Attestor $attestor Required. The updated [attestor][google.cloud.binaryauthorization.v1.Attestor] value. The service will diff --git a/BinaryAuthorization/src/V1/UpdatePolicyRequest.php b/BinaryAuthorization/src/V1/UpdatePolicyRequest.php index 53df72dd97df..839ecddda32e 100644 --- a/BinaryAuthorization/src/V1/UpdatePolicyRequest.php +++ b/BinaryAuthorization/src/V1/UpdatePolicyRequest.php @@ -22,7 +22,7 @@ class UpdatePolicyRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.binaryauthorization.v1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $policy = null; + protected $policy = null; /** * @param \Google\Cloud\BinaryAuthorization\V1\Policy $policy Required. A new or updated [policy][google.cloud.binaryauthorization.v1.Policy] value. The service will diff --git a/BinaryAuthorization/src/V1/UserOwnedGrafeasNote.php b/BinaryAuthorization/src/V1/UserOwnedGrafeasNote.php index ee5382aa9117..13b690e61359 100644 --- a/BinaryAuthorization/src/V1/UserOwnedGrafeasNote.php +++ b/BinaryAuthorization/src/V1/UserOwnedGrafeasNote.php @@ -26,7 +26,7 @@ class UserOwnedGrafeasNote extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $note_reference = ''; + protected $note_reference = ''; /** * Optional. Public keys that verify attestations signed by this * attestor. This field may be updated. @@ -51,7 +51,7 @@ class UserOwnedGrafeasNote extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $delegation_service_account_email = ''; + protected $delegation_service_account_email = ''; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceRequest.php b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceRequest.php index 4d6ac93e53b4..5f9e80630122 100644 --- a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceRequest.php +++ b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceRequest.php @@ -23,7 +23,7 @@ class ValidateAttestationOccurrenceRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field string attestor = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $attestor = ''; + protected $attestor = ''; /** * Required. An [AttestationOccurrence][grafeas.v1.AttestationOccurrence] to * be checked that it can be verified by the Attestor. It does not have to be @@ -32,21 +32,21 @@ class ValidateAttestationOccurrenceRequest extends \Google\Protobuf\Internal\Mes * * Generated from protobuf field .grafeas.v1.AttestationOccurrence attestation = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $attestation = null; + protected $attestation = null; /** * Required. The resource name of the [Note][grafeas.v1.Note] to which the * containing [Occurrence][grafeas.v1.Occurrence] is associated. * * Generated from protobuf field string occurrence_note = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $occurrence_note = ''; + protected $occurrence_note = ''; /** * Required. The URI of the artifact (e.g. container image) that is the * subject of the containing [Occurrence][grafeas.v1.Occurrence]. * * Generated from protobuf field string occurrence_resource_uri = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $occurrence_resource_uri = ''; + protected $occurrence_resource_uri = ''; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse.php b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse.php index 55034a8bd8ec..e2ab9e3c1582 100644 --- a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse.php +++ b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse.php @@ -21,13 +21,13 @@ class ValidateAttestationOccurrenceResponse extends \Google\Protobuf\Internal\Me * * Generated from protobuf field .google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceResponse.Result result = 1; */ - private $result = 0; + protected $result = 0; /** * The reason for denial if the Attestation couldn't be validated. * * Generated from protobuf field string denial_reason = 2; */ - private $denial_reason = ''; + protected $denial_reason = ''; /** * Constructor. diff --git a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse/Result.php b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse/Result.php index d8e6ba122e86..f1e6c83601bb 100644 --- a/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse/Result.php +++ b/BinaryAuthorization/src/V1/ValidateAttestationOccurrenceResponse/Result.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Result::class, \Google\Cloud\BinaryAuthorization\V1\ValidateAttestationOccurrenceResponse_Result::class); diff --git a/BinaryAuthorization/src/V1/ValidationHelperV1GrpcClient.php b/BinaryAuthorization/src/V1/ValidationHelperV1GrpcClient.php deleted file mode 100644 index 24a2d1b80d65..000000000000 --- a/BinaryAuthorization/src/V1/ValidationHelperV1GrpcClient.php +++ /dev/null @@ -1,51 +0,0 @@ -_simpleRequest('/google.cloud.binaryauthorization.v1.ValidationHelperV1/ValidateAttestationOccurrence', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1\ValidateAttestationOccurrenceResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/BinaryAuthorization/src/V1beta1/AdmissionRule.php b/BinaryAuthorization/src/V1beta1/AdmissionRule.php deleted file mode 100644 index 9f6c3d5ae6cb..000000000000 --- a/BinaryAuthorization/src/V1beta1/AdmissionRule.php +++ /dev/null @@ -1,164 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.AdmissionRule - */ -class AdmissionRule extends \Google\Protobuf\Internal\Message -{ - /** - * Required. How this admission rule will be evaluated. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $evaluation_mode = 0; - /** - * Optional. The resource names of the attestors that must attest to - * a container image, in the format `projects/*/attestors/*`. Each - * attestor must exist before a policy can reference it. To add an attestor - * to a policy the principal issuing the policy change request must be able - * to read the attestor resource. - * Note: this field must be non-empty when the evaluation_mode field specifies - * REQUIRE_ATTESTATION, otherwise it must be empty. - * - * Generated from protobuf field repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $require_attestations_by; - /** - * Required. The action when a pod creation is denied by the admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $enforcement_mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $evaluation_mode - * Required. How this admission rule will be evaluated. - * @type array|\Google\Protobuf\Internal\RepeatedField $require_attestations_by - * Optional. The resource names of the attestors that must attest to - * a container image, in the format `projects/*/attestors/*`. Each - * attestor must exist before a policy can reference it. To add an attestor - * to a policy the principal issuing the policy change request must be able - * to read the attestor resource. - * Note: this field must be non-empty when the evaluation_mode field specifies - * REQUIRE_ATTESTATION, otherwise it must be empty. - * @type int $enforcement_mode - * Required. The action when a pod creation is denied by the admission rule. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. How this admission rule will be evaluated. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getEvaluationMode() - { - return $this->evaluation_mode; - } - - /** - * Required. How this admission rule will be evaluated. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setEvaluationMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule\EvaluationMode::class); - $this->evaluation_mode = $var; - - return $this; - } - - /** - * Optional. The resource names of the attestors that must attest to - * a container image, in the format `projects/*/attestors/*`. Each - * attestor must exist before a policy can reference it. To add an attestor - * to a policy the principal issuing the policy change request must be able - * to read the attestor resource. - * Note: this field must be non-empty when the evaluation_mode field specifies - * REQUIRE_ATTESTATION, otherwise it must be empty. - * - * Generated from protobuf field repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRequireAttestationsBy() - { - return $this->require_attestations_by; - } - - /** - * Optional. The resource names of the attestors that must attest to - * a container image, in the format `projects/*/attestors/*`. Each - * attestor must exist before a policy can reference it. To add an attestor - * to a policy the principal issuing the policy change request must be able - * to read the attestor resource. - * Note: this field must be non-empty when the evaluation_mode field specifies - * REQUIRE_ATTESTATION, otherwise it must be empty. - * - * Generated from protobuf field repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRequireAttestationsBy($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->require_attestations_by = $arr; - - return $this; - } - - /** - * Required. The action when a pod creation is denied by the admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getEnforcementMode() - { - return $this->enforcement_mode; - } - - /** - * Required. The action when a pod creation is denied by the admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setEnforcementMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule\EnforcementMode::class); - $this->enforcement_mode = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/AdmissionRule/EnforcementMode.php b/BinaryAuthorization/src/V1beta1/AdmissionRule/EnforcementMode.php deleted file mode 100644 index fea0acc3f238..000000000000 --- a/BinaryAuthorization/src/V1beta1/AdmissionRule/EnforcementMode.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode - */ -class EnforcementMode -{ - /** - * Do not use. - * - * Generated from protobuf enum ENFORCEMENT_MODE_UNSPECIFIED = 0; - */ - const ENFORCEMENT_MODE_UNSPECIFIED = 0; - /** - * Enforce the admission rule by blocking the pod creation. - * - * Generated from protobuf enum ENFORCED_BLOCK_AND_AUDIT_LOG = 1; - */ - const ENFORCED_BLOCK_AND_AUDIT_LOG = 1; - /** - * Dryrun mode: Audit logging only. This will allow the pod creation as if - * the admission request had specified break-glass. - * - * Generated from protobuf enum DRYRUN_AUDIT_LOG_ONLY = 2; - */ - const DRYRUN_AUDIT_LOG_ONLY = 2; - - private static $valueToName = [ - self::ENFORCEMENT_MODE_UNSPECIFIED => 'ENFORCEMENT_MODE_UNSPECIFIED', - self::ENFORCED_BLOCK_AND_AUDIT_LOG => 'ENFORCED_BLOCK_AND_AUDIT_LOG', - self::DRYRUN_AUDIT_LOG_ONLY => 'DRYRUN_AUDIT_LOG_ONLY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EnforcementMode::class, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule_EnforcementMode::class); - diff --git a/BinaryAuthorization/src/V1beta1/AdmissionRule/EvaluationMode.php b/BinaryAuthorization/src/V1beta1/AdmissionRule/EvaluationMode.php deleted file mode 100644 index 1b585c0c332a..000000000000 --- a/BinaryAuthorization/src/V1beta1/AdmissionRule/EvaluationMode.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode - */ -class EvaluationMode -{ - /** - * Do not use. - * - * Generated from protobuf enum EVALUATION_MODE_UNSPECIFIED = 0; - */ - const EVALUATION_MODE_UNSPECIFIED = 0; - /** - * This rule allows all all pod creations. - * - * Generated from protobuf enum ALWAYS_ALLOW = 1; - */ - const ALWAYS_ALLOW = 1; - /** - * This rule allows a pod creation if all the attestors listed in - * `require_attestations_by` have valid attestations for all of the - * images in the pod spec. - * - * Generated from protobuf enum REQUIRE_ATTESTATION = 2; - */ - const REQUIRE_ATTESTATION = 2; - /** - * This rule denies all pod creations. - * - * Generated from protobuf enum ALWAYS_DENY = 3; - */ - const ALWAYS_DENY = 3; - - private static $valueToName = [ - self::EVALUATION_MODE_UNSPECIFIED => 'EVALUATION_MODE_UNSPECIFIED', - self::ALWAYS_ALLOW => 'ALWAYS_ALLOW', - self::REQUIRE_ATTESTATION => 'REQUIRE_ATTESTATION', - self::ALWAYS_DENY => 'ALWAYS_DENY', - ]; - - 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(EvaluationMode::class, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule_EvaluationMode::class); - diff --git a/BinaryAuthorization/src/V1beta1/AdmissionRule_EnforcementMode.php b/BinaryAuthorization/src/V1beta1/AdmissionRule_EnforcementMode.php deleted file mode 100644 index 29eb7262eaff..000000000000 --- a/BinaryAuthorization/src/V1beta1/AdmissionRule_EnforcementMode.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern - */ -class AdmissionWhitelistPattern extends \Google\Protobuf\Internal\Message -{ - /** - * An image name pattern to allowlist, in the form `registry/path/to/image`. - * This supports a trailing `*` as a wildcard, but this is allowed only in - * text after the `registry/` part. `*` wildcard does not match `/`, i.e., - * `gcr.io/nginx*` matches `gcr.io/nginx@latest`, but it does not match - * `gcr.io/nginx/image`. This also supports a trailing `**` wildcard which - * matches subdirectories, i.e., `gcr.io/nginx**` matches - * `gcr.io/nginx/image`. - * - * Generated from protobuf field string name_pattern = 1; - */ - private $name_pattern = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name_pattern - * An image name pattern to allowlist, in the form `registry/path/to/image`. - * This supports a trailing `*` as a wildcard, but this is allowed only in - * text after the `registry/` part. `*` wildcard does not match `/`, i.e., - * `gcr.io/nginx*` matches `gcr.io/nginx@latest`, but it does not match - * `gcr.io/nginx/image`. This also supports a trailing `**` wildcard which - * matches subdirectories, i.e., `gcr.io/nginx**` matches - * `gcr.io/nginx/image`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * An image name pattern to allowlist, in the form `registry/path/to/image`. - * This supports a trailing `*` as a wildcard, but this is allowed only in - * text after the `registry/` part. `*` wildcard does not match `/`, i.e., - * `gcr.io/nginx*` matches `gcr.io/nginx@latest`, but it does not match - * `gcr.io/nginx/image`. This also supports a trailing `**` wildcard which - * matches subdirectories, i.e., `gcr.io/nginx**` matches - * `gcr.io/nginx/image`. - * - * Generated from protobuf field string name_pattern = 1; - * @return string - */ - public function getNamePattern() - { - return $this->name_pattern; - } - - /** - * An image name pattern to allowlist, in the form `registry/path/to/image`. - * This supports a trailing `*` as a wildcard, but this is allowed only in - * text after the `registry/` part. `*` wildcard does not match `/`, i.e., - * `gcr.io/nginx*` matches `gcr.io/nginx@latest`, but it does not match - * `gcr.io/nginx/image`. This also supports a trailing `**` wildcard which - * matches subdirectories, i.e., `gcr.io/nginx**` matches - * `gcr.io/nginx/image`. - * - * Generated from protobuf field string name_pattern = 1; - * @param string $var - * @return $this - */ - public function setNamePattern($var) - { - GPBUtil::checkString($var, True); - $this->name_pattern = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/Attestor.php b/BinaryAuthorization/src/V1beta1/Attestor.php deleted file mode 100644 index fe72b883c8ea..000000000000 --- a/BinaryAuthorization/src/V1beta1/Attestor.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.Attestor - */ -class Attestor extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name, in the format: - * `projects/*/attestors/*`. This field may not be updated. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - /** - * Optional. A descriptive comment. This field may be updated. - * The field may be displayed in chooser dialogs. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $description = ''; - /** - * Output only. Time when the attestor was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - protected $attestor_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name, in the format: - * `projects/*/attestors/*`. This field may not be updated. - * @type string $description - * Optional. A descriptive comment. This field may be updated. - * The field may be displayed in chooser dialogs. - * @type \Google\Cloud\BinaryAuthorization\V1beta1\UserOwnedDrydockNote $user_owned_drydock_note - * A Drydock ATTESTATION_AUTHORITY Note, created by the user. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Time when the attestor was last updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name, in the format: - * `projects/*/attestors/*`. This field may not be updated. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name, in the format: - * `projects/*/attestors/*`. This field may not be updated. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A descriptive comment. This field may be updated. - * The field may be displayed in chooser dialogs. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. A descriptive comment. This field may be updated. - * The field may be displayed in chooser dialogs. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * A Drydock ATTESTATION_AUTHORITY Note, created by the user. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\UserOwnedDrydockNote|null - */ - public function getUserOwnedDrydockNote() - { - return $this->readOneof(3); - } - - public function hasUserOwnedDrydockNote() - { - return $this->hasOneof(3); - } - - /** - * A Drydock ATTESTATION_AUTHORITY Note, created by the user. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote user_owned_drydock_note = 3; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\UserOwnedDrydockNote $var - * @return $this - */ - public function setUserOwnedDrydockNote($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\UserOwnedDrydockNote::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Output only. Time when the attestor was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. Time when the attestor was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * @return string - */ - public function getAttestorType() - { - return $this->whichOneof("attestor_type"); - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/AttestorPublicKey.php b/BinaryAuthorization/src/V1beta1/AttestorPublicKey.php deleted file mode 100644 index c1f753e8348e..000000000000 --- a/BinaryAuthorization/src/V1beta1/AttestorPublicKey.php +++ /dev/null @@ -1,234 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.AttestorPublicKey - */ -class AttestorPublicKey extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. A descriptive comment. This field may be updated. - * - * Generated from protobuf field string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $comment = ''; - /** - * The ID of this public key. - * Signatures verified by BinAuthz must include the ID of the public key that - * can be used to verify them, and that ID must match the contents of this - * field exactly. - * Additional restrictions on this field can be imposed based on which public - * key type is encapsulated. See the documentation on `public_key` cases below - * for details. - * - * Generated from protobuf field string id = 2; - */ - private $id = ''; - protected $public_key; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $comment - * Optional. A descriptive comment. This field may be updated. - * @type string $id - * The ID of this public key. - * Signatures verified by BinAuthz must include the ID of the public key that - * can be used to verify them, and that ID must match the contents of this - * field exactly. - * Additional restrictions on this field can be imposed based on which public - * key type is encapsulated. See the documentation on `public_key` cases below - * for details. - * @type string $ascii_armored_pgp_public_key - * ASCII-armored representation of a PGP public key, as the entire output by - * the command `gpg --export --armor foo@example.com` (either LF or CRLF - * line endings). - * When using this field, `id` should be left blank. The BinAuthz API - * handlers will calculate the ID and fill it in automatically. BinAuthz - * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as - * upper-case hex. If `id` is provided by the caller, it will be - * overwritten by the API-calculated ID. - * @type \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey $pkix_public_key - * A raw PKIX SubjectPublicKeyInfo format public key. - * NOTE: `id` may be explicitly provided by the caller when using this - * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left - * blank, a default one will be computed based on the digest of the DER - * encoding of the public key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Optional. A descriptive comment. This field may be updated. - * - * Generated from protobuf field string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getComment() - { - return $this->comment; - } - - /** - * Optional. A descriptive comment. This field may be updated. - * - * Generated from protobuf field string comment = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setComment($var) - { - GPBUtil::checkString($var, True); - $this->comment = $var; - - return $this; - } - - /** - * The ID of this public key. - * Signatures verified by BinAuthz must include the ID of the public key that - * can be used to verify them, and that ID must match the contents of this - * field exactly. - * Additional restrictions on this field can be imposed based on which public - * key type is encapsulated. See the documentation on `public_key` cases below - * for details. - * - * Generated from protobuf field string id = 2; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The ID of this public key. - * Signatures verified by BinAuthz must include the ID of the public key that - * can be used to verify them, and that ID must match the contents of this - * field exactly. - * Additional restrictions on this field can be imposed based on which public - * key type is encapsulated. See the documentation on `public_key` cases below - * for details. - * - * Generated from protobuf field string id = 2; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * ASCII-armored representation of a PGP public key, as the entire output by - * the command `gpg --export --armor foo@example.com` (either LF or CRLF - * line endings). - * When using this field, `id` should be left blank. The BinAuthz API - * handlers will calculate the ID and fill it in automatically. BinAuthz - * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as - * upper-case hex. If `id` is provided by the caller, it will be - * overwritten by the API-calculated ID. - * - * Generated from protobuf field string ascii_armored_pgp_public_key = 3; - * @return string - */ - public function getAsciiArmoredPgpPublicKey() - { - return $this->readOneof(3); - } - - public function hasAsciiArmoredPgpPublicKey() - { - return $this->hasOneof(3); - } - - /** - * ASCII-armored representation of a PGP public key, as the entire output by - * the command `gpg --export --armor foo@example.com` (either LF or CRLF - * line endings). - * When using this field, `id` should be left blank. The BinAuthz API - * handlers will calculate the ID and fill it in automatically. BinAuthz - * computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as - * upper-case hex. If `id` is provided by the caller, it will be - * overwritten by the API-calculated ID. - * - * Generated from protobuf field string ascii_armored_pgp_public_key = 3; - * @param string $var - * @return $this - */ - public function setAsciiArmoredPgpPublicKey($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * A raw PKIX SubjectPublicKeyInfo format public key. - * NOTE: `id` may be explicitly provided by the caller when using this - * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left - * blank, a default one will be computed based on the digest of the DER - * encoding of the public key. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey|null - */ - public function getPkixPublicKey() - { - return $this->readOneof(5); - } - - public function hasPkixPublicKey() - { - return $this->hasOneof(5); - } - - /** - * A raw PKIX SubjectPublicKeyInfo format public key. - * NOTE: `id` may be explicitly provided by the caller when using this - * type of public key, but it MUST be a valid RFC3986 URI. If `id` is left - * blank, a default one will be computed based on the digest of the DER - * encoding of the public key. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.PkixPublicKey pkix_public_key = 5; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey $var - * @return $this - */ - public function setPkixPublicKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getPublicKey() - { - return $this->whichOneof("public_key"); - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/BinauthzManagementServiceV1Beta1Client.php b/BinaryAuthorization/src/V1beta1/BinauthzManagementServiceV1Beta1Client.php deleted file mode 100644 index a3f0ddbd3567..000000000000 --- a/BinaryAuthorization/src/V1beta1/BinauthzManagementServiceV1Beta1Client.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetPolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and returns a copy of the - * new [policy][google.cloud.binaryauthorization.v1beta1.Policy]. A policy is always updated as a whole, to avoid race - * conditions with concurrent policy enforcement (or management!) - * requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT - * if the request is malformed. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\UpdatePolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdatePolicy(\Google\Cloud\BinaryAuthorization\V1beta1\UpdatePolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdatePolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of the new - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the project does not exist, - * INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already exists. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\CreateAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateAttestor(\Google\Cloud\BinaryAuthorization\V1beta1\CreateAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/CreateAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\GetAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetAttestor(\Google\Cloud\BinaryAuthorization\V1beta1\GetAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\UpdateAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateAttestor(\Google\Cloud\BinaryAuthorization\V1beta1\UpdateAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdateAttestor', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Attestor', 'decode'], - $metadata, $options); - } - - /** - * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns INVALID_ARGUMENT if the project does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\ListAttestorsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListAttestors(\Google\Cloud\BinaryAuthorization\V1beta1\ListAttestorsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/ListAttestors', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\ListAttestorsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * @param \Google\Cloud\BinaryAuthorization\V1beta1\DeleteAttestorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteAttestor(\Google\Cloud\BinaryAuthorization\V1beta1\DeleteAttestorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/DeleteAttestor', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent.php deleted file mode 100644 index 7361b19f9337..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent - */ -class ContinuousValidationEvent extends \Google\Protobuf\Internal\Message -{ - protected $event_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent $pod_event - * Pod event. - * @type \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ConfigErrorEvent $config_error_event - * Config error event. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * Pod event. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent|null - */ - public function getPodEvent() - { - return $this->readOneof(1); - } - - public function hasPodEvent() - { - return $this->hasOneof(1); - } - - /** - * Pod event. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent pod_event = 1; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent $var - * @return $this - */ - public function setPodEvent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Config error event. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ConfigErrorEvent config_error_event = 4; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ConfigErrorEvent|null - */ - public function getConfigErrorEvent() - { - return $this->readOneof(4); - } - - public function hasConfigErrorEvent() - { - return $this->hasOneof(4); - } - - /** - * Config error event. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ConfigErrorEvent config_error_event = 4; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ConfigErrorEvent $var - * @return $this - */ - public function setConfigErrorEvent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ConfigErrorEvent::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getEventType() - { - return $this->whichOneof("event_type"); - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ConfigErrorEvent.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ConfigErrorEvent.php deleted file mode 100644 index b66077cf4c6e..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ConfigErrorEvent.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ConfigErrorEvent - */ -class ConfigErrorEvent extends \Google\Protobuf\Internal\Message -{ - /** - * A description of the issue. - * - * Generated from protobuf field string description = 1; - */ - private $description = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $description - * A description of the issue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * A description of the issue. - * - * Generated from protobuf field string description = 1; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * A description of the issue. - * - * Generated from protobuf field string description = 1; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConfigErrorEvent::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ConfigErrorEvent::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent.php deleted file mode 100644 index c052b30161e5..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent.php +++ /dev/null @@ -1,294 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent - */ -class ContinuousValidationPodEvent extends \Google\Protobuf\Internal\Message -{ - /** - * The k8s namespace of the Pod. - * - * Generated from protobuf field string pod_namespace = 7; - */ - private $pod_namespace = ''; - /** - * The name of the Pod. - * - * Generated from protobuf field string pod = 1; - */ - private $pod = ''; - /** - * The name of the policy. - * - * Generated from protobuf field string policy_name = 8; - */ - private $policy_name = ''; - /** - * Deploy time of the Pod from k8s. - * - * Generated from protobuf field .google.protobuf.Timestamp deploy_time = 2; - */ - private $deploy_time = null; - /** - * Termination time of the Pod from k8s, or nothing if still running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - */ - private $end_time = null; - /** - * Auditing verdict for this Pod. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - */ - private $verdict = 0; - /** - * List of images with auditing details. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - */ - private $images; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $pod_namespace - * The k8s namespace of the Pod. - * @type string $pod - * The name of the Pod. - * @type string $policy_name - * The name of the policy. - * @type \Google\Protobuf\Timestamp $deploy_time - * Deploy time of the Pod from k8s. - * @type \Google\Protobuf\Timestamp $end_time - * Termination time of the Pod from k8s, or nothing if still running. - * @type int $verdict - * Auditing verdict for this Pod. - * @type array<\Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails>|\Google\Protobuf\Internal\RepeatedField $images - * List of images with auditing details. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * The k8s namespace of the Pod. - * - * Generated from protobuf field string pod_namespace = 7; - * @return string - */ - public function getPodNamespace() - { - return $this->pod_namespace; - } - - /** - * The k8s namespace of the Pod. - * - * Generated from protobuf field string pod_namespace = 7; - * @param string $var - * @return $this - */ - public function setPodNamespace($var) - { - GPBUtil::checkString($var, True); - $this->pod_namespace = $var; - - return $this; - } - - /** - * The name of the Pod. - * - * Generated from protobuf field string pod = 1; - * @return string - */ - public function getPod() - { - return $this->pod; - } - - /** - * The name of the Pod. - * - * Generated from protobuf field string pod = 1; - * @param string $var - * @return $this - */ - public function setPod($var) - { - GPBUtil::checkString($var, True); - $this->pod = $var; - - return $this; - } - - /** - * The name of the policy. - * - * Generated from protobuf field string policy_name = 8; - * @return string - */ - public function getPolicyName() - { - return $this->policy_name; - } - - /** - * The name of the policy. - * - * Generated from protobuf field string policy_name = 8; - * @param string $var - * @return $this - */ - public function setPolicyName($var) - { - GPBUtil::checkString($var, True); - $this->policy_name = $var; - - return $this; - } - - /** - * Deploy time of the Pod from k8s. - * - * Generated from protobuf field .google.protobuf.Timestamp deploy_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeployTime() - { - return $this->deploy_time; - } - - public function hasDeployTime() - { - return isset($this->deploy_time); - } - - public function clearDeployTime() - { - unset($this->deploy_time); - } - - /** - * Deploy time of the Pod from k8s. - * - * Generated from protobuf field .google.protobuf.Timestamp deploy_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeployTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->deploy_time = $var; - - return $this; - } - - /** - * Termination time of the Pod from k8s, or nothing if still running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Termination time of the Pod from k8s, or nothing if still running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Auditing verdict for this Pod. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * @return int - */ - public function getVerdict() - { - return $this->verdict; - } - - /** - * Auditing verdict for this Pod. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict verdict = 4; - * @param int $var - * @return $this - */ - public function setVerdict($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\PolicyConformanceVerdict::class); - $this->verdict = $var; - - return $this; - } - - /** - * List of images with auditing details. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getImages() - { - return $this->images; - } - - /** - * List of images with auditing details. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails images = 5; - * @param array<\Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails::class); - $this->images = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ContinuousValidationPodEvent::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails.php deleted file mode 100644 index cca70edc106e..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails.php +++ /dev/null @@ -1,240 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails - */ -class ImageDetails extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the image. - * - * Generated from protobuf field string image = 1; - */ - private $image = ''; - /** - * The name of the container. - * - * Generated from protobuf field string container_name = 5; - */ - private $container_name = ''; - /** - * The container type that this image belongs to. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.ContainerType container_type = 6; - */ - private $container_type = 0; - /** - * The result of the audit for this image. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - */ - private $result = 0; - /** - * Description of the above result. - * - * Generated from protobuf field string description = 3; - */ - private $description = ''; - /** - * List of check results. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult check_results = 4; - */ - private $check_results; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $image - * The name of the image. - * @type string $container_name - * The name of the container. - * @type int $container_type - * The container type that this image belongs to. - * @type int $result - * The result of the audit for this image. - * @type string $description - * Description of the above result. - * @type array<\Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult>|\Google\Protobuf\Internal\RepeatedField $check_results - * List of check results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * The name of the image. - * - * Generated from protobuf field string image = 1; - * @return string - */ - public function getImage() - { - return $this->image; - } - - /** - * The name of the image. - * - * Generated from protobuf field string image = 1; - * @param string $var - * @return $this - */ - public function setImage($var) - { - GPBUtil::checkString($var, True); - $this->image = $var; - - return $this; - } - - /** - * The name of the container. - * - * Generated from protobuf field string container_name = 5; - * @return string - */ - public function getContainerName() - { - return $this->container_name; - } - - /** - * The name of the container. - * - * Generated from protobuf field string container_name = 5; - * @param string $var - * @return $this - */ - public function setContainerName($var) - { - GPBUtil::checkString($var, True); - $this->container_name = $var; - - return $this; - } - - /** - * The container type that this image belongs to. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.ContainerType container_type = 6; - * @return int - */ - public function getContainerType() - { - return $this->container_type; - } - - /** - * The container type that this image belongs to. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.ContainerType container_type = 6; - * @param int $var - * @return $this - */ - public function setContainerType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\ContainerType::class); - $this->container_type = $var; - - return $this; - } - - /** - * The result of the audit for this image. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * @return int - */ - public function getResult() - { - return $this->result; - } - - /** - * The result of the audit for this image. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult result = 2; - * @param int $var - * @return $this - */ - public function setResult($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\AuditResult::class); - $this->result = $var; - - return $this; - } - - /** - * Description of the above result. - * - * Generated from protobuf field string description = 3; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Description of the above result. - * - * 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; - } - - /** - * List of check results. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult check_results = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCheckResults() - { - return $this->check_results; - } - - /** - * List of check results. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult check_results = 4; - * @param array<\Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCheckResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult::class); - $this->check_results = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ImageDetails::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/AuditResult.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/AuditResult.php deleted file mode 100644 index c87330832026..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/AuditResult.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult - */ -class AuditResult -{ - /** - * Unspecified result. This is an error. - * - * Generated from protobuf enum AUDIT_RESULT_UNSPECIFIED = 0; - */ - const AUDIT_RESULT_UNSPECIFIED = 0; - /** - * Image is allowed. - * - * Generated from protobuf enum ALLOW = 1; - */ - const ALLOW = 1; - /** - * Image is denied. - * - * Generated from protobuf enum DENY = 2; - */ - const DENY = 2; - - private static $valueToName = [ - self::AUDIT_RESULT_UNSPECIFIED => 'AUDIT_RESULT_UNSPECIFIED', - self::ALLOW => 'ALLOW', - self::DENY => 'DENY', - ]; - - 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(AuditResult::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_AuditResult::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult.php deleted file mode 100644 index c57aa6d6f897..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult.php +++ /dev/null @@ -1,316 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult - */ -class CheckResult extends \Google\Protobuf\Internal\Message -{ - /** - * The index of the check set. - * - * Generated from protobuf field string check_set_index = 1; - */ - private $check_set_index = ''; - /** - * The name of the check set. - * - * Generated from protobuf field string check_set_name = 2; - */ - private $check_set_name = ''; - /** - * The scope of the check set. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckSetScope check_set_scope = 3; - */ - private $check_set_scope = null; - /** - * The index of the check. - * - * Generated from protobuf field string check_index = 4; - */ - private $check_index = ''; - /** - * The name of the check. - * - * Generated from protobuf field string check_name = 5; - */ - private $check_name = ''; - /** - * The type of the check. - * - * Generated from protobuf field string check_type = 6; - */ - private $check_type = ''; - /** - * The verdict of this check. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckVerdict verdict = 7; - */ - private $verdict = 0; - /** - * User-friendly explanation of this check result. - * - * Generated from protobuf field string explanation = 8; - */ - private $explanation = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $check_set_index - * The index of the check set. - * @type string $check_set_name - * The name of the check set. - * @type \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult\CheckSetScope $check_set_scope - * The scope of the check set. - * @type string $check_index - * The index of the check. - * @type string $check_name - * The name of the check. - * @type string $check_type - * The type of the check. - * @type int $verdict - * The verdict of this check. - * @type string $explanation - * User-friendly explanation of this check result. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * The index of the check set. - * - * Generated from protobuf field string check_set_index = 1; - * @return string - */ - public function getCheckSetIndex() - { - return $this->check_set_index; - } - - /** - * The index of the check set. - * - * Generated from protobuf field string check_set_index = 1; - * @param string $var - * @return $this - */ - public function setCheckSetIndex($var) - { - GPBUtil::checkString($var, True); - $this->check_set_index = $var; - - return $this; - } - - /** - * The name of the check set. - * - * Generated from protobuf field string check_set_name = 2; - * @return string - */ - public function getCheckSetName() - { - return $this->check_set_name; - } - - /** - * The name of the check set. - * - * Generated from protobuf field string check_set_name = 2; - * @param string $var - * @return $this - */ - public function setCheckSetName($var) - { - GPBUtil::checkString($var, True); - $this->check_set_name = $var; - - return $this; - } - - /** - * The scope of the check set. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckSetScope check_set_scope = 3; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult\CheckSetScope|null - */ - public function getCheckSetScope() - { - return $this->check_set_scope; - } - - public function hasCheckSetScope() - { - return isset($this->check_set_scope); - } - - public function clearCheckSetScope() - { - unset($this->check_set_scope); - } - - /** - * The scope of the check set. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckSetScope check_set_scope = 3; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult\CheckSetScope $var - * @return $this - */ - public function setCheckSetScope($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult\CheckSetScope::class); - $this->check_set_scope = $var; - - return $this; - } - - /** - * The index of the check. - * - * Generated from protobuf field string check_index = 4; - * @return string - */ - public function getCheckIndex() - { - return $this->check_index; - } - - /** - * The index of the check. - * - * Generated from protobuf field string check_index = 4; - * @param string $var - * @return $this - */ - public function setCheckIndex($var) - { - GPBUtil::checkString($var, True); - $this->check_index = $var; - - return $this; - } - - /** - * The name of the check. - * - * Generated from protobuf field string check_name = 5; - * @return string - */ - public function getCheckName() - { - return $this->check_name; - } - - /** - * The name of the check. - * - * Generated from protobuf field string check_name = 5; - * @param string $var - * @return $this - */ - public function setCheckName($var) - { - GPBUtil::checkString($var, True); - $this->check_name = $var; - - return $this; - } - - /** - * The type of the check. - * - * Generated from protobuf field string check_type = 6; - * @return string - */ - public function getCheckType() - { - return $this->check_type; - } - - /** - * The type of the check. - * - * Generated from protobuf field string check_type = 6; - * @param string $var - * @return $this - */ - public function setCheckType($var) - { - GPBUtil::checkString($var, True); - $this->check_type = $var; - - return $this; - } - - /** - * The verdict of this check. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckVerdict verdict = 7; - * @return int - */ - public function getVerdict() - { - return $this->verdict; - } - - /** - * The verdict of this check. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckVerdict verdict = 7; - * @param int $var - * @return $this - */ - public function setVerdict($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent\ImageDetails\CheckResult\CheckVerdict::class); - $this->verdict = $var; - - return $this; - } - - /** - * User-friendly explanation of this check result. - * - * Generated from protobuf field string explanation = 8; - * @return string - */ - public function getExplanation() - { - return $this->explanation; - } - - /** - * User-friendly explanation of this check result. - * - * Generated from protobuf field string explanation = 8; - * @param string $var - * @return $this - */ - public function setExplanation($var) - { - GPBUtil::checkString($var, True); - $this->explanation = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CheckResult::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_CheckResult::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckSetScope.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckSetScope.php deleted file mode 100644 index abaf652bfbbf..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckSetScope.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckSetScope - */ -class CheckSetScope extends \Google\Protobuf\Internal\Message -{ - protected $scope; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kubernetes_service_account - * Matches a single Kubernetes service account, e.g. - * 'my-namespace:my-service-account'. - * `kubernetes_service_account` scope is always more specific than - * `kubernetes_namespace` scope for the same namespace. - * @type string $kubernetes_namespace - * Matches all Kubernetes service accounts in the provided - * namespace, unless a more specific `kubernetes_service_account` - * scope already matched. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * Matches a single Kubernetes service account, e.g. - * 'my-namespace:my-service-account'. - * `kubernetes_service_account` scope is always more specific than - * `kubernetes_namespace` scope for the same namespace. - * - * Generated from protobuf field string kubernetes_service_account = 1; - * @return string - */ - public function getKubernetesServiceAccount() - { - return $this->readOneof(1); - } - - public function hasKubernetesServiceAccount() - { - return $this->hasOneof(1); - } - - /** - * Matches a single Kubernetes service account, e.g. - * 'my-namespace:my-service-account'. - * `kubernetes_service_account` scope is always more specific than - * `kubernetes_namespace` scope for the same namespace. - * - * Generated from protobuf field string kubernetes_service_account = 1; - * @param string $var - * @return $this - */ - public function setKubernetesServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Matches all Kubernetes service accounts in the provided - * namespace, unless a more specific `kubernetes_service_account` - * scope already matched. - * - * Generated from protobuf field string kubernetes_namespace = 2; - * @return string - */ - public function getKubernetesNamespace() - { - return $this->readOneof(2); - } - - public function hasKubernetesNamespace() - { - return $this->hasOneof(2); - } - - /** - * Matches all Kubernetes service accounts in the provided - * namespace, unless a more specific `kubernetes_service_account` - * scope already matched. - * - * Generated from protobuf field string kubernetes_namespace = 2; - * @param string $var - * @return $this - */ - public function setKubernetesNamespace($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getScope() - { - return $this->whichOneof("scope"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CheckSetScope::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_CheckResult_CheckSetScope::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckVerdict.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckVerdict.php deleted file mode 100644 index d73e2891fac3..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/CheckResult/CheckVerdict.php +++ /dev/null @@ -1,58 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.CheckResult.CheckVerdict - */ -class CheckVerdict -{ - /** - * We should always have a verdict. This is an error. - * - * Generated from protobuf enum CHECK_VERDICT_UNSPECIFIED = 0; - */ - const CHECK_VERDICT_UNSPECIFIED = 0; - /** - * The check was successfully evaluated and the image did not satisfy - * the check. - * - * Generated from protobuf enum NON_CONFORMANT = 1; - */ - const NON_CONFORMANT = 1; - - private static $valueToName = [ - self::CHECK_VERDICT_UNSPECIFIED => 'CHECK_VERDICT_UNSPECIFIED', - self::NON_CONFORMANT => 'NON_CONFORMANT', - ]; - - 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(CheckVerdict::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_CheckResult_CheckVerdict::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/ContainerType.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/ContainerType.php deleted file mode 100644 index 09be48268bbd..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/ImageDetails/ContainerType.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.ContainerType - */ -class ContainerType -{ - /** - * The container type should always be specified. This is an error. - * - * Generated from protobuf enum CONTAINER_TYPE_UNSPECIFIED = 0; - */ - const CONTAINER_TYPE_UNSPECIFIED = 0; - /** - * A regular deployment. - * - * Generated from protobuf enum CONTAINER = 1; - */ - const CONTAINER = 1; - /** - * Init container defined as specified at - * https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ - * - * Generated from protobuf enum INIT_CONTAINER = 2; - */ - const INIT_CONTAINER = 2; - /** - * Ephemeral container defined as specified at - * https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/ - * - * Generated from protobuf enum EPHEMERAL_CONTAINER = 3; - */ - const EPHEMERAL_CONTAINER = 3; - - private static $valueToName = [ - self::CONTAINER_TYPE_UNSPECIFIED => 'CONTAINER_TYPE_UNSPECIFIED', - self::CONTAINER => 'CONTAINER', - self::INIT_CONTAINER => 'INIT_CONTAINER', - self::EPHEMERAL_CONTAINER => 'EPHEMERAL_CONTAINER', - ]; - - 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(ContainerType::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_ContainerType::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/PolicyConformanceVerdict.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/PolicyConformanceVerdict.php deleted file mode 100644 index 9bcad8735d3a..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/ContinuousValidationPodEvent/PolicyConformanceVerdict.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict - */ -class PolicyConformanceVerdict -{ - /** - * We should always have a verdict. This is an error. - * - * Generated from protobuf enum POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0; - */ - const POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0; - /** - * The pod violates the policy. - * - * Generated from protobuf enum VIOLATES_POLICY = 1; - */ - const VIOLATES_POLICY = 1; - - private static $valueToName = [ - self::POLICY_CONFORMANCE_VERDICT_UNSPECIFIED => 'POLICY_CONFORMANCE_VERDICT_UNSPECIFIED', - self::VIOLATES_POLICY => 'VIOLATES_POLICY', - ]; - - 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(PolicyConformanceVerdict::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_PolicyConformanceVerdict::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/UnsupportedPolicyEvent.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/UnsupportedPolicyEvent.php deleted file mode 100644 index 6db02f08ee10..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent/UnsupportedPolicyEvent.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent - */ -class UnsupportedPolicyEvent extends \Google\Protobuf\Internal\Message -{ - /** - * A description of the unsupported policy. - * - * Generated from protobuf field string description = 1; - */ - private $description = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $description - * A description of the unsupported policy. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\ContinuousValidationLogging::initOnce(); - parent::__construct($data); - } - - /** - * A description of the unsupported policy. - * - * Generated from protobuf field string description = 1; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * A description of the unsupported policy. - * - * Generated from protobuf field string description = 1; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UnsupportedPolicyEvent::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_UnsupportedPolicyEvent::class); - diff --git a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent.php b/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent.php deleted file mode 100644 index 06e14e09573b..000000000000 --- a/BinaryAuthorization/src/V1beta1/ContinuousValidationEvent_ContinuousValidationPodEvent.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest - */ -class CreateAttestorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent of this [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID. - * - * Generated from protobuf field string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $attestor_id = ''; - /** - * Required. The initial [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name, - * in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $attestor = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent of this [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * @type string $attestor_id - * Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID. - * @type \Google\Cloud\BinaryAuthorization\V1beta1\Attestor $attestor - * Required. The initial [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name, - * in the format `projects/*/attestors/*`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent of this [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * 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 parent of this [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID. - * - * Generated from protobuf field string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getAttestorId() - { - return $this->attestor_id; - } - - /** - * Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID. - * - * Generated from protobuf field string attestor_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setAttestorId($var) - { - GPBUtil::checkString($var, True); - $this->attestor_id = $var; - - return $this; - } - - /** - * Required. The initial [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name, - * in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Attestor|null - */ - public function getAttestor() - { - return $this->attestor; - } - - public function hasAttestor() - { - return isset($this->attestor); - } - - public function clearAttestor() - { - unset($this->attestor); - } - - /** - * Required. The initial [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name, - * in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\Attestor $var - * @return $this - */ - public function setAttestor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\Attestor::class); - $this->attestor = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/DeleteAttestorRequest.php b/BinaryAuthorization/src/V1beta1/DeleteAttestorRequest.php deleted file mode 100644 index cbdf6884d271..000000000000 --- a/BinaryAuthorization/src/V1beta1/DeleteAttestorRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest - */ -class DeleteAttestorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * - * 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 [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * - * 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 [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * - * 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/BinaryAuthorization/src/V1beta1/Gapic/BinauthzManagementServiceV1Beta1GapicClient.php b/BinaryAuthorization/src/V1beta1/Gapic/BinauthzManagementServiceV1Beta1GapicClient.php deleted file mode 100644 index 15eac26d62dd..000000000000 --- a/BinaryAuthorization/src/V1beta1/Gapic/BinauthzManagementServiceV1Beta1GapicClient.php +++ /dev/null @@ -1,744 +0,0 @@ -projectName('[PROJECT]'); - * $attestorId = 'attestor_id'; - * $attestor = new Attestor(); - * $response = $binauthzManagementServiceV1Beta1Client->createAttestor($formattedParent, $attestorId, $attestor); - * } finally { - * $binauthzManagementServiceV1Beta1Client->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 BinauthzManagementServiceV1Beta1GapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'binaryauthorization.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'binaryauthorization.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $attestorNameTemplate; - - private static $locationPolicyNameTemplate; - - private static $policyNameTemplate; - - private static $projectNameTemplate; - - private static $projectPolicyNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/binauthz_management_service_v1_beta1_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/binauthz_management_service_v1_beta1_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/binauthz_management_service_v1_beta1_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/binauthz_management_service_v1_beta1_rest_client_config.php', - ], - ], - ]; - } - - private static function getAttestorNameTemplate() - { - if (self::$attestorNameTemplate == null) { - self::$attestorNameTemplate = new PathTemplate('projects/{project}/attestors/{attestor}'); - } - - return self::$attestorNameTemplate; - } - - private static function getLocationPolicyNameTemplate() - { - if (self::$locationPolicyNameTemplate == null) { - self::$locationPolicyNameTemplate = new PathTemplate('locations/{location}/policy'); - } - - return self::$locationPolicyNameTemplate; - } - - private static function getPolicyNameTemplate() - { - if (self::$policyNameTemplate == null) { - self::$policyNameTemplate = new PathTemplate('projects/{project}/policy'); - } - - return self::$policyNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectPolicyNameTemplate() - { - if (self::$projectPolicyNameTemplate == null) { - self::$projectPolicyNameTemplate = new PathTemplate('projects/{project}/policy'); - } - - return self::$projectPolicyNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'attestor' => self::getAttestorNameTemplate(), - 'locationPolicy' => self::getLocationPolicyNameTemplate(), - 'policy' => self::getPolicyNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectPolicy' => self::getProjectPolicyNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a attestor - * resource. - * - * @param string $project - * @param string $attestor - * - * @return string The formatted attestor resource. - * - * @experimental - */ - public static function attestorName($project, $attestor) - { - return self::getAttestorNameTemplate()->render([ - 'project' => $project, - 'attestor' => $attestor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * location_policy resource. - * - * @param string $location - * - * @return string The formatted location_policy resource. - * - * @experimental - */ - public static function locationPolicyName($location) - { - return self::getLocationPolicyNameTemplate()->render([ - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a policy - * resource. - * - * @param string $project - * - * @return string The formatted policy resource. - * - * @experimental - */ - public static function policyName($project) - { - return self::getPolicyNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - * - * @experimental - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_policy resource. - * - * @param string $project - * - * @return string The formatted project_policy resource. - * - * @experimental - */ - public static function projectPolicyName($project) - { - return self::getProjectPolicyNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - attestor: projects/{project}/attestors/{attestor} - * - locationPolicy: locations/{location}/policy - * - policy: projects/{project}/policy - * - project: projects/{project} - * - projectPolicy: projects/{project}/policy - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'binaryauthorization.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); - } - - /** - * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of the new - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the project does not exist, - * INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] already exists. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $formattedParent = $binauthzManagementServiceV1Beta1Client->projectName('[PROJECT]'); - * $attestorId = 'attestor_id'; - * $attestor = new Attestor(); - * $response = $binauthzManagementServiceV1Beta1Client->createAttestor($formattedParent, $attestorId, $attestor); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param string $parent Required. The parent of this [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * @param string $attestorId Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] ID. - * @param Attestor $attestor Required. The initial [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name, - * in the format `projects/*/attestors/*`. - * @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\BinaryAuthorization\V1beta1\Attestor - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createAttestor($parent, $attestorId, $attestor, array $optionalArgs = []) - { - $request = new CreateAttestorRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setAttestorId($attestorId); - $request->setAttestor($attestor); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateAttestor', Attestor::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the - * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $formattedName = $binauthzManagementServiceV1Beta1Client->attestorName('[PROJECT]', '[ATTESTOR]'); - * $binauthzManagementServiceV1Beta1Client->deleteAttestor($formattedName); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param string $name Required. The name of the [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format - * `projects/*/attestors/*`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteAttestor($name, array $optionalArgs = []) - { - $request = new DeleteAttestorRequest(); - $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('DeleteAttestor', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $formattedName = $binauthzManagementServiceV1Beta1Client->attestorName('[PROJECT]', '[ATTESTOR]'); - * $response = $binauthzManagementServiceV1Beta1Client->getAttestor($formattedName); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param string $name Required. The name of the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * @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\BinaryAuthorization\V1beta1\Attestor - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getAttestor($name, array $optionalArgs = []) - { - $request = new GetAttestorRequest(); - $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('GetAttestor', Attestor::class, $optionalArgs, $request)->wait(); - } - - /** - * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] that must attest to - * a container image, before the project is allowed to deploy that - * image. There is at most one policy per project. All image admission - * requests are permitted if a project has no policy. - * - * Gets the [policy][google.cloud.binaryauthorization.v1beta1.Policy] for this project. Returns a default - * [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not have one. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $formattedName = $binauthzManagementServiceV1Beta1Client->policyName('[PROJECT]'); - * $response = $binauthzManagementServiceV1Beta1Client->getPolicy($formattedName); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, - * in the format `projects/*/policy`. - * @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\BinaryAuthorization\V1beta1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getPolicy($name, array $optionalArgs = []) - { - $request = new GetPolicyRequest(); - $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('GetPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns INVALID_ARGUMENT if the project does not exist. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $formattedParent = $binauthzManagementServiceV1Beta1Client->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $binauthzManagementServiceV1Beta1Client->listAttestors($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $binauthzManagementServiceV1Beta1Client->listAttestors($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format `projects/*`. - * @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 listAttestors($parent, array $optionalArgs = []) - { - $request = new ListAttestorsRequest(); - $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('ListAttestors', $optionalArgs, ListAttestorsResponse::class, $request); - } - - /** - * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. - * Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $attestor = new Attestor(); - * $response = $binauthzManagementServiceV1Beta1Client->updateAttestor($attestor); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param Attestor $attestor Required. The updated [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name - * in the request URL, in the format `projects/*/attestors/*`. - * @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\BinaryAuthorization\V1beta1\Attestor - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateAttestor($attestor, array $optionalArgs = []) - { - $request = new UpdateAttestorRequest(); - $requestParamHeaders = []; - $request->setAttestor($attestor); - $requestParamHeaders['attestor.name'] = $attestor->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateAttestor', Attestor::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and returns a copy of the - * new [policy][google.cloud.binaryauthorization.v1beta1.Policy]. A policy is always updated as a whole, to avoid race - * conditions with concurrent policy enforcement (or management!) - * requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT - * if the request is malformed. - * - * Sample code: - * ``` - * $binauthzManagementServiceV1Beta1Client = new BinauthzManagementServiceV1Beta1Client(); - * try { - * $policy = new Policy(); - * $response = $binauthzManagementServiceV1Beta1Client->updatePolicy($policy); - * } finally { - * $binauthzManagementServiceV1Beta1Client->close(); - * } - * ``` - * - * @param Policy $policy Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will - * overwrite the [policy name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the resource name in - * the request URL, in the format `projects/*/policy`. - * @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\BinaryAuthorization\V1beta1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updatePolicy($policy, array $optionalArgs = []) - { - $request = new UpdatePolicyRequest(); - $requestParamHeaders = []; - $request->setPolicy($policy); - $requestParamHeaders['policy.name'] = $policy->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdatePolicy', Policy::class, $optionalArgs, $request)->wait(); - } -} diff --git a/BinaryAuthorization/src/V1beta1/Gapic/SystemPolicyV1Beta1GapicClient.php b/BinaryAuthorization/src/V1beta1/Gapic/SystemPolicyV1Beta1GapicClient.php deleted file mode 100644 index 05e5ee6f3739..000000000000 --- a/BinaryAuthorization/src/V1beta1/Gapic/SystemPolicyV1Beta1GapicClient.php +++ /dev/null @@ -1,360 +0,0 @@ -policyName('[PROJECT]'); - * $response = $systemPolicyV1Beta1Client->getSystemPolicy($formattedName); - * } finally { - * $systemPolicyV1Beta1Client->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 SystemPolicyV1Beta1GapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'binaryauthorization.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'binaryauthorization.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $locationPolicyNameTemplate; - - private static $policyNameTemplate; - - private static $projectPolicyNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/system_policy_v1_beta1_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/system_policy_v1_beta1_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/system_policy_v1_beta1_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/system_policy_v1_beta1_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationPolicyNameTemplate() - { - if (self::$locationPolicyNameTemplate == null) { - self::$locationPolicyNameTemplate = new PathTemplate('locations/{location}/policy'); - } - - return self::$locationPolicyNameTemplate; - } - - private static function getPolicyNameTemplate() - { - if (self::$policyNameTemplate == null) { - self::$policyNameTemplate = new PathTemplate('projects/{project}/policy'); - } - - return self::$policyNameTemplate; - } - - private static function getProjectPolicyNameTemplate() - { - if (self::$projectPolicyNameTemplate == null) { - self::$projectPolicyNameTemplate = new PathTemplate('projects/{project}/policy'); - } - - return self::$projectPolicyNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'locationPolicy' => self::getLocationPolicyNameTemplate(), - 'policy' => self::getPolicyNameTemplate(), - 'projectPolicy' => self::getProjectPolicyNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * location_policy resource. - * - * @param string $location - * - * @return string The formatted location_policy resource. - * - * @experimental - */ - public static function locationPolicyName($location) - { - return self::getLocationPolicyNameTemplate()->render([ - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a policy - * resource. - * - * @param string $project - * - * @return string The formatted policy resource. - * - * @experimental - */ - public static function policyName($project) - { - return self::getPolicyNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_policy resource. - * - * @param string $project - * - * @return string The formatted project_policy resource. - * - * @experimental - */ - public static function projectPolicyName($project) - { - return self::getProjectPolicyNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - locationPolicy: locations/{location}/policy - * - policy: projects/{project}/policy - * - projectPolicy: projects/{project}/policy - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'binaryauthorization.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); - } - - /** - * Gets the current system policy in the specified location. - * - * Sample code: - * ``` - * $systemPolicyV1Beta1Client = new SystemPolicyV1Beta1Client(); - * try { - * $formattedName = $systemPolicyV1Beta1Client->policyName('[PROJECT]'); - * $response = $systemPolicyV1Beta1Client->getSystemPolicy($formattedName); - * } finally { - * $systemPolicyV1Beta1Client->close(); - * } - * ``` - * - * @param string $name Required. The resource name, in the format `locations/*/policy`. - * Note that the system policy is not associated with a project. - * @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\BinaryAuthorization\V1beta1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getSystemPolicy($name, array $optionalArgs = []) - { - $request = new GetSystemPolicyRequest(); - $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('GetSystemPolicy', Policy::class, $optionalArgs, $request)->wait(); - } -} diff --git a/BinaryAuthorization/src/V1beta1/GetAttestorRequest.php b/BinaryAuthorization/src/V1beta1/GetAttestorRequest.php deleted file mode 100644 index a7c7d02e6983..000000000000 --- a/BinaryAuthorization/src/V1beta1/GetAttestorRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.GetAttestorRequest - */ -class GetAttestorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * - * 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 [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * - * 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 [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format - * `projects/*/attestors/*`. - * - * 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/BinaryAuthorization/src/V1beta1/GetPolicyRequest.php b/BinaryAuthorization/src/V1beta1/GetPolicyRequest.php deleted file mode 100644 index 8e81f9fc6e62..000000000000 --- a/BinaryAuthorization/src/V1beta1/GetPolicyRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.GetPolicyRequest - */ -class GetPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, - * in the format `projects/*/policy`. - * - * 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 resource name of the [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, - * in the format `projects/*/policy`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, - * in the format `projects/*/policy`. - * - * 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 resource name of the [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, - * in the format `projects/*/policy`. - * - * 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/BinaryAuthorization/src/V1beta1/GetSystemPolicyRequest.php b/BinaryAuthorization/src/V1beta1/GetSystemPolicyRequest.php deleted file mode 100644 index 66206a20df47..000000000000 --- a/BinaryAuthorization/src/V1beta1/GetSystemPolicyRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest - */ -class GetSystemPolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name, in the format `locations/*/policy`. - * Note that the system policy is not associated with a project. - * - * 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 resource name, in the format `locations/*/policy`. - * Note that the system policy is not associated with a project. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name, in the format `locations/*/policy`. - * Note that the system policy is not associated with a project. - * - * 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 resource name, in the format `locations/*/policy`. - * Note that the system policy is not associated with a project. - * - * 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/BinaryAuthorization/src/V1beta1/ListAttestorsRequest.php b/BinaryAuthorization/src/V1beta1/ListAttestorsRequest.php deleted file mode 100644 index 6c475f380eda..000000000000 --- a/BinaryAuthorization/src/V1beta1/ListAttestorsRequest.php +++ /dev/null @@ -1,151 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest - */ -class ListAttestorsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format `projects/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Requested page size. The server may return fewer results than requested. If - * unspecified, the server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * A token identifying a page of results the server should return. Typically, - * this is the value of [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token] returned - * from the previous call to the `ListAttestors` method. - * - * 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 resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format `projects/*`. - * @type int $page_size - * Requested page size. The server may return fewer results than requested. If - * unspecified, the server will pick an appropriate default. - * @type string $page_token - * A token identifying a page of results the server should return. Typically, - * this is the value of [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token] returned - * from the previous call to the `ListAttestors` method. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format `projects/*`. - * - * 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 resource name of the project associated with the - * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format `projects/*`. - * - * 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; - } - - /** - * Requested page size. The server may return fewer results than requested. If - * unspecified, the server will pick an appropriate default. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Requested page size. The server may return fewer results than requested. If - * unspecified, the server will pick an appropriate default. - * - * 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; - } - - /** - * A token identifying a page of results the server should return. Typically, - * this is the value of [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token] returned - * from the previous call to the `ListAttestors` method. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results the server should return. Typically, - * this is the value of [ListAttestorsResponse.next_page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse.next_page_token] returned - * from the previous call to the `ListAttestors` method. - * - * 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/BinaryAuthorization/src/V1beta1/ListAttestorsResponse.php b/BinaryAuthorization/src/V1beta1/ListAttestorsResponse.php deleted file mode 100644 index 0dc1f9f78a01..000000000000 --- a/BinaryAuthorization/src/V1beta1/ListAttestorsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse - */ -class ListAttestorsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - */ - private $attestors; - /** - * A token to retrieve the next page of results. Pass this value in the - * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token] field in the subsequent call to the - * `ListAttestors` method to retrieve the next page of results. - * - * 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\BinaryAuthorization\V1beta1\Attestor>|\Google\Protobuf\Internal\RepeatedField $attestors - * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * @type string $next_page_token - * A token to retrieve the next page of results. Pass this value in the - * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token] field in the subsequent call to the - * `ListAttestors` method to retrieve the next page of results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAttestors() - { - return $this->attestors; - } - - /** - * The list of [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.Attestor attestors = 1; - * @param array<\Google\Cloud\BinaryAuthorization\V1beta1\Attestor>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAttestors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\Attestor::class); - $this->attestors = $arr; - - return $this; - } - - /** - * A token to retrieve the next page of results. Pass this value in the - * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token] field in the subsequent call to the - * `ListAttestors` method to retrieve the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token to retrieve the next page of results. Pass this value in the - * [ListAttestorsRequest.page_token][google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest.page_token] field in the subsequent call to the - * `ListAttestors` method to retrieve the next page of results. - * - * 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/BinaryAuthorization/src/V1beta1/PkixPublicKey.php b/BinaryAuthorization/src/V1beta1/PkixPublicKey.php deleted file mode 100644 index b23c4ed1fb7c..000000000000 --- a/BinaryAuthorization/src/V1beta1/PkixPublicKey.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.PkixPublicKey - */ -class PkixPublicKey extends \Google\Protobuf\Internal\Message -{ - /** - * A PEM-encoded public key, as described in - * https://tools.ietf.org/html/rfc7468#section-13 - * - * Generated from protobuf field string public_key_pem = 1; - */ - private $public_key_pem = ''; - /** - * The signature algorithm used to verify a message against a signature using - * this key. - * These signature algorithm must match the structure and any object - * identifiers encoded in `public_key_pem` (i.e. this algorithm must match - * that of the public key). - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - */ - private $signature_algorithm = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $public_key_pem - * A PEM-encoded public key, as described in - * https://tools.ietf.org/html/rfc7468#section-13 - * @type int $signature_algorithm - * The signature algorithm used to verify a message against a signature using - * this key. - * These signature algorithm must match the structure and any object - * identifiers encoded in `public_key_pem` (i.e. this algorithm must match - * that of the public key). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * A PEM-encoded public key, as described in - * https://tools.ietf.org/html/rfc7468#section-13 - * - * Generated from protobuf field string public_key_pem = 1; - * @return string - */ - public function getPublicKeyPem() - { - return $this->public_key_pem; - } - - /** - * A PEM-encoded public key, as described in - * https://tools.ietf.org/html/rfc7468#section-13 - * - * Generated from protobuf field string public_key_pem = 1; - * @param string $var - * @return $this - */ - public function setPublicKeyPem($var) - { - GPBUtil::checkString($var, True); - $this->public_key_pem = $var; - - return $this; - } - - /** - * The signature algorithm used to verify a message against a signature using - * this key. - * These signature algorithm must match the structure and any object - * identifiers encoded in `public_key_pem` (i.e. this algorithm must match - * that of the public key). - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * @return int - */ - public function getSignatureAlgorithm() - { - return $this->signature_algorithm; - } - - /** - * The signature algorithm used to verify a message against a signature using - * this key. - * These signature algorithm must match the structure and any object - * identifiers encoded in `public_key_pem` (i.e. this algorithm must match - * that of the public key). - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm signature_algorithm = 2; - * @param int $var - * @return $this - */ - public function setSignatureAlgorithm($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey\SignatureAlgorithm::class); - $this->signature_algorithm = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/PkixPublicKey/SignatureAlgorithm.php b/BinaryAuthorization/src/V1beta1/PkixPublicKey/SignatureAlgorithm.php deleted file mode 100644 index a4456d1db983..000000000000 --- a/BinaryAuthorization/src/V1beta1/PkixPublicKey/SignatureAlgorithm.php +++ /dev/null @@ -1,153 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm - */ -class SignatureAlgorithm -{ - /** - * Not specified. - * - * Generated from protobuf enum SIGNATURE_ALGORITHM_UNSPECIFIED = 0; - */ - const SIGNATURE_ALGORITHM_UNSPECIFIED = 0; - /** - * RSASSA-PSS 2048 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_PSS_2048_SHA256 = 1; - */ - const RSA_PSS_2048_SHA256 = 1; - /** - * RSASSA-PSS 3072 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_PSS_3072_SHA256 = 2; - */ - const RSA_PSS_3072_SHA256 = 2; - /** - * RSASSA-PSS 4096 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_PSS_4096_SHA256 = 3; - */ - const RSA_PSS_4096_SHA256 = 3; - /** - * RSASSA-PSS 4096 bit key with a SHA512 digest. - * - * Generated from protobuf enum RSA_PSS_4096_SHA512 = 4; - */ - const RSA_PSS_4096_SHA512 = 4; - /** - * RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest. - * - * Generated from protobuf enum RSA_SIGN_PKCS1_2048_SHA256 = 5; - */ - const RSA_SIGN_PKCS1_2048_SHA256 = 5; - /** - * RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest. - * - * Generated from protobuf enum RSA_SIGN_PKCS1_3072_SHA256 = 6; - */ - const RSA_SIGN_PKCS1_3072_SHA256 = 6; - /** - * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest. - * - * Generated from protobuf enum RSA_SIGN_PKCS1_4096_SHA256 = 7; - */ - const RSA_SIGN_PKCS1_4096_SHA256 = 7; - /** - * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest. - * - * Generated from protobuf enum RSA_SIGN_PKCS1_4096_SHA512 = 8; - */ - const RSA_SIGN_PKCS1_4096_SHA512 = 8; - /** - * ECDSA on the NIST P-256 curve with a SHA256 digest. - * - * Generated from protobuf enum ECDSA_P256_SHA256 = 9; - */ - const ECDSA_P256_SHA256 = 9; - /** - * ECDSA on the NIST P-256 curve with a SHA256 digest. - * - * Generated from protobuf enum EC_SIGN_P256_SHA256 = 9; - */ - const EC_SIGN_P256_SHA256 = 9; - /** - * ECDSA on the NIST P-384 curve with a SHA384 digest. - * - * Generated from protobuf enum ECDSA_P384_SHA384 = 10; - */ - const ECDSA_P384_SHA384 = 10; - /** - * ECDSA on the NIST P-384 curve with a SHA384 digest. - * - * Generated from protobuf enum EC_SIGN_P384_SHA384 = 10; - */ - const EC_SIGN_P384_SHA384 = 10; - /** - * ECDSA on the NIST P-521 curve with a SHA512 digest. - * - * Generated from protobuf enum ECDSA_P521_SHA512 = 11; - */ - const ECDSA_P521_SHA512 = 11; - /** - * ECDSA on the NIST P-521 curve with a SHA512 digest. - * - * Generated from protobuf enum EC_SIGN_P521_SHA512 = 11; - */ - const EC_SIGN_P521_SHA512 = 11; - - private static $valueToName = [ - self::SIGNATURE_ALGORITHM_UNSPECIFIED => 'SIGNATURE_ALGORITHM_UNSPECIFIED', - self::RSA_PSS_2048_SHA256 => 'RSA_PSS_2048_SHA256', - self::RSA_PSS_3072_SHA256 => 'RSA_PSS_3072_SHA256', - self::RSA_PSS_4096_SHA256 => 'RSA_PSS_4096_SHA256', - self::RSA_PSS_4096_SHA512 => 'RSA_PSS_4096_SHA512', - self::RSA_SIGN_PKCS1_2048_SHA256 => 'RSA_SIGN_PKCS1_2048_SHA256', - self::RSA_SIGN_PKCS1_3072_SHA256 => 'RSA_SIGN_PKCS1_3072_SHA256', - self::RSA_SIGN_PKCS1_4096_SHA256 => 'RSA_SIGN_PKCS1_4096_SHA256', - self::RSA_SIGN_PKCS1_4096_SHA512 => 'RSA_SIGN_PKCS1_4096_SHA512', - self::ECDSA_P256_SHA256 => 'ECDSA_P256_SHA256', - self::EC_SIGN_P256_SHA256 => 'EC_SIGN_P256_SHA256', - self::ECDSA_P384_SHA384 => 'ECDSA_P384_SHA384', - self::EC_SIGN_P384_SHA384 => 'EC_SIGN_P384_SHA384', - self::ECDSA_P521_SHA512 => 'ECDSA_P521_SHA512', - self::EC_SIGN_P521_SHA512 => 'EC_SIGN_P521_SHA512', - ]; - - 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(SignatureAlgorithm::class, \Google\Cloud\BinaryAuthorization\V1beta1\PkixPublicKey_SignatureAlgorithm::class); - diff --git a/BinaryAuthorization/src/V1beta1/PkixPublicKey_SignatureAlgorithm.php b/BinaryAuthorization/src/V1beta1/PkixPublicKey_SignatureAlgorithm.php deleted file mode 100644 index 641df7f153d9..000000000000 --- a/BinaryAuthorization/src/V1beta1/PkixPublicKey_SignatureAlgorithm.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.Policy - */ -class Policy extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name, in the format `projects/*/policy`. There is - * at most one policy per project. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * Optional. A descriptive comment. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $description = ''; - /** - * Optional. Controls the evaluation of a Google-maintained global admission - * policy for common system-level images. Images not covered by the global - * policy will be subject to the project admission policy. This setting - * has no effect when specified inside a global admission policy. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $global_policy_evaluation_mode = 0; - /** - * Optional. Admission policy allowlisting. A matching admission request will - * always be permitted. This feature is typically used to exclude Google or - * third-party infrastructure images from Binary Authorization policies. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $admission_whitelist_patterns; - /** - * Optional. Per-cluster admission rules. Cluster spec format: - * `location.clusterId`. There can be at most one admission rule per cluster - * spec. - * A `location` is either a compute zone (e.g. us-central1-a) or a region - * (e.g. us-central1). - * For `clusterId` syntax restrictions see - * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters. - * - * Generated from protobuf field map cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $cluster_admission_rules; - /** - * Optional. Per-kubernetes-namespace admission rules. K8s namespace spec format: - * `[a-z.-]+`, e.g. `some-namespace` - * - * Generated from protobuf field map kubernetes_namespace_admission_rules = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $kubernetes_namespace_admission_rules; - /** - * Optional. Per-kubernetes-service-account admission rules. Service account - * spec format: `namespace:serviceaccount`. e.g. `test-ns:default` - * - * Generated from protobuf field map kubernetes_service_account_admission_rules = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $kubernetes_service_account_admission_rules; - /** - * Optional. Per-istio-service-identity admission rules. Istio service - * identity spec format: - * `spiffe:///ns//sa/` or - * `/ns//sa/` - * e.g. `spiffe://example.com/ns/test-ns/sa/default` - * - * Generated from protobuf field map istio_service_identity_admission_rules = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $istio_service_identity_admission_rules; - /** - * Required. Default admission rule for a cluster without a per-cluster, per- - * kubernetes-service-account, or per-istio-service-identity admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $default_admission_rule = null; - /** - * Output only. Time when the policy was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name, in the format `projects/*/policy`. There is - * at most one policy per project. - * @type string $description - * Optional. A descriptive comment. - * @type int $global_policy_evaluation_mode - * Optional. Controls the evaluation of a Google-maintained global admission - * policy for common system-level images. Images not covered by the global - * policy will be subject to the project admission policy. This setting - * has no effect when specified inside a global admission policy. - * @type array<\Google\Cloud\BinaryAuthorization\V1beta1\AdmissionWhitelistPattern>|\Google\Protobuf\Internal\RepeatedField $admission_whitelist_patterns - * Optional. Admission policy allowlisting. A matching admission request will - * always be permitted. This feature is typically used to exclude Google or - * third-party infrastructure images from Binary Authorization policies. - * @type array|\Google\Protobuf\Internal\MapField $cluster_admission_rules - * Optional. Per-cluster admission rules. Cluster spec format: - * `location.clusterId`. There can be at most one admission rule per cluster - * spec. - * A `location` is either a compute zone (e.g. us-central1-a) or a region - * (e.g. us-central1). - * For `clusterId` syntax restrictions see - * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters. - * @type array|\Google\Protobuf\Internal\MapField $kubernetes_namespace_admission_rules - * Optional. Per-kubernetes-namespace admission rules. K8s namespace spec format: - * `[a-z.-]+`, e.g. `some-namespace` - * @type array|\Google\Protobuf\Internal\MapField $kubernetes_service_account_admission_rules - * Optional. Per-kubernetes-service-account admission rules. Service account - * spec format: `namespace:serviceaccount`. e.g. `test-ns:default` - * @type array|\Google\Protobuf\Internal\MapField $istio_service_identity_admission_rules - * Optional. Per-istio-service-identity admission rules. Istio service - * identity spec format: - * `spiffe:///ns//sa/` or - * `/ns//sa/` - * e.g. `spiffe://example.com/ns/test-ns/sa/default` - * @type \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule $default_admission_rule - * Required. Default admission rule for a cluster without a per-cluster, per- - * kubernetes-service-account, or per-istio-service-identity admission rule. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Time when the policy was last updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name, in the format `projects/*/policy`. There is - * at most one policy per project. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name, in the format `projects/*/policy`. There is - * at most one policy per project. - * - * 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; - } - - /** - * Optional. A descriptive comment. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. A descriptive comment. - * - * Generated from protobuf field string description = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Optional. Controls the evaluation of a Google-maintained global admission - * policy for common system-level images. Images not covered by the global - * policy will be subject to the project admission policy. This setting - * has no effect when specified inside a global admission policy. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getGlobalPolicyEvaluationMode() - { - return $this->global_policy_evaluation_mode; - } - - /** - * Optional. Controls the evaluation of a Google-maintained global admission - * policy for common system-level images. Images not covered by the global - * policy will be subject to the project admission policy. This setting - * has no effect when specified inside a global admission policy. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setGlobalPolicyEvaluationMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BinaryAuthorization\V1beta1\Policy\GlobalPolicyEvaluationMode::class); - $this->global_policy_evaluation_mode = $var; - - return $this; - } - - /** - * Optional. Admission policy allowlisting. A matching admission request will - * always be permitted. This feature is typically used to exclude Google or - * third-party infrastructure images from Binary Authorization policies. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAdmissionWhitelistPatterns() - { - return $this->admission_whitelist_patterns; - } - - /** - * Optional. Admission policy allowlisting. A matching admission request will - * always be permitted. This feature is typically used to exclude Google or - * third-party infrastructure images from Binary Authorization policies. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\BinaryAuthorization\V1beta1\AdmissionWhitelistPattern>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAdmissionWhitelistPatterns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionWhitelistPattern::class); - $this->admission_whitelist_patterns = $arr; - - return $this; - } - - /** - * Optional. Per-cluster admission rules. Cluster spec format: - * `location.clusterId`. There can be at most one admission rule per cluster - * spec. - * A `location` is either a compute zone (e.g. us-central1-a) or a region - * (e.g. us-central1). - * For `clusterId` syntax restrictions see - * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters. - * - * Generated from protobuf field map cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getClusterAdmissionRules() - { - return $this->cluster_admission_rules; - } - - /** - * Optional. Per-cluster admission rules. Cluster spec format: - * `location.clusterId`. There can be at most one admission rule per cluster - * spec. - * A `location` is either a compute zone (e.g. us-central1-a) or a region - * (e.g. us-central1). - * For `clusterId` syntax restrictions see - * https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters. - * - * Generated from protobuf field map cluster_admission_rules = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setClusterAdmissionRules($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule::class); - $this->cluster_admission_rules = $arr; - - return $this; - } - - /** - * Optional. Per-kubernetes-namespace admission rules. K8s namespace spec format: - * `[a-z.-]+`, e.g. `some-namespace` - * - * Generated from protobuf field map kubernetes_namespace_admission_rules = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getKubernetesNamespaceAdmissionRules() - { - return $this->kubernetes_namespace_admission_rules; - } - - /** - * Optional. Per-kubernetes-namespace admission rules. K8s namespace spec format: - * `[a-z.-]+`, e.g. `some-namespace` - * - * Generated from protobuf field map kubernetes_namespace_admission_rules = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setKubernetesNamespaceAdmissionRules($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule::class); - $this->kubernetes_namespace_admission_rules = $arr; - - return $this; - } - - /** - * Optional. Per-kubernetes-service-account admission rules. Service account - * spec format: `namespace:serviceaccount`. e.g. `test-ns:default` - * - * Generated from protobuf field map kubernetes_service_account_admission_rules = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getKubernetesServiceAccountAdmissionRules() - { - return $this->kubernetes_service_account_admission_rules; - } - - /** - * Optional. Per-kubernetes-service-account admission rules. Service account - * spec format: `namespace:serviceaccount`. e.g. `test-ns:default` - * - * Generated from protobuf field map kubernetes_service_account_admission_rules = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setKubernetesServiceAccountAdmissionRules($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule::class); - $this->kubernetes_service_account_admission_rules = $arr; - - return $this; - } - - /** - * Optional. Per-istio-service-identity admission rules. Istio service - * identity spec format: - * `spiffe:///ns//sa/` or - * `/ns//sa/` - * e.g. `spiffe://example.com/ns/test-ns/sa/default` - * - * Generated from protobuf field map istio_service_identity_admission_rules = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getIstioServiceIdentityAdmissionRules() - { - return $this->istio_service_identity_admission_rules; - } - - /** - * Optional. Per-istio-service-identity admission rules. Istio service - * identity spec format: - * `spiffe:///ns//sa/` or - * `/ns//sa/` - * e.g. `spiffe://example.com/ns/test-ns/sa/default` - * - * Generated from protobuf field map istio_service_identity_admission_rules = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setIstioServiceIdentityAdmissionRules($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule::class); - $this->istio_service_identity_admission_rules = $arr; - - return $this; - } - - /** - * Required. Default admission rule for a cluster without a per-cluster, per- - * kubernetes-service-account, or per-istio-service-identity admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule|null - */ - public function getDefaultAdmissionRule() - { - return $this->default_admission_rule; - } - - public function hasDefaultAdmissionRule() - { - return isset($this->default_admission_rule); - } - - public function clearDefaultAdmissionRule() - { - unset($this->default_admission_rule); - } - - /** - * Required. Default admission rule for a cluster without a per-cluster, per- - * kubernetes-service-account, or per-istio-service-identity admission rule. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.AdmissionRule default_admission_rule = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule $var - * @return $this - */ - public function setDefaultAdmissionRule($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\AdmissionRule::class); - $this->default_admission_rule = $var; - - return $this; - } - - /** - * Output only. Time when the policy was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. Time when the policy was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/Policy/GlobalPolicyEvaluationMode.php b/BinaryAuthorization/src/V1beta1/Policy/GlobalPolicyEvaluationMode.php deleted file mode 100644 index 6ac8131c3b64..000000000000 --- a/BinaryAuthorization/src/V1beta1/Policy/GlobalPolicyEvaluationMode.php +++ /dev/null @@ -1,62 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode - */ -class GlobalPolicyEvaluationMode -{ - /** - * Not specified: DISABLE is assumed. - * - * Generated from protobuf enum GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED = 0; - */ - const GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED = 0; - /** - * Enables system policy evaluation. - * - * Generated from protobuf enum ENABLE = 1; - */ - const ENABLE = 1; - /** - * Disables system policy evaluation. - * - * Generated from protobuf enum DISABLE = 2; - */ - const DISABLE = 2; - - private static $valueToName = [ - self::GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED => 'GLOBAL_POLICY_EVALUATION_MODE_UNSPECIFIED', - self::ENABLE => 'ENABLE', - self::DISABLE => 'DISABLE', - ]; - - 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(GlobalPolicyEvaluationMode::class, \Google\Cloud\BinaryAuthorization\V1beta1\Policy_GlobalPolicyEvaluationMode::class); - diff --git a/BinaryAuthorization/src/V1beta1/Policy_GlobalPolicyEvaluationMode.php b/BinaryAuthorization/src/V1beta1/Policy_GlobalPolicyEvaluationMode.php deleted file mode 100644 index 78e55714bf13..000000000000 --- a/BinaryAuthorization/src/V1beta1/Policy_GlobalPolicyEvaluationMode.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1/GetSystemPolicy', - $argument, - ['\Google\Cloud\BinaryAuthorization\V1beta1\Policy', 'decode'], - $metadata, $options); - } - -} diff --git a/BinaryAuthorization/src/V1beta1/UpdateAttestorRequest.php b/BinaryAuthorization/src/V1beta1/UpdateAttestorRequest.php deleted file mode 100644 index 4de3e647283a..000000000000 --- a/BinaryAuthorization/src/V1beta1/UpdateAttestorRequest.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest - */ -class UpdateAttestorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name - * in the request URL, in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $attestor = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\BinaryAuthorization\V1beta1\Attestor $attestor - * Required. The updated [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name - * in the request URL, in the format `projects/*/attestors/*`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name - * in the request URL, in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Attestor|null - */ - public function getAttestor() - { - return $this->attestor; - } - - public function hasAttestor() - { - return isset($this->attestor); - } - - public function clearAttestor() - { - unset($this->attestor); - } - - /** - * Required. The updated [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will - * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.Attestor.name] field with the resource name - * in the request URL, in the format `projects/*/attestors/*`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Attestor attestor = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\Attestor $var - * @return $this - */ - public function setAttestor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\Attestor::class); - $this->attestor = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/UpdatePolicyRequest.php b/BinaryAuthorization/src/V1beta1/UpdatePolicyRequest.php deleted file mode 100644 index 9a9104fe02c9..000000000000 --- a/BinaryAuthorization/src/V1beta1/UpdatePolicyRequest.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest - */ -class UpdatePolicyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will - * overwrite the [policy name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the resource name in - * the request URL, in the format `projects/*/policy`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $policy = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\BinaryAuthorization\V1beta1\Policy $policy - * Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will - * overwrite the [policy name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the resource name in - * the request URL, in the format `projects/*/policy`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will - * overwrite the [policy name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the resource name in - * the request URL, in the format `projects/*/policy`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\BinaryAuthorization\V1beta1\Policy|null - */ - public function getPolicy() - { - return $this->policy; - } - - public function hasPolicy() - { - return isset($this->policy); - } - - public function clearPolicy() - { - unset($this->policy); - } - - /** - * Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will - * overwrite the [policy name][google.cloud.binaryauthorization.v1beta1.Policy.name] field with the resource name in - * the request URL, in the format `projects/*/policy`. - * - * Generated from protobuf field .google.cloud.binaryauthorization.v1beta1.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\BinaryAuthorization\V1beta1\Policy $var - * @return $this - */ - public function setPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BinaryAuthorization\V1beta1\Policy::class); - $this->policy = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/UserOwnedDrydockNote.php b/BinaryAuthorization/src/V1beta1/UserOwnedDrydockNote.php deleted file mode 100644 index 301f786bba07..000000000000 --- a/BinaryAuthorization/src/V1beta1/UserOwnedDrydockNote.php +++ /dev/null @@ -1,208 +0,0 @@ -google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote - */ -class UserOwnedDrydockNote extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note, - * created by the user, in the format: `projects/*/notes/*` (or the legacy - * `providers/*/notes/*`). This field may not be updated. - * An attestation by this attestor is stored as a Drydock - * ATTESTATION_AUTHORITY Occurrence that names a container image and that - * links to this Note. Drydock is an external dependency. - * - * Generated from protobuf field string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $note_reference = ''; - /** - * Optional. Public keys that verify attestations signed by this - * attestor. This field may be updated. - * If this field is non-empty, one of the specified public keys must - * verify that an attestation was signed by this attestor for the - * image specified in the admission request. - * If this field is empty, this attestor always returns that no - * valid attestations exist. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $public_keys; - /** - * Output only. This field will contain the service account email address - * that this Attestor will use as the principal when querying Container - * Analysis. Attestor administrators must grant this service account the - * IAM role needed to read attestations from the [note_reference][Note] in - * Container Analysis (`containeranalysis.notes.occurrences.viewer`). - * This email address is fixed for the lifetime of the Attestor, but callers - * should not make any other assumptions about the service account email; - * future versions may use an email based on a different naming pattern. - * - * Generated from protobuf field string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $delegation_service_account_email = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $note_reference - * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note, - * created by the user, in the format: `projects/*/notes/*` (or the legacy - * `providers/*/notes/*`). This field may not be updated. - * An attestation by this attestor is stored as a Drydock - * ATTESTATION_AUTHORITY Occurrence that names a container image and that - * links to this Note. Drydock is an external dependency. - * @type array<\Google\Cloud\BinaryAuthorization\V1beta1\AttestorPublicKey>|\Google\Protobuf\Internal\RepeatedField $public_keys - * Optional. Public keys that verify attestations signed by this - * attestor. This field may be updated. - * If this field is non-empty, one of the specified public keys must - * verify that an attestation was signed by this attestor for the - * image specified in the admission request. - * If this field is empty, this attestor always returns that no - * valid attestations exist. - * @type string $delegation_service_account_email - * Output only. This field will contain the service account email address - * that this Attestor will use as the principal when querying Container - * Analysis. Attestor administrators must grant this service account the - * IAM role needed to read attestations from the [note_reference][Note] in - * Container Analysis (`containeranalysis.notes.occurrences.viewer`). - * This email address is fixed for the lifetime of the Attestor, but callers - * should not make any other assumptions about the service account email; - * future versions may use an email based on a different naming pattern. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Binaryauthorization\V1Beta1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note, - * created by the user, in the format: `projects/*/notes/*` (or the legacy - * `providers/*/notes/*`). This field may not be updated. - * An attestation by this attestor is stored as a Drydock - * ATTESTATION_AUTHORITY Occurrence that names a container image and that - * links to this Note. Drydock is an external dependency. - * - * Generated from protobuf field string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getNoteReference() - { - return $this->note_reference; - } - - /** - * Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note, - * created by the user, in the format: `projects/*/notes/*` (or the legacy - * `providers/*/notes/*`). This field may not be updated. - * An attestation by this attestor is stored as a Drydock - * ATTESTATION_AUTHORITY Occurrence that names a container image and that - * links to this Note. Drydock is an external dependency. - * - * Generated from protobuf field string note_reference = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setNoteReference($var) - { - GPBUtil::checkString($var, True); - $this->note_reference = $var; - - return $this; - } - - /** - * Optional. Public keys that verify attestations signed by this - * attestor. This field may be updated. - * If this field is non-empty, one of the specified public keys must - * verify that an attestation was signed by this attestor for the - * image specified in the admission request. - * If this field is empty, this attestor always returns that no - * valid attestations exist. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPublicKeys() - { - return $this->public_keys; - } - - /** - * Optional. Public keys that verify attestations signed by this - * attestor. This field may be updated. - * If this field is non-empty, one of the specified public keys must - * verify that an attestation was signed by this attestor for the - * image specified in the admission request. - * If this field is empty, this attestor always returns that no - * valid attestations exist. - * - * Generated from protobuf field repeated .google.cloud.binaryauthorization.v1beta1.AttestorPublicKey public_keys = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\BinaryAuthorization\V1beta1\AttestorPublicKey>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPublicKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BinaryAuthorization\V1beta1\AttestorPublicKey::class); - $this->public_keys = $arr; - - return $this; - } - - /** - * Output only. This field will contain the service account email address - * that this Attestor will use as the principal when querying Container - * Analysis. Attestor administrators must grant this service account the - * IAM role needed to read attestations from the [note_reference][Note] in - * Container Analysis (`containeranalysis.notes.occurrences.viewer`). - * This email address is fixed for the lifetime of the Attestor, but callers - * should not make any other assumptions about the service account email; - * future versions may use an email based on a different naming pattern. - * - * Generated from protobuf field string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDelegationServiceAccountEmail() - { - return $this->delegation_service_account_email; - } - - /** - * Output only. This field will contain the service account email address - * that this Attestor will use as the principal when querying Container - * Analysis. Attestor administrators must grant this service account the - * IAM role needed to read attestations from the [note_reference][Note] in - * Container Analysis (`containeranalysis.notes.occurrences.viewer`). - * This email address is fixed for the lifetime of the Attestor, but callers - * should not make any other assumptions about the service account email; - * future versions may use an email based on a different naming pattern. - * - * Generated from protobuf field string delegation_service_account_email = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDelegationServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->delegation_service_account_email = $var; - - return $this; - } - -} - diff --git a/BinaryAuthorization/src/V1beta1/gapic_metadata.json b/BinaryAuthorization/src/V1beta1/gapic_metadata.json deleted file mode 100644 index 5d3b03e24f02..000000000000 --- a/BinaryAuthorization/src/V1beta1/gapic_metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.binaryauthorization.v1beta1", - "libraryPackage": "Google\\Cloud\\BinaryAuthorization\\V1beta1", - "services": { - "BinauthzManagementServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "BinauthzManagementServiceV1Beta1GapicClient", - "rpcs": { - "CreateAttestor": { - "methods": [ - "createAttestor" - ] - }, - "DeleteAttestor": { - "methods": [ - "deleteAttestor" - ] - }, - "GetAttestor": { - "methods": [ - "getAttestor" - ] - }, - "GetPolicy": { - "methods": [ - "getPolicy" - ] - }, - "ListAttestors": { - "methods": [ - "listAttestors" - ] - }, - "UpdateAttestor": { - "methods": [ - "updateAttestor" - ] - }, - "UpdatePolicy": { - "methods": [ - "updatePolicy" - ] - } - } - } - } - }, - "SystemPolicyV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "SystemPolicyV1Beta1GapicClient", - "rpcs": { - "GetSystemPolicy": { - "methods": [ - "getSystemPolicy" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_client_config.json b/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_client_config.json deleted file mode 100644 index 1b94a90e3501..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_client_config.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "interfaces": { - "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateAttestor": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteAttestor": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetAttestor": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetPolicy": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListAttestors": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateAttestor": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdatePolicy": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_descriptor_config.php b/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_descriptor_config.php deleted file mode 100644 index 3243955d9de4..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_descriptor_config.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - 'google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1' => [ - 'ListAttestors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getAttestors', - ], - ], - ], - ], -]; diff --git a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_rest_client_config.php b/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_rest_client_config.php deleted file mode 100644 index 58ec7a48b19d..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/binauthz_management_service_v1_beta1_rest_client_config.php +++ /dev/null @@ -1,171 +0,0 @@ - [ - 'google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1' => [ - 'CreateAttestor' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*}/attestors', - 'body' => 'attestor', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'attestor_id', - ], - ], - 'DeleteAttestor' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/attestors/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetAttestor' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/attestors/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/policy}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListAttestors' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*}/attestors', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateAttestor' => [ - 'method' => 'put', - 'uriTemplate' => '/v1beta1/{attestor.name=projects/*/attestors/*}', - 'body' => 'attestor', - 'placeholders' => [ - 'attestor.name' => [ - 'getters' => [ - 'getAttestor', - 'getName', - ], - ], - ], - ], - 'UpdatePolicy' => [ - 'method' => 'put', - 'uriTemplate' => '/v1beta1/{policy.name=projects/*/policy}', - 'body' => 'policy', - 'placeholders' => [ - 'policy.name' => [ - 'getters' => [ - 'getPolicy', - 'getName', - ], - ], - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_client_config.json b/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_client_config.json deleted file mode 100644 index 6be9cf016171..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_client_config.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "interfaces": { - "google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1": { - "retry_codes": { - "no_retry_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - } - }, - "methods": { - "GetSystemPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_descriptor_config.php b/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_descriptor_config.php deleted file mode 100644 index 8bcc1b01afcb..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_descriptor_config.php +++ /dev/null @@ -1,27 +0,0 @@ - [ - 'google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1' => [], - ], -]; diff --git a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_rest_client_config.php b/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_rest_client_config.php deleted file mode 100644 index 644b70f64222..000000000000 --- a/BinaryAuthorization/src/V1beta1/resources/system_policy_v1_beta1_rest_client_config.php +++ /dev/null @@ -1,97 +0,0 @@ - [ - 'google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1' => [ - 'GetSystemPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=locations/*/policy}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/policy}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{resource=projects/*/attestors/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/BinaryAuthorization/tests/Unit/V1/Client/BinauthzManagementServiceV1ClientTest.php b/BinaryAuthorization/tests/Unit/V1/Client/BinauthzManagementServiceV1ClientTest.php index a6db174eb6b9..d01a40d7f08b 100644 --- a/BinaryAuthorization/tests/Unit/V1/Client/BinauthzManagementServiceV1ClientTest.php +++ b/BinaryAuthorization/tests/Unit/V1/Client/BinauthzManagementServiceV1ClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return BinauthzManagementServiceV1Client */ @@ -103,7 +105,10 @@ public function createAttestorTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/CreateAttestor', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/CreateAttestor', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualRequestObject->getAttestorId(); @@ -124,12 +129,15 @@ public function createAttestorExceptionTest() $status = new stdClass(); $status->code = 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->projectName('[PROJECT]'); @@ -167,14 +175,16 @@ public function deleteAttestorTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - $request = (new DeleteAttestorRequest()) - ->setName($formattedName); + $request = (new DeleteAttestorRequest())->setName($formattedName); $gapicClient->deleteAttestor($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/DeleteAttestor', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/DeleteAttestor', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -191,17 +201,19 @@ public function deleteAttestorExceptionTest() $status = new stdClass(); $status->code = 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->attestorName('[PROJECT]', '[ATTESTOR]'); - $request = (new DeleteAttestorRequest()) - ->setName($formattedName); + $request = (new DeleteAttestorRequest())->setName($formattedName); try { $gapicClient->deleteAttestor($request); // If the $gapicClient method call did not throw, fail the test @@ -232,15 +244,17 @@ public function getAttestorTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - $request = (new GetAttestorRequest()) - ->setName($formattedName); + $request = (new GetAttestorRequest())->setName($formattedName); $response = $gapicClient->getAttestor($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetAttestor', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetAttestor', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -257,17 +271,19 @@ public function getAttestorExceptionTest() $status = new stdClass(); $status->code = 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->attestorName('[PROJECT]', '[ATTESTOR]'); - $request = (new GetAttestorRequest()) - ->setName($formattedName); + $request = (new GetAttestorRequest())->setName($formattedName); try { $gapicClient->getAttestor($request); // If the $gapicClient method call did not throw, fail the test @@ -298,15 +314,17 @@ public function getPolicyTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]'); - $request = (new GetPolicyRequest()) - ->setName($formattedName); + $request = (new GetPolicyRequest())->setName($formattedName); $response = $gapicClient->getPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetPolicy', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetPolicy', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -323,17 +341,19 @@ public function getPolicyExceptionTest() $status = new stdClass(); $status->code = 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->policyName('[PROJECT]'); - $request = (new GetPolicyRequest()) - ->setName($formattedName); + $request = (new GetPolicyRequest())->setName($formattedName); try { $gapicClient->getPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -358,17 +378,14 @@ public function listAttestorsTest() // Mock response $nextPageToken = ''; $attestorsElement = new Attestor(); - $attestors = [ - $attestorsElement, - ]; + $attestors = [$attestorsElement]; $expectedResponse = new ListAttestorsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAttestors($attestors); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListAttestorsRequest()) - ->setParent($formattedParent); + $request = (new ListAttestorsRequest())->setParent($formattedParent); $response = $gapicClient->listAttestors($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -378,7 +395,10 @@ public function listAttestorsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/ListAttestors', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/ListAttestors', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -395,17 +415,19 @@ public function listAttestorsExceptionTest() $status = new stdClass(); $status->code = 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->projectName('[PROJECT]'); - $request = (new ListAttestorsRequest()) - ->setParent($formattedParent); + $request = (new ListAttestorsRequest())->setParent($formattedParent); try { $gapicClient->listAttestors($request); // If the $gapicClient method call did not throw, fail the test @@ -438,15 +460,17 @@ public function updateAttestorTest() $attestor = new Attestor(); $attestorName = 'attestorName-125367661'; $attestor->setName($attestorName); - $request = (new UpdateAttestorRequest()) - ->setAttestor($attestor); + $request = (new UpdateAttestorRequest())->setAttestor($attestor); $response = $gapicClient->updateAttestor($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdateAttestor', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdateAttestor', + $actualFuncCall + ); $actualValue = $actualRequestObject->getAttestor(); $this->assertProtobufEquals($attestor, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -463,19 +487,21 @@ public function updateAttestorExceptionTest() $status = new stdClass(); $status->code = 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 $attestor = new Attestor(); $attestorName = 'attestorName-125367661'; $attestor->setName($attestorName); - $request = (new UpdateAttestorRequest()) - ->setAttestor($attestor); + $request = (new UpdateAttestorRequest())->setAttestor($attestor); try { $gapicClient->updateAttestor($request); // If the $gapicClient method call did not throw, fail the test @@ -512,15 +538,17 @@ public function updatePolicyTest() $defaultAdmissionRuleEnforcementMode = EnforcementMode::ENFORCEMENT_MODE_UNSPECIFIED; $policyDefaultAdmissionRule->setEnforcementMode($defaultAdmissionRuleEnforcementMode); $policy->setDefaultAdmissionRule($policyDefaultAdmissionRule); - $request = (new UpdatePolicyRequest()) - ->setPolicy($policy); + $request = (new UpdatePolicyRequest())->setPolicy($policy); $response = $gapicClient->updatePolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdatePolicy', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdatePolicy', + $actualFuncCall + ); $actualValue = $actualRequestObject->getPolicy(); $this->assertProtobufEquals($policy, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -537,12 +565,15 @@ public function updatePolicyExceptionTest() $status = new stdClass(); $status->code = 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 $policy = new Policy(); @@ -552,8 +583,7 @@ public function updatePolicyExceptionTest() $defaultAdmissionRuleEnforcementMode = EnforcementMode::ENFORCEMENT_MODE_UNSPECIFIED; $policyDefaultAdmissionRule->setEnforcementMode($defaultAdmissionRuleEnforcementMode); $policy->setDefaultAdmissionRule($policyDefaultAdmissionRule); - $request = (new UpdatePolicyRequest()) - ->setPolicy($policy); + $request = (new UpdatePolicyRequest())->setPolicy($policy); try { $gapicClient->updatePolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -598,7 +628,10 @@ public function createAttestorAsyncTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/CreateAttestor', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/CreateAttestor', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualRequestObject->getAttestorId(); diff --git a/BinaryAuthorization/tests/Unit/V1/Client/SystemPolicyV1ClientTest.php b/BinaryAuthorization/tests/Unit/V1/Client/SystemPolicyV1ClientTest.php index 49dbadcfc2f2..b1a97bf31a6d 100644 --- a/BinaryAuthorization/tests/Unit/V1/Client/SystemPolicyV1ClientTest.php +++ b/BinaryAuthorization/tests/Unit/V1/Client/SystemPolicyV1ClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return SystemPolicyV1Client */ @@ -77,8 +79,7 @@ public function getSystemPolicyTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]'); - $request = (new GetSystemPolicyRequest()) - ->setName($formattedName); + $request = (new GetSystemPolicyRequest())->setName($formattedName); $response = $gapicClient->getSystemPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -102,17 +103,19 @@ public function getSystemPolicyExceptionTest() $status = new stdClass(); $status->code = 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->policyName('[PROJECT]'); - $request = (new GetSystemPolicyRequest()) - ->setName($formattedName); + $request = (new GetSystemPolicyRequest())->setName($formattedName); try { $gapicClient->getSystemPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -143,8 +146,7 @@ public function getSystemPolicyAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->policyName('[PROJECT]'); - $request = (new GetSystemPolicyRequest()) - ->setName($formattedName); + $request = (new GetSystemPolicyRequest())->setName($formattedName); $response = $gapicClient->getSystemPolicyAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/BinaryAuthorization/tests/Unit/V1/Client/ValidationHelperV1ClientTest.php b/BinaryAuthorization/tests/Unit/V1/Client/ValidationHelperV1ClientTest.php index ecc74efa7cad..fbe61fc1ebc9 100644 --- a/BinaryAuthorization/tests/Unit/V1/Client/ValidationHelperV1ClientTest.php +++ b/BinaryAuthorization/tests/Unit/V1/Client/ValidationHelperV1ClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return ValidationHelperV1Client */ @@ -90,7 +92,10 @@ public function validateAttestationOccurrenceTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.ValidationHelperV1/ValidateAttestationOccurrence', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.ValidationHelperV1/ValidateAttestationOccurrence', + $actualFuncCall + ); $actualValue = $actualRequestObject->getAttestor(); $this->assertProtobufEquals($attestor, $actualValue); $actualValue = $actualRequestObject->getAttestation(); @@ -113,12 +118,15 @@ public function validateAttestationOccurrenceExceptionTest() $status = new stdClass(); $status->code = 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 $attestor = 'attestor542920680'; @@ -172,7 +180,10 @@ public function validateAttestationOccurrenceAsyncTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1.ValidationHelperV1/ValidateAttestationOccurrence', $actualFuncCall); + $this->assertSame( + '/google.cloud.binaryauthorization.v1.ValidationHelperV1/ValidateAttestationOccurrence', + $actualFuncCall + ); $actualValue = $actualRequestObject->getAttestor(); $this->assertProtobufEquals($attestor, $actualValue); $actualValue = $actualRequestObject->getAttestation(); diff --git a/BinaryAuthorization/tests/Unit/V1beta1/BinauthzManagementServiceV1Beta1ClientTest.php b/BinaryAuthorization/tests/Unit/V1beta1/BinauthzManagementServiceV1Beta1ClientTest.php deleted file mode 100644 index 5e9ce17ffd76..000000000000 --- a/BinaryAuthorization/tests/Unit/V1beta1/BinauthzManagementServiceV1Beta1ClientTest.php +++ /dev/null @@ -1,530 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return BinauthzManagementServiceV1Beta1Client */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new BinauthzManagementServiceV1Beta1Client($options); - } - - /** @test */ - public function createAttestorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Attestor(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $attestorId = 'attestorId-696764206'; - $attestor = new Attestor(); - $attestorName = 'attestorName-125367661'; - $attestor->setName($attestorName); - $response = $gapicClient->createAttestor($formattedParent, $attestorId, $attestor); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/CreateAttestor', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getAttestorId(); - $this->assertProtobufEquals($attestorId, $actualValue); - $actualValue = $actualRequestObject->getAttestor(); - $this->assertProtobufEquals($attestor, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createAttestorExceptionTest() - { - $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->projectName('[PROJECT]'); - $attestorId = 'attestorId-696764206'; - $attestor = new Attestor(); - $attestorName = 'attestorName-125367661'; - $attestor->setName($attestorName); - try { - $gapicClient->createAttestor($formattedParent, $attestorId, $attestor); - // 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 deleteAttestorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - $gapicClient->deleteAttestor($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/DeleteAttestor', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteAttestorExceptionTest() - { - $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->attestorName('[PROJECT]', '[ATTESTOR]'); - try { - $gapicClient->deleteAttestor($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 getAttestorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Attestor(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->attestorName('[PROJECT]', '[ATTESTOR]'); - $response = $gapicClient->getAttestor($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetAttestor', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getAttestorExceptionTest() - { - $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->attestorName('[PROJECT]', '[ATTESTOR]'); - try { - $gapicClient->getAttestor($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 getPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Policy(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]'); - $response = $gapicClient->getPolicy($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPolicyExceptionTest() - { - $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->policyName('[PROJECT]'); - try { - $gapicClient->getPolicy($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 listAttestorsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $attestorsElement = new Attestor(); - $attestors = [ - $attestorsElement, - ]; - $expectedResponse = new ListAttestorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAttestors($attestors); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listAttestors($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAttestors()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/ListAttestors', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listAttestorsExceptionTest() - { - $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->projectName('[PROJECT]'); - try { - $gapicClient->listAttestors($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 updateAttestorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Attestor(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $attestor = new Attestor(); - $attestorName = 'attestorName-125367661'; - $attestor->setName($attestorName); - $response = $gapicClient->updateAttestor($attestor); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdateAttestor', $actualFuncCall); - $actualValue = $actualRequestObject->getAttestor(); - $this->assertProtobufEquals($attestor, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateAttestorExceptionTest() - { - $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 - $attestor = new Attestor(); - $attestorName = 'attestorName-125367661'; - $attestor->setName($attestorName); - try { - $gapicClient->updateAttestor($attestor); - // 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 updatePolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Policy(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $policy = new Policy(); - $policyDefaultAdmissionRule = new AdmissionRule(); - $defaultAdmissionRuleEvaluationMode = EvaluationMode::EVALUATION_MODE_UNSPECIFIED; - $policyDefaultAdmissionRule->setEvaluationMode($defaultAdmissionRuleEvaluationMode); - $defaultAdmissionRuleEnforcementMode = EnforcementMode::ENFORCEMENT_MODE_UNSPECIFIED; - $policyDefaultAdmissionRule->setEnforcementMode($defaultAdmissionRuleEnforcementMode); - $policy->setDefaultAdmissionRule($policyDefaultAdmissionRule); - $response = $gapicClient->updatePolicy($policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdatePolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updatePolicyExceptionTest() - { - $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 - $policy = new Policy(); - $policyDefaultAdmissionRule = new AdmissionRule(); - $defaultAdmissionRuleEvaluationMode = EvaluationMode::EVALUATION_MODE_UNSPECIFIED; - $policyDefaultAdmissionRule->setEvaluationMode($defaultAdmissionRuleEvaluationMode); - $defaultAdmissionRuleEnforcementMode = EnforcementMode::ENFORCEMENT_MODE_UNSPECIFIED; - $policyDefaultAdmissionRule->setEnforcementMode($defaultAdmissionRuleEnforcementMode); - $policy->setDefaultAdmissionRule($policyDefaultAdmissionRule); - try { - $gapicClient->updatePolicy($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()); - } -} diff --git a/BinaryAuthorization/tests/Unit/V1beta1/SystemPolicyV1Beta1ClientTest.php b/BinaryAuthorization/tests/Unit/V1beta1/SystemPolicyV1Beta1ClientTest.php deleted file mode 100644 index afc19a6790a8..000000000000 --- a/BinaryAuthorization/tests/Unit/V1beta1/SystemPolicyV1Beta1ClientTest.php +++ /dev/null @@ -1,123 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SystemPolicyV1Beta1Client */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SystemPolicyV1Beta1Client($options); - } - - /** @test */ - public function getSystemPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Policy(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->policyName('[PROJECT]'); - $response = $gapicClient->getSystemPolicy($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1/GetSystemPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSystemPolicyExceptionTest() - { - $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->policyName('[PROJECT]'); - try { - $gapicClient->getSystemPolicy($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()); - } -}