From 4895d6cbbef3d6a8d54d3167c8141398d603af42 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 16 Apr 2024 21:02:08 +0000 Subject: [PATCH 1/2] docs: in google.cloud.kms.v1.PublicKey, pem field is always populated PiperOrigin-RevId: 625414261 Source-Link: https://github.com/googleapis/googleapis/commit/1c2d0272e3926d7a32bf876b1d9c6225e926e838 Source-Link: https://github.com/googleapis/googleapis-gen/commit/79eaf4e52e0086b54f2de8fee66a58b5a1b76273 Copy-Tag: eyJwIjoiS21zLy5Pd2xCb3QueWFtbCIsImgiOiI3OWVhZjRlNTJlMDA4NmI1NGYyZGU4ZmVlNjZhNThiNWExYjc2MjczIn0= --- .../Google/Cloud/Kms/V1/EkmService.php | Bin 0 -> 5222 bytes .../Google/Cloud/Kms/V1/Resources.php | Bin 0 -> 7052 bytes .../Google/Cloud/Kms/V1/Service.php | Bin 0 -> 15249 bytes .../Cloud/Kms/V1/AsymmetricDecryptRequest.php | 317 ++ .../Kms/V1/AsymmetricDecryptResponse.php | 339 ++ .../Cloud/Kms/V1/AsymmetricSignRequest.php | 568 ++++ .../Cloud/Kms/V1/AsymmetricSignResponse.php | 463 +++ .../src/Google/Cloud/Kms/V1/Certificate.php | 388 +++ .../Cloud/Kms/V1/CreateCryptoKeyRequest.php | 241 ++ .../Kms/V1/CreateCryptoKeyVersionRequest.php | 143 + .../Kms/V1/CreateEkmConnectionRequest.php | 184 ++ .../Cloud/Kms/V1/CreateImportJobRequest.php | 184 ++ .../Cloud/Kms/V1/CreateKeyRingRequest.php | 184 ++ .../src/Google/Cloud/Kms/V1/CryptoKey.php | 676 ++++ .../Kms/V1/CryptoKey/CryptoKeyPurpose.php | 104 + .../Google/Cloud/Kms/V1/CryptoKeyVersion.php | 819 +++++ .../CryptoKeyVersionAlgorithm.php | 328 ++ .../CryptoKeyVersionState.php | 154 + .../CryptoKeyVersion/CryptoKeyVersionView.php | 67 + .../Cloud/Kms/V1/CryptoKeyVersionTemplate.php | 150 + .../Google/Cloud/Kms/V1/DecryptRequest.php | 529 +++ .../Google/Cloud/Kms/V1/DecryptResponse.php | 315 ++ .../Kms/V1/DestroyCryptoKeyVersionRequest.php | 87 + .../proto/src/Google/Cloud/Kms/V1/Digest.php | 141 + .../src/Google/Cloud/Kms/V1/EkmConfig.php | 123 + .../src/Google/Cloud/Kms/V1/EkmConnection.php | 314 ++ .../V1/EkmConnection/KeyManagementMode.php | 90 + .../Kms/V1/EkmConnection/ServiceResolver.php | 206 ++ .../Google/Cloud/Kms/V1/EncryptRequest.php | 625 ++++ .../Google/Cloud/Kms/V1/EncryptResponse.php | 471 +++ .../Kms/V1/ExternalProtectionLevelOptions.php | 122 + .../Kms/V1/GenerateRandomBytesRequest.php | 179 ++ .../Kms/V1/GenerateRandomBytesResponse.php | 211 ++ .../Cloud/Kms/V1/GetCryptoKeyRequest.php | 87 + .../Kms/V1/GetCryptoKeyVersionRequest.php | 87 + .../Cloud/Kms/V1/GetEkmConfigRequest.php | 87 + .../Cloud/Kms/V1/GetEkmConnectionRequest.php | 87 + .../Cloud/Kms/V1/GetImportJobRequest.php | 87 + .../Google/Cloud/Kms/V1/GetKeyRingRequest.php | 87 + .../Cloud/Kms/V1/GetPublicKeyRequest.php | 87 + .../Kms/V1/ImportCryptoKeyVersionRequest.php | 491 +++ .../src/Google/Cloud/Kms/V1/ImportJob.php | 549 ++++ .../Cloud/Kms/V1/ImportJob/ImportJobState.php | 79 + .../Cloud/Kms/V1/ImportJob/ImportMethod.php | 120 + .../Kms/V1/ImportJob/WrappingPublicKey.php | 88 + .../Cloud/Kms/V1/KeyOperationAttestation.php | 151 + .../AttestationFormat.php | 68 + .../CertificateChains.php | 140 + .../proto/src/Google/Cloud/Kms/V1/KeyRing.php | 124 + .../Kms/V1/ListCryptoKeyVersionsRequest.php | 314 ++ .../Kms/V1/ListCryptoKeyVersionsResponse.php | 152 + .../Cloud/Kms/V1/ListCryptoKeysRequest.php | 309 ++ .../Cloud/Kms/V1/ListCryptoKeysResponse.php | 148 + .../Kms/V1/ListEkmConnectionsRequest.php | 280 ++ .../Kms/V1/ListEkmConnectionsResponse.php | 148 + .../Cloud/Kms/V1/ListImportJobsRequest.php | 275 ++ .../Cloud/Kms/V1/ListImportJobsResponse.php | 148 + .../Cloud/Kms/V1/ListKeyRingsRequest.php | 280 ++ .../Cloud/Kms/V1/ListKeyRingsResponse.php | 148 + .../Google/Cloud/Kms/V1/LocationMetadata.php | 126 + .../Google/Cloud/Kms/V1/MacSignRequest.php | 300 ++ .../Google/Cloud/Kms/V1/MacSignResponse.php | 377 +++ .../Google/Cloud/Kms/V1/MacVerifyRequest.php | 508 +++ .../Google/Cloud/Kms/V1/MacVerifyResponse.php | 386 +++ .../Google/Cloud/Kms/V1/ProtectionLevel.php | 77 + .../src/Google/Cloud/Kms/V1/PublicKey.php | 354 ++ .../Google/Cloud/Kms/V1/RawDecryptRequest.php | 707 ++++ .../Cloud/Kms/V1/RawDecryptResponse.php | 511 +++ .../Google/Cloud/Kms/V1/RawEncryptRequest.php | 743 +++++ .../Cloud/Kms/V1/RawEncryptResponse.php | 744 +++++ .../Kms/V1/RestoreCryptoKeyVersionRequest.php | 87 + .../UpdateCryptoKeyPrimaryVersionRequest.php | 128 + .../Cloud/Kms/V1/UpdateCryptoKeyRequest.php | 137 + .../Kms/V1/UpdateCryptoKeyVersionRequest.php | 142 + .../Cloud/Kms/V1/UpdateEkmConfigRequest.php | 137 + .../Kms/V1/UpdateEkmConnectionRequest.php | 142 + .../Kms/V1/VerifyConnectivityRequest.php | 87 + .../Kms/V1/VerifyConnectivityResponse.php | 34 + .../create_ekm_connection.php | 80 + .../V1/EkmServiceClient/get_ekm_config.php | 73 + .../EkmServiceClient/get_ekm_connection.php | 73 + .../V1/EkmServiceClient/get_iam_policy.php | 72 + .../V1/EkmServiceClient/get_location.php | 57 + .../EkmServiceClient/list_ekm_connections.php | 78 + .../V1/EkmServiceClient/list_locations.php | 62 + .../V1/EkmServiceClient/set_iam_policy.php | 77 + .../EkmServiceClient/test_iam_permissions.php | 84 + .../V1/EkmServiceClient/update_ekm_config.php | 63 + .../update_ekm_connection.php | 62 + .../EkmServiceClient/verify_connectivity.php | 76 + .../asymmetric_decrypt.php | 88 + .../asymmetric_sign.php | 86 + .../create_crypto_key.php | 83 + .../create_crypto_key_version.php | 85 + .../create_import_job.php | 106 + .../create_key_ring.php | 80 + .../V1/KeyManagementServiceClient/decrypt.php | 85 + .../destroy_crypto_key_version.php | 98 + .../V1/KeyManagementServiceClient/encrypt.php | 92 + .../generate_random_bytes.php | 58 + .../get_crypto_key.php | 79 + .../get_crypto_key_version.php | 79 + .../get_iam_policy.php | 72 + .../get_import_job.php | 77 + .../get_key_ring.php | 72 + .../get_location.php | 57 + .../get_public_key.php | 83 + .../import_crypto_key_version.php | 103 + .../list_crypto_key_versions.php | 83 + .../list_crypto_keys.php | 77 + .../list_import_jobs.php | 77 + .../list_key_rings.php | 78 + .../list_locations.php | 62 + .../KeyManagementServiceClient/mac_sign.php | 85 + .../KeyManagementServiceClient/mac_verify.php | 90 + .../raw_decrypt.php | 84 + .../raw_encrypt.php | 88 + .../restore_crypto_key_version.php | 86 + .../set_iam_policy.php | 77 + .../test_iam_permissions.php | 84 + .../update_crypto_key.php | 62 + .../update_crypto_key_primary_version.php | 88 + .../update_crypto_key_version.php | 73 + .../Kms/v1/src/V1/Client/EkmServiceClient.php | 635 ++++ .../V1/Client/KeyManagementServiceClient.php | 1374 ++++++++ .../Kms/v1/src/V1/EkmServiceClient.php | 34 + .../v1/src/V1/Gapic/EkmServiceGapicClient.php | 1003 ++++++ .../Gapic/KeyManagementServiceGapicClient.php | 2841 +++++++++++++++++ .../v1/src/V1/KeyManagementServiceClient.php | 34 + .../Kms/v1/src/V1/gapic_metadata.json | 252 ++ .../resources/ekm_service_client_config.json | 86 + .../ekm_service_descriptor_config.php | 201 ++ .../ekm_service_rest_client_config.php | 243 ++ .../key_management_service_client_config.json | 191 ++ ...y_management_service_descriptor_config.php | 478 +++ ..._management_service_rest_client_config.php | 496 +++ .../Unit/V1/Client/EkmServiceClientTest.php | 948 ++++++ .../Client/KeyManagementServiceClientTest.php | 2573 +++++++++++++++ .../v1/tests/Unit/V1/EkmServiceClientTest.php | 839 +++++ .../V1/KeyManagementServiceClientTest.php | 2331 ++++++++++++++ 140 files changed, 37163 insertions(+) create mode 100644 owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/EkmService.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Resources.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Service.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Certificate.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyVersionRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateEkmConnectionRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateImportJobRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateKeyRingRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey/CryptoKeyPurpose.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionState.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionView.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersionTemplate.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DestroyCryptoKeyVersionRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Digest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConfig.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/KeyManagementMode.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/ServiceResolver.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ExternalProtectionLevelOptions.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyVersionRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConfigRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConnectionRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetImportJobRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetKeyRingRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetPublicKeyRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportCryptoKeyVersionRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportJobState.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportMethod.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/WrappingPublicKey.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/AttestationFormat.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/CertificateChains.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyRing.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/LocationMetadata.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ProtectionLevel.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/PublicKey.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptResponse.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RestoreCryptoKeyVersionRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyPrimaryVersionRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyVersionRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConfigRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConnectionRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityRequest.php create mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityResponse.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/create_ekm_connection.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_config.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_connection.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_iam_policy.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_location.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_ekm_connections.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_locations.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/set_iam_policy.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_config.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_connection.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/verify_connectivity.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_decrypt.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_sign.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key_version.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_import_job.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_key_ring.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/decrypt.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/destroy_crypto_key_version.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/encrypt.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/generate_random_bytes.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key_version.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_iam_policy.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_import_job.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_key_ring.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_location.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_public_key.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/import_crypto_key_version.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_key_versions.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_keys.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_import_jobs.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_key_rings.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_locations.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_sign.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_verify.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_decrypt.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_encrypt.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/restore_crypto_key_version.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/set_iam_policy.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_primary_version.php create mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_version.php create mode 100644 owl-bot-staging/Kms/v1/src/V1/Client/EkmServiceClient.php create mode 100644 owl-bot-staging/Kms/v1/src/V1/Client/KeyManagementServiceClient.php create mode 100644 owl-bot-staging/Kms/v1/src/V1/EkmServiceClient.php create mode 100644 owl-bot-staging/Kms/v1/src/V1/Gapic/EkmServiceGapicClient.php create mode 100644 owl-bot-staging/Kms/v1/src/V1/Gapic/KeyManagementServiceGapicClient.php create mode 100644 owl-bot-staging/Kms/v1/src/V1/KeyManagementServiceClient.php create mode 100644 owl-bot-staging/Kms/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_client_config.json create mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_descriptor_config.php create mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_rest_client_config.php create mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_client_config.json create mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_descriptor_config.php create mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_rest_client_config.php create mode 100644 owl-bot-staging/Kms/v1/tests/Unit/V1/Client/EkmServiceClientTest.php create mode 100644 owl-bot-staging/Kms/v1/tests/Unit/V1/Client/KeyManagementServiceClientTest.php create mode 100644 owl-bot-staging/Kms/v1/tests/Unit/V1/EkmServiceClientTest.php create mode 100644 owl-bot-staging/Kms/v1/tests/Unit/V1/KeyManagementServiceClientTest.php diff --git a/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/EkmService.php b/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/EkmService.php new file mode 100644 index 0000000000000000000000000000000000000000..1a0843690b3abf4357ce248ef991af89881cd466 GIT binary patch literal 5222 zcmbtY&u<$=6lR?^Z6^JZOrS}u(r(>WP14j>OliTPR2#>Qs?UIB-Gb2Db=Mg*fFeKt1thc6PICZ(67AAzh8%y#3zy-uve5 zym#B#bkIe4fmp=VD5=TSZJBNo*>P=Z>$WLZoAo+zW!-K#hDqG4EYB~?OUr9=Y5wlo z1=#A@O;;xcdBe6hOp?=0yIIR^HN0GFCP%g!sz=)cK8mqn!w1Z^$=QOLPq01iCDExQH@KnPxsG*t0 z=McaxxvrTWf$iP4^`@m$!?t9$VcF8j#H8%|WVV+a8v?#12WVCp2M~Ydu0@G!X=Y`f zc)Dvi)OJ_Ev{2X}G-QsgOiYT`GIvH@p71di3SA&?$<%F<=-Xx4CA8^Uvm7^b&<>v} z30x_TQBf?*W-Qp2S19bqwD01ejYZQS7CqdaI|eapb7WI%8Mb@4t@nwjlAb|^-1E1V zHE*l;H->xH45&4#HJs$VJm1&eH$--oS}jcG9jNt*kbahoD`@Wmy4+Kd;}PF1%X=XU zy^w9qq({YG%`u=!82x@rq|Zlws56e$svubyj7JPy!KC;p=sMn9P^vlKK?C^e@E%&w zfE3>#^Mi!O?-?G2HY?heMRK z8#}VU_y#&|yEWpf)$OsP;d16{38j-zdk*vh!L#Tz(;j_4Ai&=@F__N?xUt-1W3dCk z(-!%Rsu7e7{s6`ZQRp|*4~Zc^npsDq3nWfnz}+l5!qiSMca1Ywxq>e9vS3xw!CVYQ z=0}LI=n@d+*m~gn6%um}4adn*jT%qT083B`-$tk6zw;#Z#2t5#c?{4WI3VoF(7XM! z+UnguzK#Z)+`Y;QokJhYr-RG}m7Wcy!$-A*M#4^m1f*cU6Z`NKdQ+^b8tYOE`oBfgn&qkdP>1&H z1BKvj-+>mgDF|8Jc8SU)XRM#+xI0UsNc%f)qEl?AR);tE8;|w2F^x{br~y-eYBd{G z2}_iKw{NI*!`dLOjBwJjPlPZ2_eK;G5W9*lx=0WU})NiXdzxlBU@w}dcgv@ZGcv* z4ZG$Oeky;xhj%QJ?Q*!e40~BBBn&#CyW24BsC-}pJ*1msEE}9vDgC#EPItn)kH&*& zYlaIIWV_qJ2q=Uw$AxebRjvrj&`>}Pj}qY=p9M9yYK{#_g9P#uf(x<_6HbUt+oN1+ z!y-=MIW)rjLlx=!t>HmIGv?()Rw6ybT&FUtXt;|Td=Z^rEIm}q%965BDwmel)bjFt zNqw-ix>73My>quTKlB=$6#ZcEK)E+0;ge{fcyIZ^yt-Ik9ZD6vJ;mwq5Wou{W~>jr z+>Ur^=faaWw-Y?J*`ysgy>mNp0dHr1mC%4+;Gi{0#a%{cYNW0;O{&KCijx73FX@@m z^YK-9xTmb63olerJaf1R0e$8pG`kNbkCx6l52me$p1Nr5Re#@ zR911&1YVM{X)lph5vyVqq9VikmMK>EDsZ7Ygb9fW1EhQQ#`8GyuxcL zZk9b%;<|$TRzfGjT4FLZ@%(ZFlOU`Y3{ROtw9KyIs~r4`(ZUa*Gzx;yRuRZ09LkvhCgrfg~F@d!NALd}72%p@PKWG# literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Resources.php b/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Resources.php new file mode 100644 index 0000000000000000000000000000000000000000..fdbabdcdf43d792b9ef2a0ad3195e5a15d6daf5b GIT binary patch literal 7052 zcmc&3U31gebsZ;heDb9zuyFzeVPFX?*w_S0ox+anD2^eCJ+@<@&8$X|l|&$08cEKQ zW%AaC{)V>Cec)kdb~^nNJJYxRfWGvF=@01ispnql%8sKDFYHWtAo4x;eBSeQ&;89e z)`11rg`(EhY{k`@!tRma9%zDPo35#vhOpb&+tX}8HCvW$Xm&~vR?EUxxh_bnrTR5Q zbfYB^!wH1`cHtr}*hnSRr9(ubL}t$9!l1Ka*otLowiAv@ z5AWVn-9IX^*$hr*4ZU_LuqCnVE%@m^Tpz$)`B`sMiu!a4eL8iRS(x`R6-y8N+jH-Q zMIS_+9epR=^o`}iulB=TW|6Z9eCMm}!IOWBK?2?5n@s9n z+ou8=4Ri%`LQic8kvq0!I$9!%Do4*>tFCi;0`_2Wmjui2A*|doTA-hXdg9L-ACec zFls2fn&Bish@zL=`8axNgKn1Eu6@KOU|ermrtQjR+c-*0BL6YZgn3wKVu;)3k?g1k zTC-zlO_>EjV(J|IJQ_EFSE;MW#D8`b^^MkUCZ-WLo{!@>{a1`aTzC5wa-OUTtnl^=hdg*Gk1LZiN35_?|_!d6b`n*{b+L?xzyt zV-VdG3tT++?t}OiuALQuf!KWQGh#6985QFXBeQGZkK7-jKUl$SjKpwu_(GODL6z-z6PUvrrlE9#4x(jRQ72o$1|`~J(Sic6~ZveUx1iu zV$o^436d@*yw#VOhBb^1^+3_vPGXe0{m2V1p$RjmASlFyiakK5 zB@?a=9z}F1&d)r>ZVxliH_NLs($c6G|r7G2G7)4P`8382Q3mH!So9_us|5(E+#4{Kn zN6AwBO6c*O>o7G!f-i(PFv-{hI4nU>Jm&!XLiF0) zrRAmD2>Adi3n?B0sGfw2KGvS18y#Ddv6*trc7j8EpYm5Q@0*9@zP^34-F?_$Vpl*f z4l-4+<7LY}j0;_iZ{b>i(Vt#r(;`voBxa~44?>+m^7-|p+p>qsFJhk8eEl>--`95y zEx{u_TDzmkzsF#{KYoJz%HM^ho>JM6sx^`Y#EoLPTB@&a_9cR=aH&`>7dIriTP6Ma zhiF(pr(s-_YH}v~SS}Vex!Y_Z`|uH6m}LuOM2gDiZ_7U+(8mAlIp=nh=C z$6tm-wIqp26V ze4iI;nG>8xLg2l;M?>Jf++!bs6aE~33FZR+r1hu-GH{pA01^SXD`x-+cW#jv;4&fW zcQ$falqx3_8w=ght6DsCN3U}5(H%s+8K!=y92xFrD4a==;l2umGZ`}6&MnfhNnTqg zSBN+HE;Dfg@Zj+>0pK5QlK2C|s7VEa^gP4Rt`f&w$4-we2-u*;*+Pc9)(a=(lD!K= zq?dK6x+QLe#~7dd(-2(j4`{FcEy0bDU?!!#zx&0WwjynmkNzl%yAZNp1{=*S0q{xJd4OO3h@dZqG9)d2N|`rmVa-m_BQ5ZdN7s!+?Iw<10Vxgwbch% zm3I5%*-NZ`kvd0)Y$+VFJz8#%I~#hFH`gHjN}Lb7YmnArz*a5y10K!$$k~^xt|fjS z`TreC+M88{( zmdMCsEu;~S4{qInPG74@rZ5BaTc=vh0b5k$roFXv?9YBqrKD2oEC?`jio=P7 zko;E!CVCx*zXJ1qipJT;dU>@kCHjpI?F@p7E0a!-v|JHZc_}=oxB+~K)&3LsqyRGt z(Gxouh29;*uxZG$`g{k25yb_7Mj<4vma$X+1G)8!UQ4y<9L&6r5 zl*yNsQk7J~bEZ52|IeH9=qz<$_V>PJyc-=Se+P@_+z%4K1@{khQMqI5ep$E*bJ`nB z;byz-&wL2nQrrWYd*XLq!*t)JgPc>PTCPj99?Kh2L)z%`73>;n<+b_?u_~cw;4Eyt zwuvUgWmdRxZot6=`z1Fj1#US1hX~B!Tskar@-z5$#GW=BB9U2%{Pwn&5d9%I8ENmE z^nD6P-1tO=BX4VWh5rAaNaX#{Y>_@jr3&ORDuo17jm%GMb;p0BqK{PgO0_#mE7*fu d!2`ox?`fy!CCDKIC^h62i0<^>YL4L;;D05li1Gjc literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Service.php b/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Service.php new file mode 100644 index 0000000000000000000000000000000000000000..edd8f8bcd703e721811fef1e0e61e4b432476348 GIT binary patch literal 15249 zcmd5@U5p!774A6A#=g7xyPIS;n?GlgG@G!o6DMg}hopFu=CAo#rTL+ii#u!I^-kCJ zxHIETw`B#QRJtMzU!9x1MO>p|xJL0RTUfkA7ZzWrJH-d5&LdQ=8IF^Fk#B(BLTUJ~ z*_yAJ<+S4(F8uGX>6FZd>6%8(d=rpgNG}*QhrrrS*@af4?3z|1O&8p0l*#n5G~biT z9&TEo>4mg}GDnpM#f#S)F0mU%t$3L@W!r4JmOTfe`FxeQ%4GD)^f7T;x}CX@p5_?y z`3{g5(yrYi{=28sHgQ{a<2=JnH&|7FD~1@V&@_vMM#G|3uo_N2@9E@i5w-AA%_I%C zzcp7(Qmf38MPu2t?EaSCC4wHYLHcP>l*{{2Qu&UdzGXN|@e!-F4{f8_BzDAY8C_0X zGzB>dm5SoR6^M~(`cqEL*f7d_I z(D+T$abF-Scg;rCxl3Me5y!>PqLHRygDR6+TANPI9{Z?}_^faU9jsYp&gcx^8I*Q1 zaPDMpiXZSUlxiAPQgR^PClj!GFw^`>RJH>`Q3`+t!Ip3i#I)u(G+S(v*xFugC(GW{vjF1b-rpCjLM%PCDO|&aO6tI%G?`bqzW)W0^ z+sixe552QTj=t{wu7>snZtk&EV3?89cx6k;d;y zKYRsY54=Rcd@!1ecfN3|f097^I8Bt2!vlFU6eLgg5Ng_Ig+4+JKSU{`R<&%?U92-r zx8$CSb&__JB?Y++_a_u@raB?LIxT^L;k=}*&{Q&+gv2vOmuOf=_-uGm)W5HYuHsWhS< zznMTg3(iWtPF&k8zi3t)@&H`tsf|yfk&0P`b6X^TbrP{UQ?&XrmzfAZ+0LQOe1+ss zTS=2774PKb`%8LLYWm)dHvgvyKWgnb)B>) zZG;GjZT6(#W1LF*#~RuO;2>R_3&VO&#Y2OKx1kMnqs*#rq30Qd;EJS8%)?Uux<;S( z`7G(K(WqGU*%gk0!q|u}LRkPa7&vF4h=9XqnbcVD zY{?y#WkDc#=9KVFDyzSfKwDL&5}lYaf2yKQEibq7G=-lI%eTGRhYzCN%hazX6gVpN z`7M{kXVD2I602yT5u6OQ1C8LgcKES|wyM|_cG&LE&$L1x19Y8L7^Qr7VpHF>9I7*~ zwV8*)F;gSP#r(krg#CqvfE{!g$GtBqHM4kSjY}_gvBu@VJ}&e~Gra?(J59L1`=$vc zLlU1rM-;od)**F@uUukH!r|{#WNOu==y~A|r=Un`PK`JU^g#1^^&n{m^EX*#)Cdd zFOwzzWy+>x?%fR90keZ!Mg!*Gb?B#v7h^EAxyStTKRg{;Ao)eabIsJT7?RwS`h~TE zm;rq4j~~C6$lw|JcF$XUj(-74wb!6jbF#;?vbux6uV$fZ%O?N$r%;&(CUy=!9(i-s zJd;)9)aPQ!3aB@NP|xFMdqY)7DQeaLV)K9em-bfzAbjX--odAOLz1%6+_`?12xYz$ zROSx8)t53pT>_d(Xv#6F^W4obo{&^2+A)6FVL8TBBYFHS4IyvniJuBJttTMyb{&B0 z=hq5sXd0k6ouWn%+|L>ohyFolL>&4>B&r^bd;OXpm*jIiTtNchU&AXoeguLCI2&a@ z6^lYrLXOwchv}~$x@7MF&^KF=F;R7n-^{>4N{?w*1&GYgctSOgC_6QJf~F<8x2@^Fqnv#_2bi_>PARQMPr^sRexFX zvVMP1&BEPV;cqWU1tVTHh)^&>`u|Eno4-6k75s^YHi-!VJ{0OPH9ugltxtsy9+Z&x zz_x`EQq2LxxjH+jtB$Yc34b9&!WM0`2-vF0)(y52@?dY}aim^aV7Ra7g+Xzz<}3VN z3JUv|@Vw^r^dp|vJON3X;?Ypg_yvUmWd`>Z{fmRb4UY(0z3|}ELfSw4sT05{>v9)F zYoP=myB6Y3REv+G8RPY2X*)Bb850zeJ_#?M+hv79t+m1^;}vg2Gbb7FSU6lS8G*4q z)$tSPc6yMc!%l>PErAvB08dg*cL>vJoF*e21QjyM@q^Sax~poD}{ zwY5Tudk}^L%zr~qJJ36(ETn$>t%g#704gPzlH>5CsD77z3Xemdm{7%DD{NM(%)nil zI>n+s+^73I?93IQ8vTv6Tsj8gku8@FNvY+@P&Rhyf9v(N!c(#zJL4a+&$Q3hnISHU zM^w2aqU*H^-#&JL1Wl*h4+|3!Z%+TA@Nm&}n@&EPee~#&P(*#+Mc)wQpN*b?tm!UT zc6}z6IDB|D`xP_+pNNIoW;O}mlF}CgtU2xFWBhdi{+Sm0sH|$Sk5mB#bh2Tm=KOi~ z=ck(X!^HSi_DyQ$68$DM1N&qiocd5+Es9T7*|)0jvFiK?wWoFZsQT`2hJWMf`y@2- Pb5JJ9KigbIs|fuEMCcR{ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptRequest.php new file mode 100644 index 000000000000..d091cf22284b --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptRequest.php @@ -0,0 +1,317 @@ +google.cloud.kms.v1.AsymmetricDecryptRequest + */ +class AsymmetricDecryptRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The data encrypted with the named + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using + * OAEP. + * + * Generated from protobuf field bytes ciphertext = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ciphertext = ''; + /** + * Optional. An optional CRC32C checksum of the + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) + * is equal to + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ciphertext_crc32c = null; + + /** + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. Please see + * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. + * @param string $ciphertext Required. The data encrypted with the named + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using + * OAEP. + * + * @return \Google\Cloud\Kms\V1\AsymmetricDecryptRequest + * + * @experimental + */ + public static function build(string $name, string $ciphertext): self + { + return (new self()) + ->setName($name) + ->setCiphertext($ciphertext); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. + * @type string $ciphertext + * Required. The data encrypted with the named + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using + * OAEP. + * @type \Google\Protobuf\Int64Value $ciphertext_crc32c + * Optional. An optional CRC32C checksum of the + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) + * is equal to + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. + * + * 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 + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. + * + * 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; + } + + /** + * Required. The data encrypted with the named + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using + * OAEP. + * + * Generated from protobuf field bytes ciphertext = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCiphertext() + { + return $this->ciphertext; + } + + /** + * Required. The data encrypted with the named + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using + * OAEP. + * + * Generated from protobuf field bytes ciphertext = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCiphertext($var) + { + GPBUtil::checkString($var, False); + $this->ciphertext = $var; + + return $this; + } + + /** + * Optional. An optional CRC32C checksum of the + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) + * is equal to + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getCiphertextCrc32C() + { + return $this->ciphertext_crc32c; + } + + public function hasCiphertextCrc32C() + { + return isset($this->ciphertext_crc32c); + } + + public function clearCiphertextCrc32C() + { + unset($this->ciphertext_crc32c); + } + + /** + * Returns the unboxed value from getCiphertextCrc32C() + + * Optional. An optional CRC32C checksum of the + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) + * is equal to + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getCiphertextCrc32CUnwrapped() + { + return $this->readWrapperValue("ciphertext_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) + * is equal to + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setCiphertextCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->ciphertext_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) + * is equal to + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setCiphertextCrc32CUnwrapped($var) + { + $this->writeWrapperValue("ciphertext_crc32c", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptResponse.php new file mode 100644 index 000000000000..a50201e6aac9 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptResponse.php @@ -0,0 +1,339 @@ +google.cloud.kms.v1.AsymmetricDecryptResponse + */ +class AsymmetricDecryptResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The decrypted data originally encrypted with the matching public key. + * + * Generated from protobuf field bytes plaintext = 1; + */ + protected $plaintext = ''; + /** + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. + * An integrity check of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + */ + protected $plaintext_crc32c = null; + /** + * Integrity verification field. A flag indicating whether + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. A + * false value of this field indicates either that + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_ciphertext_crc32c = 3; + */ + protected $verified_ciphertext_crc32c = false; + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; + */ + protected $protection_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $plaintext + * The decrypted data originally encrypted with the matching public key. + * @type \Google\Protobuf\Int64Value $plaintext_crc32c + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. + * An integrity check of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * @type bool $verified_ciphertext_crc32c + * Integrity verification field. A flag indicating whether + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. A + * false value of this field indicates either that + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type int $protection_level + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The decrypted data originally encrypted with the matching public key. + * + * Generated from protobuf field bytes plaintext = 1; + * @return string + */ + public function getPlaintext() + { + return $this->plaintext; + } + + /** + * The decrypted data originally encrypted with the matching public key. + * + * Generated from protobuf field bytes plaintext = 1; + * @param string $var + * @return $this + */ + public function setPlaintext($var) + { + GPBUtil::checkString($var, False); + $this->plaintext = $var; + + return $this; + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. + * An integrity check of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @return \Google\Protobuf\Int64Value|null + */ + public function getPlaintextCrc32C() + { + return $this->plaintext_crc32c; + } + + public function hasPlaintextCrc32C() + { + return isset($this->plaintext_crc32c); + } + + public function clearPlaintextCrc32C() + { + unset($this->plaintext_crc32c); + } + + /** + * Returns the unboxed value from getPlaintextCrc32C() + + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. + * An integrity check of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @return int|string|null + */ + public function getPlaintextCrc32CUnwrapped() + { + return $this->readWrapperValue("plaintext_crc32c"); + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. + * An integrity check of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setPlaintextCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->plaintext_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. + * An integrity check of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @param int|string|null $var + * @return $this + */ + public function setPlaintextCrc32CUnwrapped($var) + { + $this->writeWrapperValue("plaintext_crc32c", $var); + return $this;} + + /** + * Integrity verification field. A flag indicating whether + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. A + * false value of this field indicates either that + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_ciphertext_crc32c = 3; + * @return bool + */ + public function getVerifiedCiphertextCrc32C() + { + return $this->verified_ciphertext_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. A + * false value of this field indicates either that + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_ciphertext_crc32c = 3; + * @param bool $var + * @return $this + */ + public function setVerifiedCiphertextCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_ciphertext_crc32c = $var; + + return $this; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignRequest.php new file mode 100644 index 000000000000..2dae2bd9fd19 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignRequest.php @@ -0,0 +1,568 @@ +google.cloud.kms.v1.AsymmetricSignRequest + */ +class AsymmetricSignRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The digest of the data to sign. The digest must be produced with + * the same digest algorithm as specified by the key version's + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. + * This field may not be supplied if + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * is supplied. + * + * Generated from protobuf field .google.cloud.kms.v1.Digest digest = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $digest = null; + /** + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) + * is equal to + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value digest_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $digest_crc32c = null; + /** + * Optional. The data to sign. + * It can't be supplied if + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * is supplied. + * + * Generated from protobuf field bytes data = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $data = ''; + /** + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) + * is equal to + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $data_crc32c = null; + + /** + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. Please see + * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. + * @param \Google\Cloud\Kms\V1\Digest $digest Optional. The digest of the data to sign. The digest must be produced with + * the same digest algorithm as specified by the key version's + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. + * + * This field may not be supplied if + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * is supplied. + * + * @return \Google\Cloud\Kms\V1\AsymmetricSignRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\Kms\V1\Digest $digest): self + { + return (new self()) + ->setName($name) + ->setDigest($digest); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. + * @type \Google\Cloud\Kms\V1\Digest $digest + * Optional. The digest of the data to sign. The digest must be produced with + * the same digest algorithm as specified by the key version's + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. + * This field may not be supplied if + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * is supplied. + * @type \Google\Protobuf\Int64Value $digest_crc32c + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) + * is equal to + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type string $data + * Optional. The data to sign. + * It can't be supplied if + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * is supplied. + * @type \Google\Protobuf\Int64Value $data_crc32c + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) + * is equal to + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. + * + * 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 + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The digest of the data to sign. The digest must be produced with + * the same digest algorithm as specified by the key version's + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. + * This field may not be supplied if + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * is supplied. + * + * Generated from protobuf field .google.cloud.kms.v1.Digest digest = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Kms\V1\Digest|null + */ + public function getDigest() + { + return $this->digest; + } + + public function hasDigest() + { + return isset($this->digest); + } + + public function clearDigest() + { + unset($this->digest); + } + + /** + * Optional. The digest of the data to sign. The digest must be produced with + * the same digest algorithm as specified by the key version's + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. + * This field may not be supplied if + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * is supplied. + * + * Generated from protobuf field .google.cloud.kms.v1.Digest digest = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Kms\V1\Digest $var + * @return $this + */ + public function setDigest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\Digest::class); + $this->digest = $var; + + return $this; + } + + /** + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) + * is equal to + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value digest_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getDigestCrc32C() + { + return $this->digest_crc32c; + } + + public function hasDigestCrc32C() + { + return isset($this->digest_crc32c); + } + + public function clearDigestCrc32C() + { + unset($this->digest_crc32c); + } + + /** + * Returns the unboxed value from getDigestCrc32C() + + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) + * is equal to + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value digest_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getDigestCrc32CUnwrapped() + { + return $this->readWrapperValue("digest_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) + * is equal to + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value digest_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setDigestCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->digest_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) + * is equal to + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value digest_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setDigestCrc32CUnwrapped($var) + { + $this->writeWrapperValue("digest_crc32c", $var); + return $this;} + + /** + * Optional. The data to sign. + * It can't be supplied if + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * is supplied. + * + * Generated from protobuf field bytes data = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getData() + { + return $this->data; + } + + /** + * Optional. The data to sign. + * It can't be supplied if + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * is supplied. + * + * Generated from protobuf field bytes data = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkString($var, False); + $this->data = $var; + + return $this; + } + + /** + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) + * is equal to + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getDataCrc32C() + { + return $this->data_crc32c; + } + + public function hasDataCrc32C() + { + return isset($this->data_crc32c); + } + + public function clearDataCrc32C() + { + unset($this->data_crc32c); + } + + /** + * Returns the unboxed value from getDataCrc32C() + + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) + * is equal to + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getDataCrc32CUnwrapped() + { + return $this->readWrapperValue("data_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) + * is equal to + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setDataCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->data_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) + * is equal to + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setDataCrc32CUnwrapped($var) + { + $this->writeWrapperValue("data_crc32c", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignResponse.php new file mode 100644 index 000000000000..efec99a14768 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignResponse.php @@ -0,0 +1,463 @@ +google.cloud.kms.v1.AsymmetricSignResponse + */ +class AsymmetricSignResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The created signature. + * + * Generated from protobuf field bytes signature = 1; + */ + protected $signature = ''; + /** + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. + * An integrity check of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * can be performed by computing the CRC32C checksum of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value signature_crc32c = 2; + */ + protected $signature_crc32c = null; + /** + * Integrity verification field. A flag indicating whether + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. A false value + * of this field indicates either that + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_digest_crc32c = 3; + */ + protected $verified_digest_crc32c = false; + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * Check this field to verify that the intended resource was used for signing. + * + * Generated from protobuf field string name = 4; + */ + protected $name = ''; + /** + * Integrity verification field. A flag indicating whether + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.AsymmetricSignRequest.data]. A false value of + * this field indicates either that + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_data_crc32c = 5; + */ + protected $verified_data_crc32c = false; + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; + */ + protected $protection_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $signature + * The created signature. + * @type \Google\Protobuf\Int64Value $signature_crc32c + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. + * An integrity check of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * can be performed by computing the CRC32C checksum of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * @type bool $verified_digest_crc32c + * Integrity verification field. A flag indicating whether + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. A false value + * of this field indicates either that + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type string $name + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * Check this field to verify that the intended resource was used for signing. + * @type bool $verified_data_crc32c + * Integrity verification field. A flag indicating whether + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.AsymmetricSignRequest.data]. A false value of + * this field indicates either that + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type int $protection_level + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The created signature. + * + * Generated from protobuf field bytes signature = 1; + * @return string + */ + public function getSignature() + { + return $this->signature; + } + + /** + * The created signature. + * + * Generated from protobuf field bytes signature = 1; + * @param string $var + * @return $this + */ + public function setSignature($var) + { + GPBUtil::checkString($var, False); + $this->signature = $var; + + return $this; + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. + * An integrity check of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * can be performed by computing the CRC32C checksum of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value signature_crc32c = 2; + * @return \Google\Protobuf\Int64Value|null + */ + public function getSignatureCrc32C() + { + return $this->signature_crc32c; + } + + public function hasSignatureCrc32C() + { + return isset($this->signature_crc32c); + } + + public function clearSignatureCrc32C() + { + unset($this->signature_crc32c); + } + + /** + * Returns the unboxed value from getSignatureCrc32C() + + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. + * An integrity check of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * can be performed by computing the CRC32C checksum of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value signature_crc32c = 2; + * @return int|string|null + */ + public function getSignatureCrc32CUnwrapped() + { + return $this->readWrapperValue("signature_crc32c"); + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. + * An integrity check of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * can be performed by computing the CRC32C checksum of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value signature_crc32c = 2; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setSignatureCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->signature_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Integrity verification field. A CRC32C checksum of the returned + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. + * An integrity check of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * can be performed by computing the CRC32C checksum of + * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value signature_crc32c = 2; + * @param int|string|null $var + * @return $this + */ + public function setSignatureCrc32CUnwrapped($var) + { + $this->writeWrapperValue("signature_crc32c", $var); + return $this;} + + /** + * Integrity verification field. A flag indicating whether + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. A false value + * of this field indicates either that + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_digest_crc32c = 3; + * @return bool + */ + public function getVerifiedDigestCrc32C() + { + return $this->verified_digest_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. A false value + * of this field indicates either that + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_digest_crc32c = 3; + * @param bool $var + * @return $this + */ + public function setVerifiedDigestCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_digest_crc32c = $var; + + return $this; + } + + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * Check this field to verify that the intended resource was used for signing. + * + * Generated from protobuf field string name = 4; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * Check this field to verify that the intended resource was used for signing. + * + * Generated from protobuf field string name = 4; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Integrity verification field. A flag indicating whether + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.AsymmetricSignRequest.data]. A false value of + * this field indicates either that + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_data_crc32c = 5; + * @return bool + */ + public function getVerifiedDataCrc32C() + { + return $this->verified_data_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.AsymmetricSignRequest.data]. A false value of + * this field indicates either that + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_data_crc32c = 5; + * @param bool $var + * @return $this + */ + public function setVerifiedDataCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_data_crc32c = $var; + + return $this; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Certificate.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Certificate.php new file mode 100644 index 000000000000..db653c93c4a9 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Certificate.php @@ -0,0 +1,388 @@ +google.cloud.kms.v1.Certificate + */ +class Certificate extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The raw certificate bytes in DER format. + * + * Generated from protobuf field bytes raw_der = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $raw_der = ''; + /** + * Output only. True if the certificate was parsed successfully. + * + * Generated from protobuf field bool parsed = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $parsed = false; + /** + * Output only. The issuer distinguished name in RFC 2253 format. Only present + * if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string issuer = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $issuer = ''; + /** + * Output only. The subject distinguished name in RFC 2253 format. Only + * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string subject = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $subject = ''; + /** + * Output only. The subject Alternative DNS names. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field repeated string subject_alternative_dns_names = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $subject_alternative_dns_names; + /** + * Output only. The certificate is not valid before this time. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field .google.protobuf.Timestamp not_before_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $not_before_time = null; + /** + * Output only. The certificate is not valid after this time. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field .google.protobuf.Timestamp not_after_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $not_after_time = null; + /** + * Output only. The certificate serial number as a hex string. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string serial_number = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $serial_number = ''; + /** + * Output only. The SHA-256 certificate fingerprint as a hex string. Only + * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string sha256_fingerprint = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $sha256_fingerprint = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $raw_der + * Required. The raw certificate bytes in DER format. + * @type bool $parsed + * Output only. True if the certificate was parsed successfully. + * @type string $issuer + * Output only. The issuer distinguished name in RFC 2253 format. Only present + * if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * @type string $subject + * Output only. The subject distinguished name in RFC 2253 format. Only + * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * @type array|\Google\Protobuf\Internal\RepeatedField $subject_alternative_dns_names + * Output only. The subject Alternative DNS names. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * @type \Google\Protobuf\Timestamp $not_before_time + * Output only. The certificate is not valid before this time. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * @type \Google\Protobuf\Timestamp $not_after_time + * Output only. The certificate is not valid after this time. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * @type string $serial_number + * Output only. The certificate serial number as a hex string. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * @type string $sha256_fingerprint + * Output only. The SHA-256 certificate fingerprint as a hex string. Only + * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The raw certificate bytes in DER format. + * + * Generated from protobuf field bytes raw_der = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRawDer() + { + return $this->raw_der; + } + + /** + * Required. The raw certificate bytes in DER format. + * + * Generated from protobuf field bytes raw_der = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRawDer($var) + { + GPBUtil::checkString($var, False); + $this->raw_der = $var; + + return $this; + } + + /** + * Output only. True if the certificate was parsed successfully. + * + * Generated from protobuf field bool parsed = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getParsed() + { + return $this->parsed; + } + + /** + * Output only. True if the certificate was parsed successfully. + * + * Generated from protobuf field bool parsed = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setParsed($var) + { + GPBUtil::checkBool($var); + $this->parsed = $var; + + return $this; + } + + /** + * Output only. The issuer distinguished name in RFC 2253 format. Only present + * if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string issuer = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIssuer() + { + return $this->issuer; + } + + /** + * Output only. The issuer distinguished name in RFC 2253 format. Only present + * if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string issuer = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIssuer($var) + { + GPBUtil::checkString($var, True); + $this->issuer = $var; + + return $this; + } + + /** + * Output only. The subject distinguished name in RFC 2253 format. Only + * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string subject = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSubject() + { + return $this->subject; + } + + /** + * Output only. The subject distinguished name in RFC 2253 format. Only + * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string subject = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSubject($var) + { + GPBUtil::checkString($var, True); + $this->subject = $var; + + return $this; + } + + /** + * Output only. The subject Alternative DNS names. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field repeated string subject_alternative_dns_names = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubjectAlternativeDnsNames() + { + return $this->subject_alternative_dns_names; + } + + /** + * Output only. The subject Alternative DNS names. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field repeated string subject_alternative_dns_names = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubjectAlternativeDnsNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->subject_alternative_dns_names = $arr; + + return $this; + } + + /** + * Output only. The certificate is not valid before this time. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field .google.protobuf.Timestamp not_before_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getNotBeforeTime() + { + return $this->not_before_time; + } + + public function hasNotBeforeTime() + { + return isset($this->not_before_time); + } + + public function clearNotBeforeTime() + { + unset($this->not_before_time); + } + + /** + * Output only. The certificate is not valid before this time. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field .google.protobuf.Timestamp not_before_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setNotBeforeTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->not_before_time = $var; + + return $this; + } + + /** + * Output only. The certificate is not valid after this time. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field .google.protobuf.Timestamp not_after_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getNotAfterTime() + { + return $this->not_after_time; + } + + public function hasNotAfterTime() + { + return isset($this->not_after_time); + } + + public function clearNotAfterTime() + { + unset($this->not_after_time); + } + + /** + * Output only. The certificate is not valid after this time. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field .google.protobuf.Timestamp not_after_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setNotAfterTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->not_after_time = $var; + + return $this; + } + + /** + * Output only. The certificate serial number as a hex string. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string serial_number = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSerialNumber() + { + return $this->serial_number; + } + + /** + * Output only. The certificate serial number as a hex string. Only present if + * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string serial_number = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSerialNumber($var) + { + GPBUtil::checkString($var, True); + $this->serial_number = $var; + + return $this; + } + + /** + * Output only. The SHA-256 certificate fingerprint as a hex string. Only + * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string sha256_fingerprint = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSha256Fingerprint() + { + return $this->sha256_fingerprint; + } + + /** + * Output only. The SHA-256 certificate fingerprint as a hex string. Only + * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. + * + * Generated from protobuf field string sha256_fingerprint = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSha256Fingerprint($var) + { + GPBUtil::checkString($var, True); + $this->sha256_fingerprint = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyRequest.php new file mode 100644 index 000000000000..2eefa5ea5baa --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyRequest.php @@ -0,0 +1,241 @@ +google.cloud.kms.v1.CreateCryptoKeyRequest + */ +class CreateCryptoKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing + * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * + * Generated from protobuf field string crypto_key_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $crypto_key_id = ''; + /** + * Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $crypto_key = null; + /** + * If set to true, the request will create a + * [CryptoKey][google.cloud.kms.v1.CryptoKey] without any + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must + * manually call + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * or + * [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion] + * before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * Generated from protobuf field bool skip_initial_version_creation = 5; + */ + protected $skip_initial_version_creation = false; + + /** + * @param string $parent Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing + * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. Please see + * {@see KeyManagementServiceClient::keyRingName()} for help formatting this field. + * @param string $cryptoKeyId Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param \Google\Cloud\Kms\V1\CryptoKey $cryptoKey Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field + * values. + * + * @return \Google\Cloud\Kms\V1\CreateCryptoKeyRequest + * + * @experimental + */ + public static function build(string $parent, string $cryptoKeyId, \Google\Cloud\Kms\V1\CryptoKey $cryptoKey): self + { + return (new self()) + ->setParent($parent) + ->setCryptoKeyId($cryptoKeyId) + ->setCryptoKey($cryptoKey); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing + * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * @type string $crypto_key_id + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @type \Google\Cloud\Kms\V1\CryptoKey $crypto_key + * Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field + * values. + * @type bool $skip_initial_version_creation + * If set to true, the request will create a + * [CryptoKey][google.cloud.kms.v1.CryptoKey] without any + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must + * manually call + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * or + * [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion] + * before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing + * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing + * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * + * 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. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * + * Generated from protobuf field string crypto_key_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCryptoKeyId() + { + return $this->crypto_key_id; + } + + /** + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * + * Generated from protobuf field string crypto_key_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCryptoKeyId($var) + { + GPBUtil::checkString($var, True); + $this->crypto_key_id = $var; + + return $this; + } + + /** + * Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Kms\V1\CryptoKey|null + */ + public function getCryptoKey() + { + return $this->crypto_key; + } + + public function hasCryptoKey() + { + return isset($this->crypto_key); + } + + public function clearCryptoKey() + { + unset($this->crypto_key); + } + + /** + * Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Kms\V1\CryptoKey $var + * @return $this + */ + public function setCryptoKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKey::class); + $this->crypto_key = $var; + + return $this; + } + + /** + * If set to true, the request will create a + * [CryptoKey][google.cloud.kms.v1.CryptoKey] without any + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must + * manually call + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * or + * [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion] + * before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * Generated from protobuf field bool skip_initial_version_creation = 5; + * @return bool + */ + public function getSkipInitialVersionCreation() + { + return $this->skip_initial_version_creation; + } + + /** + * If set to true, the request will create a + * [CryptoKey][google.cloud.kms.v1.CryptoKey] without any + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must + * manually call + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * or + * [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion] + * before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * Generated from protobuf field bool skip_initial_version_creation = 5; + * @param bool $var + * @return $this + */ + public function setSkipInitialVersionCreation($var) + { + GPBUtil::checkBool($var); + $this->skip_initial_version_creation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyVersionRequest.php new file mode 100644 index 000000000000..ed1c2af7bf26 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyVersionRequest.php @@ -0,0 +1,143 @@ +google.cloud.kms.v1.CreateCryptoKeyVersionRequest + */ +class CreateCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * initial field values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $crypto_key_version = null; + + /** + * @param string $parent Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. Please see + * {@see KeyManagementServiceClient::cryptoKeyName()} for help formatting this field. + * @param \Google\Cloud\Kms\V1\CryptoKeyVersion $cryptoKeyVersion Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * initial field values. + * + * @return \Google\Cloud\Kms\V1\CreateCryptoKeyVersionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Kms\V1\CryptoKeyVersion $cryptoKeyVersion): self + { + return (new self()) + ->setParent($parent) + ->setCryptoKeyVersion($cryptoKeyVersion); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * @type \Google\Cloud\Kms\V1\CryptoKeyVersion $crypto_key_version + * Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * initial field values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * + * 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. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * initial field values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Kms\V1\CryptoKeyVersion|null + */ + public function getCryptoKeyVersion() + { + return $this->crypto_key_version; + } + + public function hasCryptoKeyVersion() + { + return isset($this->crypto_key_version); + } + + public function clearCryptoKeyVersion() + { + unset($this->crypto_key_version); + } + + /** + * Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * initial field values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Kms\V1\CryptoKeyVersion $var + * @return $this + */ + public function setCryptoKeyVersion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKeyVersion::class); + $this->crypto_key_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateEkmConnectionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateEkmConnectionRequest.php new file mode 100644 index 000000000000..0b087b989419 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateEkmConnectionRequest.php @@ -0,0 +1,184 @@ +google.cloud.kms.v1.CreateEkmConnectionRequest + */ +class CreateEkmConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the location associated with the + * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format + * `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}`. + * + * Generated from protobuf field string ekm_connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ekm_connection_id = ''; + /** + * Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with + * initial field values. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ekm_connection = null; + + /** + * @param string $parent Required. The resource name of the location associated with the + * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format + * `projects/*/locations/*`. Please see + * {@see EkmServiceClient::locationName()} for help formatting this field. + * @param string $ekmConnectionId Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}`. + * @param \Google\Cloud\Kms\V1\EkmConnection $ekmConnection Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with + * initial field values. + * + * @return \Google\Cloud\Kms\V1\CreateEkmConnectionRequest + * + * @experimental + */ + public static function build(string $parent, string $ekmConnectionId, \Google\Cloud\Kms\V1\EkmConnection $ekmConnection): self + { + return (new self()) + ->setParent($parent) + ->setEkmConnectionId($ekmConnectionId) + ->setEkmConnection($ekmConnection); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the location associated with the + * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format + * `projects/*/locations/*`. + * @type string $ekm_connection_id + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}`. + * @type \Google\Cloud\Kms\V1\EkmConnection $ekm_connection + * Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with + * initial field values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the location associated with the + * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format + * `projects/*/locations/*`. + * + * 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 location associated with the + * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format + * `projects/*/locations/*`. + * + * 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. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}`. + * + * Generated from protobuf field string ekm_connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEkmConnectionId() + { + return $this->ekm_connection_id; + } + + /** + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}`. + * + * Generated from protobuf field string ekm_connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEkmConnectionId($var) + { + GPBUtil::checkString($var, True); + $this->ekm_connection_id = $var; + + return $this; + } + + /** + * Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with + * initial field values. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Kms\V1\EkmConnection|null + */ + public function getEkmConnection() + { + return $this->ekm_connection; + } + + public function hasEkmConnection() + { + return isset($this->ekm_connection); + } + + public function clearEkmConnection() + { + unset($this->ekm_connection); + } + + /** + * Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with + * initial field values. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Kms\V1\EkmConnection $var + * @return $this + */ + public function setEkmConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\EkmConnection::class); + $this->ekm_connection = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateImportJobRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateImportJobRequest.php new file mode 100644 index 000000000000..cf82ffb0e04a --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateImportJobRequest.php @@ -0,0 +1,184 @@ +google.cloud.kms.v1.CreateImportJobRequest + */ +class CreateImportJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the + * [ImportJobs][google.cloud.kms.v1.ImportJob]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * + * Generated from protobuf field string import_job_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $import_job_id = ''; + /** + * Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob import_job = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $import_job = null; + + /** + * @param string $parent Required. The [name][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the + * [ImportJobs][google.cloud.kms.v1.ImportJob]. Please see + * {@see KeyManagementServiceClient::keyRingName()} for help formatting this field. + * @param string $importJobId Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param \Google\Cloud\Kms\V1\ImportJob $importJob Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field + * values. + * + * @return \Google\Cloud\Kms\V1\CreateImportJobRequest + * + * @experimental + */ + public static function build(string $parent, string $importJobId, \Google\Cloud\Kms\V1\ImportJob $importJob): self + { + return (new self()) + ->setParent($parent) + ->setImportJobId($importJobId) + ->setImportJob($importJob); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the + * [ImportJobs][google.cloud.kms.v1.ImportJob]. + * @type string $import_job_id + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @type \Google\Cloud\Kms\V1\ImportJob $import_job + * Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field + * values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the + * [ImportJobs][google.cloud.kms.v1.ImportJob]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the + * [ImportJobs][google.cloud.kms.v1.ImportJob]. + * + * 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. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * + * Generated from protobuf field string import_job_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImportJobId() + { + return $this->import_job_id; + } + + /** + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * + * Generated from protobuf field string import_job_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImportJobId($var) + { + GPBUtil::checkString($var, True); + $this->import_job_id = $var; + + return $this; + } + + /** + * Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob import_job = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Kms\V1\ImportJob|null + */ + public function getImportJob() + { + return $this->import_job; + } + + public function hasImportJob() + { + return isset($this->import_job); + } + + public function clearImportJob() + { + unset($this->import_job); + } + + /** + * Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob import_job = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Kms\V1\ImportJob $var + * @return $this + */ + public function setImportJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\ImportJob::class); + $this->import_job = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateKeyRingRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateKeyRingRequest.php new file mode 100644 index 000000000000..22c6f3b3054f --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateKeyRingRequest.php @@ -0,0 +1,184 @@ +google.cloud.kms.v1.CreateKeyRingRequest + */ +class CreateKeyRingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * + * Generated from protobuf field string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key_ring_id = ''; + /** + * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key_ring = null; + + /** + * @param string $parent Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. Please see + * {@see KeyManagementServiceClient::locationName()} for help formatting this field. + * @param string $keyRingId Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param \Google\Cloud\Kms\V1\KeyRing $keyRing Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field + * values. + * + * @return \Google\Cloud\Kms\V1\CreateKeyRingRequest + * + * @experimental + */ + public static function build(string $parent, string $keyRingId, \Google\Cloud\Kms\V1\KeyRing $keyRing): self + { + return (new self()) + ->setParent($parent) + ->setKeyRingId($keyRingId) + ->setKeyRing($keyRing); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. + * @type string $key_ring_id + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @type \Google\Cloud\Kms\V1\KeyRing $key_ring + * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field + * values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. + * + * 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 location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. + * + * 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. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * + * Generated from protobuf field string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKeyRingId() + { + return $this->key_ring_id; + } + + /** + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * + * Generated from protobuf field string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKeyRingId($var) + { + GPBUtil::checkString($var, True); + $this->key_ring_id = $var; + + return $this; + } + + /** + * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Kms\V1\KeyRing|null + */ + public function getKeyRing() + { + return $this->key_ring; + } + + public function hasKeyRing() + { + return isset($this->key_ring); + } + + public function clearKeyRing() + { + unset($this->key_ring); + } + + /** + * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Kms\V1\KeyRing $var + * @return $this + */ + public function setKeyRing($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\KeyRing::class); + $this->key_ring = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey.php new file mode 100644 index 000000000000..9af72cbcf36d --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey.php @@ -0,0 +1,676 @@ +google.cloud.kms.v1.CryptoKey + */ +class CryptoKey extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name for this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. A copy of the "primary" + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] is given in + * [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be + * updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] + * may have a primary. For other keys, this field will be omitted. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion primary = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $primary = null; + /** + * Immutable. The immutable purpose of this + * [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $purpose = 0; + /** + * Output only. The time at which this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], + * the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] + * support automatic rotation. For other keys, this field must be omitted. + * + * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 7; + */ + protected $next_rotation_time = null; + /** + * A template describing settings for new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances. The + * properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * instances created by either + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * or auto-rotation are controlled by this template. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + protected $version_template = null; + /** + * Labels with user-defined metadata. For more information, see + * [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys). + * + * Generated from protobuf field map labels = 10; + */ + private $labels; + /** + * Immutable. Whether this key may contain imported versions only. + * + * Generated from protobuf field bool import_only = 13 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $import_only = false; + /** + * Immutable. The period of time that versions of this key spend in the + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * state before transitioning to + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + * If not specified at creation time, the default duration is 24 hours. + * + * Generated from protobuf field .google.protobuf.Duration destroy_scheduled_duration = 14 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $destroy_scheduled_duration = null; + /** + * Immutable. The resource name of the backend environment where the key + * material for all [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] + * associated with this [CryptoKey][google.cloud.kms.v1.CryptoKey] reside and + * where all related cryptographic operations are performed. Only applicable + * if [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] have a + * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of + * [EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC], with the + * resource name in the format `projects/*/locations/*/ekmConnections/*`. + * Note, this list is non-exhaustive and may apply to additional + * [ProtectionLevels][google.cloud.kms.v1.ProtectionLevel] in the future. + * + * Generated from protobuf field string crypto_key_backend = 15 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $crypto_key_backend = ''; + protected $rotation_schedule; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name for this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * @type \Google\Cloud\Kms\V1\CryptoKeyVersion $primary + * Output only. A copy of the "primary" + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] is given in + * [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be + * updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] + * may have a primary. For other keys, this field will be omitted. + * @type int $purpose + * Immutable. The immutable purpose of this + * [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time at which this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + * @type \Google\Protobuf\Timestamp $next_rotation_time + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], + * the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] + * support automatic rotation. For other keys, this field must be omitted. + * @type \Google\Protobuf\Duration $rotation_period + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] + * will be advanced by this period when the service automatically rotates a + * key. Must be at least 24 hours and at most 876,000 hours. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is + * set, + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] + * must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] + * support automatic rotation. For other keys, this field must be omitted. + * @type \Google\Cloud\Kms\V1\CryptoKeyVersionTemplate $version_template + * A template describing settings for new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances. The + * properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * instances created by either + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * or auto-rotation are controlled by this template. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels with user-defined metadata. For more information, see + * [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys). + * @type bool $import_only + * Immutable. Whether this key may contain imported versions only. + * @type \Google\Protobuf\Duration $destroy_scheduled_duration + * Immutable. The period of time that versions of this key spend in the + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * state before transitioning to + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + * If not specified at creation time, the default duration is 24 hours. + * @type string $crypto_key_backend + * Immutable. The resource name of the backend environment where the key + * material for all [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] + * associated with this [CryptoKey][google.cloud.kms.v1.CryptoKey] reside and + * where all related cryptographic operations are performed. Only applicable + * if [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] have a + * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of + * [EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC], with the + * resource name in the format `projects/*/locations/*/ekmConnections/*`. + * Note, this list is non-exhaustive and may apply to additional + * [ProtectionLevels][google.cloud.kms.v1.ProtectionLevel] in the future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name for this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * 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 for this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. A copy of the "primary" + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] is given in + * [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be + * updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] + * may have a primary. For other keys, this field will be omitted. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion primary = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Kms\V1\CryptoKeyVersion|null + */ + public function getPrimary() + { + return $this->primary; + } + + public function hasPrimary() + { + return isset($this->primary); + } + + public function clearPrimary() + { + unset($this->primary); + } + + /** + * Output only. A copy of the "primary" + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] is given in + * [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be + * updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] + * may have a primary. For other keys, this field will be omitted. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion primary = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Kms\V1\CryptoKeyVersion $var + * @return $this + */ + public function setPrimary($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKeyVersion::class); + $this->primary = $var; + + return $this; + } + + /** + * Immutable. The immutable purpose of this + * [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getPurpose() + { + return $this->purpose; + } + + /** + * Immutable. The immutable purpose of this + * [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setPurpose($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKey\CryptoKeyPurpose::class); + $this->purpose = $var; + + return $this; + } + + /** + * Output only. The time at which this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time at which this + * [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], + * the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] + * support automatic rotation. For other keys, this field must be omitted. + * + * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getNextRotationTime() + { + return $this->next_rotation_time; + } + + public function hasNextRotationTime() + { + return isset($this->next_rotation_time); + } + + public function clearNextRotationTime() + { + unset($this->next_rotation_time); + } + + /** + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], + * the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] + * support automatic rotation. For other keys, this field must be omitted. + * + * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setNextRotationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->next_rotation_time = $var; + + return $this; + } + + /** + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] + * will be advanced by this period when the service automatically rotates a + * key. Must be at least 24 hours and at most 876,000 hours. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is + * set, + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] + * must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] + * support automatic rotation. For other keys, this field must be omitted. + * + * Generated from protobuf field .google.protobuf.Duration rotation_period = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getRotationPeriod() + { + return $this->readOneof(8); + } + + public function hasRotationPeriod() + { + return $this->hasOneof(8); + } + + /** + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] + * will be advanced by this period when the service automatically rotates a + * key. Must be at least 24 hours and at most 876,000 hours. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is + * set, + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] + * must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] + * support automatic rotation. For other keys, this field must be omitted. + * + * Generated from protobuf field .google.protobuf.Duration rotation_period = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRotationPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * A template describing settings for new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances. The + * properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * instances created by either + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * or auto-rotation are controlled by this template. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + * @return \Google\Cloud\Kms\V1\CryptoKeyVersionTemplate|null + */ + public function getVersionTemplate() + { + return $this->version_template; + } + + public function hasVersionTemplate() + { + return isset($this->version_template); + } + + public function clearVersionTemplate() + { + unset($this->version_template); + } + + /** + * A template describing settings for new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances. The + * properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * instances created by either + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * or auto-rotation are controlled by this template. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + * @param \Google\Cloud\Kms\V1\CryptoKeyVersionTemplate $var + * @return $this + */ + public function setVersionTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKeyVersionTemplate::class); + $this->version_template = $var; + + return $this; + } + + /** + * Labels with user-defined metadata. For more information, see + * [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys). + * + * Generated from protobuf field map labels = 10; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels with user-defined metadata. For more information, see + * [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys). + * + * Generated from protobuf field map labels = 10; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Immutable. Whether this key may contain imported versions only. + * + * Generated from protobuf field bool import_only = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * @return bool + */ + public function getImportOnly() + { + return $this->import_only; + } + + /** + * Immutable. Whether this key may contain imported versions only. + * + * Generated from protobuf field bool import_only = 13 [(.google.api.field_behavior) = IMMUTABLE]; + * @param bool $var + * @return $this + */ + public function setImportOnly($var) + { + GPBUtil::checkBool($var); + $this->import_only = $var; + + return $this; + } + + /** + * Immutable. The period of time that versions of this key spend in the + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * state before transitioning to + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + * If not specified at creation time, the default duration is 24 hours. + * + * Generated from protobuf field .google.protobuf.Duration destroy_scheduled_duration = 14 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Protobuf\Duration|null + */ + public function getDestroyScheduledDuration() + { + return $this->destroy_scheduled_duration; + } + + public function hasDestroyScheduledDuration() + { + return isset($this->destroy_scheduled_duration); + } + + public function clearDestroyScheduledDuration() + { + unset($this->destroy_scheduled_duration); + } + + /** + * Immutable. The period of time that versions of this key spend in the + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * state before transitioning to + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + * If not specified at creation time, the default duration is 24 hours. + * + * Generated from protobuf field .google.protobuf.Duration destroy_scheduled_duration = 14 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDestroyScheduledDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->destroy_scheduled_duration = $var; + + return $this; + } + + /** + * Immutable. The resource name of the backend environment where the key + * material for all [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] + * associated with this [CryptoKey][google.cloud.kms.v1.CryptoKey] reside and + * where all related cryptographic operations are performed. Only applicable + * if [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] have a + * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of + * [EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC], with the + * resource name in the format `projects/*/locations/*/ekmConnections/*`. + * Note, this list is non-exhaustive and may apply to additional + * [ProtectionLevels][google.cloud.kms.v1.ProtectionLevel] in the future. + * + * Generated from protobuf field string crypto_key_backend = 15 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getCryptoKeyBackend() + { + return $this->crypto_key_backend; + } + + /** + * Immutable. The resource name of the backend environment where the key + * material for all [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] + * associated with this [CryptoKey][google.cloud.kms.v1.CryptoKey] reside and + * where all related cryptographic operations are performed. Only applicable + * if [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] have a + * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of + * [EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC], with the + * resource name in the format `projects/*/locations/*/ekmConnections/*`. + * Note, this list is non-exhaustive and may apply to additional + * [ProtectionLevels][google.cloud.kms.v1.ProtectionLevel] in the future. + * + * Generated from protobuf field string crypto_key_backend = 15 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCryptoKeyBackend($var) + { + GPBUtil::checkString($var, True); + $this->crypto_key_backend = $var; + + return $this; + } + + /** + * @return string + */ + public function getRotationSchedule() + { + return $this->whichOneof("rotation_schedule"); + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey/CryptoKeyPurpose.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey/CryptoKeyPurpose.php new file mode 100644 index 000000000000..a941f6337534 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey/CryptoKeyPurpose.php @@ -0,0 +1,104 @@ +google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose + */ +class CryptoKeyPurpose +{ + /** + * Not specified. + * + * Generated from protobuf enum CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0; + */ + const CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0; + /** + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used + * with [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + * + * Generated from protobuf enum ENCRYPT_DECRYPT = 1; + */ + const ENCRYPT_DECRYPT = 1; + /** + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used + * with + * [AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign] + * and + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + * + * Generated from protobuf enum ASYMMETRIC_SIGN = 5; + */ + const ASYMMETRIC_SIGN = 5; + /** + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used + * with + * [AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt] + * and + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + * + * Generated from protobuf enum ASYMMETRIC_DECRYPT = 6; + */ + const ASYMMETRIC_DECRYPT = 6; + /** + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used + * with [RawEncrypt][google.cloud.kms.v1.KeyManagementService.RawEncrypt] + * and [RawDecrypt][google.cloud.kms.v1.KeyManagementService.RawDecrypt]. + * This purpose is meant to be used for interoperable symmetric + * encryption and does not support automatic CryptoKey rotation. + * + * Generated from protobuf enum RAW_ENCRYPT_DECRYPT = 7; + */ + const RAW_ENCRYPT_DECRYPT = 7; + /** + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used + * with [MacSign][google.cloud.kms.v1.KeyManagementService.MacSign]. + * + * Generated from protobuf enum MAC = 9; + */ + const MAC = 9; + + private static $valueToName = [ + self::CRYPTO_KEY_PURPOSE_UNSPECIFIED => 'CRYPTO_KEY_PURPOSE_UNSPECIFIED', + self::ENCRYPT_DECRYPT => 'ENCRYPT_DECRYPT', + self::ASYMMETRIC_SIGN => 'ASYMMETRIC_SIGN', + self::ASYMMETRIC_DECRYPT => 'ASYMMETRIC_DECRYPT', + self::RAW_ENCRYPT_DECRYPT => 'RAW_ENCRYPT_DECRYPT', + self::MAC => 'MAC', + ]; + + 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(CryptoKeyPurpose::class, \Google\Cloud\Kms\V1\CryptoKey_CryptoKeyPurpose::class); + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion.php new file mode 100644 index 000000000000..b88345be44c3 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion.php @@ -0,0 +1,819 @@ +google.cloud.kms.v1.CryptoKeyVersion + */ +class CryptoKeyVersion extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name for this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * The current state of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + */ + protected $state = 0; + /** + * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] + * describing how crypto operations are performed with this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $protection_level = 0; + /** + * Output only. The + * [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * that this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * supports. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $algorithm = 0; + /** + * Output only. Statement that was generated and signed by the HSM at key + * creation time. Use this statement to verify attributes of the key as stored + * on the HSM, independently of Google. Only provided for key versions with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $attestation = null; + /** + * Output only. The time at which this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was + * generated. + * + * Generated from protobuf field .google.protobuf.Timestamp generate_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generate_time = null; + /** + * Output only. The time this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is + * scheduled for destruction. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + * + * Generated from protobuf field .google.protobuf.Timestamp destroy_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $destroy_time = null; + /** + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + * + * Generated from protobuf field .google.protobuf.Timestamp destroy_event_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $destroy_event_time = null; + /** + * Output only. The name of the [ImportJob][google.cloud.kms.v1.ImportJob] + * used in the most recent import of this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only present if + * the underlying key material was imported. + * + * Generated from protobuf field string import_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $import_job = ''; + /** + * Output only. The time at which this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was + * most recently imported. + * + * Generated from protobuf field .google.protobuf.Timestamp import_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $import_time = null; + /** + * Output only. The root cause of the most recent import failure. Only present + * if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED]. + * + * Generated from protobuf field string import_failure_reason = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $import_failure_reason = ''; + /** + * Output only. The root cause of the most recent generation failure. Only + * present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [GENERATION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.GENERATION_FAILED]. + * + * Generated from protobuf field string generation_failure_reason = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation_failure_reason = ''; + /** + * Output only. The root cause of the most recent external destruction + * failure. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [EXTERNAL_DESTRUCTION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.EXTERNAL_DESTRUCTION_FAILED]. + * + * Generated from protobuf field string external_destruction_failure_reason = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $external_destruction_failure_reason = ''; + /** + * ExternalProtectionLevelOptions stores a group of additional fields for + * configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that + * are specific to the + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] protection level + * and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] + * protection levels. + * + * Generated from protobuf field .google.cloud.kms.v1.ExternalProtectionLevelOptions external_protection_level_options = 17; + */ + protected $external_protection_level_options = null; + /** + * Output only. Whether or not this key version is eligible for reimport, by + * being specified as a target in + * [ImportCryptoKeyVersionRequest.crypto_key_version][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.crypto_key_version]. + * + * Generated from protobuf field bool reimport_eligible = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reimport_eligible = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name for this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + * @type int $state + * The current state of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * @type int $protection_level + * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] + * describing how crypto operations are performed with this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * @type int $algorithm + * Output only. The + * [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * that this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * supports. + * @type \Google\Cloud\Kms\V1\KeyOperationAttestation $attestation + * Output only. Statement that was generated and signed by the HSM at key + * creation time. Use this statement to verify attributes of the key as stored + * on the HSM, independently of Google. Only provided for key versions with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time at which this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + * @type \Google\Protobuf\Timestamp $generate_time + * Output only. The time this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was + * generated. + * @type \Google\Protobuf\Timestamp $destroy_time + * Output only. The time this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is + * scheduled for destruction. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + * @type \Google\Protobuf\Timestamp $destroy_event_time + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + * @type string $import_job + * Output only. The name of the [ImportJob][google.cloud.kms.v1.ImportJob] + * used in the most recent import of this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only present if + * the underlying key material was imported. + * @type \Google\Protobuf\Timestamp $import_time + * Output only. The time at which this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was + * most recently imported. + * @type string $import_failure_reason + * Output only. The root cause of the most recent import failure. Only present + * if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED]. + * @type string $generation_failure_reason + * Output only. The root cause of the most recent generation failure. Only + * present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [GENERATION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.GENERATION_FAILED]. + * @type string $external_destruction_failure_reason + * Output only. The root cause of the most recent external destruction + * failure. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [EXTERNAL_DESTRUCTION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.EXTERNAL_DESTRUCTION_FAILED]. + * @type \Google\Cloud\Kms\V1\ExternalProtectionLevelOptions $external_protection_level_options + * ExternalProtectionLevelOptions stores a group of additional fields for + * configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that + * are specific to the + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] protection level + * and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] + * protection levels. + * @type bool $reimport_eligible + * Output only. Whether or not this key version is eligible for reimport, by + * being specified as a target in + * [ImportCryptoKeyVersionRequest.crypto_key_version][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.crypto_key_version]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name for this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + * + * 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 for this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + * + * 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; + } + + /** + * The current state of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The current state of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionState::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] + * describing how crypto operations are performed with this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] + * describing how crypto operations are performed with this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + + /** + * Output only. The + * [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * that this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * supports. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getAlgorithm() + { + return $this->algorithm; + } + + /** + * Output only. The + * [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * that this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * supports. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setAlgorithm($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionAlgorithm::class); + $this->algorithm = $var; + + return $this; + } + + /** + * Output only. Statement that was generated and signed by the HSM at key + * creation time. Use this statement to verify attributes of the key as stored + * on the HSM, independently of Google. Only provided for key versions with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Kms\V1\KeyOperationAttestation|null + */ + public function getAttestation() + { + return $this->attestation; + } + + public function hasAttestation() + { + return isset($this->attestation); + } + + public function clearAttestation() + { + unset($this->attestation); + } + + /** + * Output only. Statement that was generated and signed by the HSM at key + * creation time. Use this statement to verify attributes of the key as stored + * on the HSM, independently of Google. Only provided for key versions with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Kms\V1\KeyOperationAttestation $var + * @return $this + */ + public function setAttestation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\KeyOperationAttestation::class); + $this->attestation = $var; + + return $this; + } + + /** + * Output only. The time at which this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time at which this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was + * generated. + * + * Generated from protobuf field .google.protobuf.Timestamp generate_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getGenerateTime() + { + return $this->generate_time; + } + + public function hasGenerateTime() + { + return isset($this->generate_time); + } + + public function clearGenerateTime() + { + unset($this->generate_time); + } + + /** + * Output only. The time this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was + * generated. + * + * Generated from protobuf field .google.protobuf.Timestamp generate_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setGenerateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->generate_time = $var; + + return $this; + } + + /** + * Output only. The time this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is + * scheduled for destruction. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + * + * Generated from protobuf field .google.protobuf.Timestamp destroy_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDestroyTime() + { + return $this->destroy_time; + } + + public function hasDestroyTime() + { + return isset($this->destroy_time); + } + + public function clearDestroyTime() + { + unset($this->destroy_time); + } + + /** + * Output only. The time this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is + * scheduled for destruction. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + * + * Generated from protobuf field .google.protobuf.Timestamp destroy_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDestroyTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->destroy_time = $var; + + return $this; + } + + /** + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + * + * Generated from protobuf field .google.protobuf.Timestamp destroy_event_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDestroyEventTime() + { + return $this->destroy_event_time; + } + + public function hasDestroyEventTime() + { + return isset($this->destroy_event_time); + } + + public function clearDestroyEventTime() + { + unset($this->destroy_event_time); + } + + /** + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + * + * Generated from protobuf field .google.protobuf.Timestamp destroy_event_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDestroyEventTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->destroy_event_time = $var; + + return $this; + } + + /** + * Output only. The name of the [ImportJob][google.cloud.kms.v1.ImportJob] + * used in the most recent import of this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only present if + * the underlying key material was imported. + * + * Generated from protobuf field string import_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getImportJob() + { + return $this->import_job; + } + + /** + * Output only. The name of the [ImportJob][google.cloud.kms.v1.ImportJob] + * used in the most recent import of this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only present if + * the underlying key material was imported. + * + * Generated from protobuf field string import_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setImportJob($var) + { + GPBUtil::checkString($var, True); + $this->import_job = $var; + + return $this; + } + + /** + * Output only. The time at which this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was + * most recently imported. + * + * Generated from protobuf field .google.protobuf.Timestamp import_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getImportTime() + { + return $this->import_time; + } + + public function hasImportTime() + { + return isset($this->import_time); + } + + public function clearImportTime() + { + unset($this->import_time); + } + + /** + * Output only. The time at which this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was + * most recently imported. + * + * Generated from protobuf field .google.protobuf.Timestamp import_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setImportTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->import_time = $var; + + return $this; + } + + /** + * Output only. The root cause of the most recent import failure. Only present + * if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED]. + * + * Generated from protobuf field string import_failure_reason = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getImportFailureReason() + { + return $this->import_failure_reason; + } + + /** + * Output only. The root cause of the most recent import failure. Only present + * if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED]. + * + * Generated from protobuf field string import_failure_reason = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setImportFailureReason($var) + { + GPBUtil::checkString($var, True); + $this->import_failure_reason = $var; + + return $this; + } + + /** + * Output only. The root cause of the most recent generation failure. Only + * present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [GENERATION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.GENERATION_FAILED]. + * + * Generated from protobuf field string generation_failure_reason = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getGenerationFailureReason() + { + return $this->generation_failure_reason; + } + + /** + * Output only. The root cause of the most recent generation failure. Only + * present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [GENERATION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.GENERATION_FAILED]. + * + * Generated from protobuf field string generation_failure_reason = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setGenerationFailureReason($var) + { + GPBUtil::checkString($var, True); + $this->generation_failure_reason = $var; + + return $this; + } + + /** + * Output only. The root cause of the most recent external destruction + * failure. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [EXTERNAL_DESTRUCTION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.EXTERNAL_DESTRUCTION_FAILED]. + * + * Generated from protobuf field string external_destruction_failure_reason = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getExternalDestructionFailureReason() + { + return $this->external_destruction_failure_reason; + } + + /** + * Output only. The root cause of the most recent external destruction + * failure. Only present if + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [EXTERNAL_DESTRUCTION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.EXTERNAL_DESTRUCTION_FAILED]. + * + * Generated from protobuf field string external_destruction_failure_reason = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setExternalDestructionFailureReason($var) + { + GPBUtil::checkString($var, True); + $this->external_destruction_failure_reason = $var; + + return $this; + } + + /** + * ExternalProtectionLevelOptions stores a group of additional fields for + * configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that + * are specific to the + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] protection level + * and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] + * protection levels. + * + * Generated from protobuf field .google.cloud.kms.v1.ExternalProtectionLevelOptions external_protection_level_options = 17; + * @return \Google\Cloud\Kms\V1\ExternalProtectionLevelOptions|null + */ + public function getExternalProtectionLevelOptions() + { + return $this->external_protection_level_options; + } + + public function hasExternalProtectionLevelOptions() + { + return isset($this->external_protection_level_options); + } + + public function clearExternalProtectionLevelOptions() + { + unset($this->external_protection_level_options); + } + + /** + * ExternalProtectionLevelOptions stores a group of additional fields for + * configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that + * are specific to the + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] protection level + * and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] + * protection levels. + * + * Generated from protobuf field .google.cloud.kms.v1.ExternalProtectionLevelOptions external_protection_level_options = 17; + * @param \Google\Cloud\Kms\V1\ExternalProtectionLevelOptions $var + * @return $this + */ + public function setExternalProtectionLevelOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\ExternalProtectionLevelOptions::class); + $this->external_protection_level_options = $var; + + return $this; + } + + /** + * Output only. Whether or not this key version is eligible for reimport, by + * being specified as a target in + * [ImportCryptoKeyVersionRequest.crypto_key_version][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.crypto_key_version]. + * + * Generated from protobuf field bool reimport_eligible = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReimportEligible() + { + return $this->reimport_eligible; + } + + /** + * Output only. Whether or not this key version is eligible for reimport, by + * being specified as a target in + * [ImportCryptoKeyVersionRequest.crypto_key_version][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.crypto_key_version]. + * + * Generated from protobuf field bool reimport_eligible = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReimportEligible($var) + { + GPBUtil::checkBool($var); + $this->reimport_eligible = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php new file mode 100644 index 000000000000..3b16f37eba2e --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php @@ -0,0 +1,328 @@ +google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm + */ +class CryptoKeyVersionAlgorithm +{ + /** + * Not specified. + * + * Generated from protobuf enum CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0; + */ + const CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0; + /** + * Creates symmetric encryption keys. + * + * Generated from protobuf enum GOOGLE_SYMMETRIC_ENCRYPTION = 1; + */ + const GOOGLE_SYMMETRIC_ENCRYPTION = 1; + /** + * AES-GCM (Galois Counter Mode) using 128-bit keys. + * + * Generated from protobuf enum AES_128_GCM = 41; + */ + const AES_128_GCM = 41; + /** + * AES-GCM (Galois Counter Mode) using 256-bit keys. + * + * Generated from protobuf enum AES_256_GCM = 19; + */ + const AES_256_GCM = 19; + /** + * AES-CBC (Cipher Block Chaining Mode) using 128-bit keys. + * + * Generated from protobuf enum AES_128_CBC = 42; + */ + const AES_128_CBC = 42; + /** + * AES-CBC (Cipher Block Chaining Mode) using 256-bit keys. + * + * Generated from protobuf enum AES_256_CBC = 43; + */ + const AES_256_CBC = 43; + /** + * AES-CTR (Counter Mode) using 128-bit keys. + * + * Generated from protobuf enum AES_128_CTR = 44; + */ + const AES_128_CTR = 44; + /** + * AES-CTR (Counter Mode) using 256-bit keys. + * + * Generated from protobuf enum AES_256_CTR = 45; + */ + const AES_256_CTR = 45; + /** + * RSASSA-PSS 2048 bit key with a SHA256 digest. + * + * Generated from protobuf enum RSA_SIGN_PSS_2048_SHA256 = 2; + */ + const RSA_SIGN_PSS_2048_SHA256 = 2; + /** + * RSASSA-PSS 3072 bit key with a SHA256 digest. + * + * Generated from protobuf enum RSA_SIGN_PSS_3072_SHA256 = 3; + */ + const RSA_SIGN_PSS_3072_SHA256 = 3; + /** + * RSASSA-PSS 4096 bit key with a SHA256 digest. + * + * Generated from protobuf enum RSA_SIGN_PSS_4096_SHA256 = 4; + */ + const RSA_SIGN_PSS_4096_SHA256 = 4; + /** + * RSASSA-PSS 4096 bit key with a SHA512 digest. + * + * Generated from protobuf enum RSA_SIGN_PSS_4096_SHA512 = 15; + */ + const RSA_SIGN_PSS_4096_SHA512 = 15; + /** + * 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 = 16; + */ + const RSA_SIGN_PKCS1_4096_SHA512 = 16; + /** + * RSASSA-PKCS1-v1_5 signing without encoding, with a 2048 bit key. + * + * Generated from protobuf enum RSA_SIGN_RAW_PKCS1_2048 = 28; + */ + const RSA_SIGN_RAW_PKCS1_2048 = 28; + /** + * RSASSA-PKCS1-v1_5 signing without encoding, with a 3072 bit key. + * + * Generated from protobuf enum RSA_SIGN_RAW_PKCS1_3072 = 29; + */ + const RSA_SIGN_RAW_PKCS1_3072 = 29; + /** + * RSASSA-PKCS1-v1_5 signing without encoding, with a 4096 bit key. + * + * Generated from protobuf enum RSA_SIGN_RAW_PKCS1_4096 = 30; + */ + const RSA_SIGN_RAW_PKCS1_4096 = 30; + /** + * RSAES-OAEP 2048 bit key with a SHA256 digest. + * + * Generated from protobuf enum RSA_DECRYPT_OAEP_2048_SHA256 = 8; + */ + const RSA_DECRYPT_OAEP_2048_SHA256 = 8; + /** + * RSAES-OAEP 3072 bit key with a SHA256 digest. + * + * Generated from protobuf enum RSA_DECRYPT_OAEP_3072_SHA256 = 9; + */ + const RSA_DECRYPT_OAEP_3072_SHA256 = 9; + /** + * RSAES-OAEP 4096 bit key with a SHA256 digest. + * + * Generated from protobuf enum RSA_DECRYPT_OAEP_4096_SHA256 = 10; + */ + const RSA_DECRYPT_OAEP_4096_SHA256 = 10; + /** + * RSAES-OAEP 4096 bit key with a SHA512 digest. + * + * Generated from protobuf enum RSA_DECRYPT_OAEP_4096_SHA512 = 17; + */ + const RSA_DECRYPT_OAEP_4096_SHA512 = 17; + /** + * RSAES-OAEP 2048 bit key with a SHA1 digest. + * + * Generated from protobuf enum RSA_DECRYPT_OAEP_2048_SHA1 = 37; + */ + const RSA_DECRYPT_OAEP_2048_SHA1 = 37; + /** + * RSAES-OAEP 3072 bit key with a SHA1 digest. + * + * Generated from protobuf enum RSA_DECRYPT_OAEP_3072_SHA1 = 38; + */ + const RSA_DECRYPT_OAEP_3072_SHA1 = 38; + /** + * RSAES-OAEP 4096 bit key with a SHA1 digest. + * + * Generated from protobuf enum RSA_DECRYPT_OAEP_4096_SHA1 = 39; + */ + const RSA_DECRYPT_OAEP_4096_SHA1 = 39; + /** + * ECDSA on the NIST P-256 curve with a SHA256 digest. + * Other hash functions can also be used: + * https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms + * + * Generated from protobuf enum EC_SIGN_P256_SHA256 = 12; + */ + const EC_SIGN_P256_SHA256 = 12; + /** + * ECDSA on the NIST P-384 curve with a SHA384 digest. + * Other hash functions can also be used: + * https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms + * + * Generated from protobuf enum EC_SIGN_P384_SHA384 = 13; + */ + const EC_SIGN_P384_SHA384 = 13; + /** + * ECDSA on the non-NIST secp256k1 curve. This curve is only supported for + * HSM protection level. + * Other hash functions can also be used: + * https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms + * + * Generated from protobuf enum EC_SIGN_SECP256K1_SHA256 = 31; + */ + const EC_SIGN_SECP256K1_SHA256 = 31; + /** + * HMAC-SHA256 signing with a 256 bit key. + * + * Generated from protobuf enum HMAC_SHA256 = 32; + */ + const HMAC_SHA256 = 32; + /** + * HMAC-SHA1 signing with a 160 bit key. + * + * Generated from protobuf enum HMAC_SHA1 = 33; + */ + const HMAC_SHA1 = 33; + /** + * HMAC-SHA384 signing with a 384 bit key. + * + * Generated from protobuf enum HMAC_SHA384 = 34; + */ + const HMAC_SHA384 = 34; + /** + * HMAC-SHA512 signing with a 512 bit key. + * + * Generated from protobuf enum HMAC_SHA512 = 35; + */ + const HMAC_SHA512 = 35; + /** + * HMAC-SHA224 signing with a 224 bit key. + * + * Generated from protobuf enum HMAC_SHA224 = 36; + */ + const HMAC_SHA224 = 36; + /** + * Algorithm representing symmetric encryption by an external key manager. + * + * Generated from protobuf enum EXTERNAL_SYMMETRIC_ENCRYPTION = 18; + */ + const EXTERNAL_SYMMETRIC_ENCRYPTION = 18; + + private static $valueToName = [ + self::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED => 'CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED', + self::GOOGLE_SYMMETRIC_ENCRYPTION => 'GOOGLE_SYMMETRIC_ENCRYPTION', + self::AES_128_GCM => 'AES_128_GCM', + self::AES_256_GCM => 'AES_256_GCM', + self::AES_128_CBC => 'AES_128_CBC', + self::AES_256_CBC => 'AES_256_CBC', + self::AES_128_CTR => 'AES_128_CTR', + self::AES_256_CTR => 'AES_256_CTR', + self::RSA_SIGN_PSS_2048_SHA256 => 'RSA_SIGN_PSS_2048_SHA256', + self::RSA_SIGN_PSS_3072_SHA256 => 'RSA_SIGN_PSS_3072_SHA256', + self::RSA_SIGN_PSS_4096_SHA256 => 'RSA_SIGN_PSS_4096_SHA256', + self::RSA_SIGN_PSS_4096_SHA512 => 'RSA_SIGN_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::RSA_SIGN_RAW_PKCS1_2048 => 'RSA_SIGN_RAW_PKCS1_2048', + self::RSA_SIGN_RAW_PKCS1_3072 => 'RSA_SIGN_RAW_PKCS1_3072', + self::RSA_SIGN_RAW_PKCS1_4096 => 'RSA_SIGN_RAW_PKCS1_4096', + self::RSA_DECRYPT_OAEP_2048_SHA256 => 'RSA_DECRYPT_OAEP_2048_SHA256', + self::RSA_DECRYPT_OAEP_3072_SHA256 => 'RSA_DECRYPT_OAEP_3072_SHA256', + self::RSA_DECRYPT_OAEP_4096_SHA256 => 'RSA_DECRYPT_OAEP_4096_SHA256', + self::RSA_DECRYPT_OAEP_4096_SHA512 => 'RSA_DECRYPT_OAEP_4096_SHA512', + self::RSA_DECRYPT_OAEP_2048_SHA1 => 'RSA_DECRYPT_OAEP_2048_SHA1', + self::RSA_DECRYPT_OAEP_3072_SHA1 => 'RSA_DECRYPT_OAEP_3072_SHA1', + self::RSA_DECRYPT_OAEP_4096_SHA1 => 'RSA_DECRYPT_OAEP_4096_SHA1', + self::EC_SIGN_P256_SHA256 => 'EC_SIGN_P256_SHA256', + self::EC_SIGN_P384_SHA384 => 'EC_SIGN_P384_SHA384', + self::EC_SIGN_SECP256K1_SHA256 => 'EC_SIGN_SECP256K1_SHA256', + self::HMAC_SHA256 => 'HMAC_SHA256', + self::HMAC_SHA1 => 'HMAC_SHA1', + self::HMAC_SHA384 => 'HMAC_SHA384', + self::HMAC_SHA512 => 'HMAC_SHA512', + self::HMAC_SHA224 => 'HMAC_SHA224', + self::EXTERNAL_SYMMETRIC_ENCRYPTION => 'EXTERNAL_SYMMETRIC_ENCRYPTION', + ]; + + 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(CryptoKeyVersionAlgorithm::class, \Google\Cloud\Kms\V1\CryptoKeyVersion_CryptoKeyVersionAlgorithm::class); + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionState.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionState.php new file mode 100644 index 000000000000..b4de21be0a7e --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionState.php @@ -0,0 +1,154 @@ +google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState + */ +class CryptoKeyVersionState +{ + /** + * Not specified. + * + * Generated from protobuf enum CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0; + */ + const CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0; + /** + * This version is still being generated. It may not be used, enabled, + * disabled, or destroyed yet. Cloud KMS will automatically mark this + * version + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] + * as soon as the version is ready. + * + * Generated from protobuf enum PENDING_GENERATION = 5; + */ + const PENDING_GENERATION = 5; + /** + * This version may be used for cryptographic operations. + * + * Generated from protobuf enum ENABLED = 1; + */ + const ENABLED = 1; + /** + * This version may not be used, but the key material is still available, + * and the version can be placed back into the + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] + * state. + * + * Generated from protobuf enum DISABLED = 2; + */ + const DISABLED = 2; + /** + * This version is destroyed, and the key material is no longer stored. + * This version may only become + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] + * again if this version is + * [reimport_eligible][google.cloud.kms.v1.CryptoKeyVersion.reimport_eligible] + * and the original key material is reimported with a call to + * [KeyManagementService.ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion]. + * + * Generated from protobuf enum DESTROYED = 3; + */ + const DESTROYED = 3; + /** + * This version is scheduled for destruction, and will be destroyed soon. + * Call + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + * to put it back into the + * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] + * state. + * + * Generated from protobuf enum DESTROY_SCHEDULED = 4; + */ + const DESTROY_SCHEDULED = 4; + /** + * This version is still being imported. It may not be used, enabled, + * disabled, or destroyed yet. Cloud KMS will automatically mark this + * version + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] + * as soon as the version is ready. + * + * Generated from protobuf enum PENDING_IMPORT = 6; + */ + const PENDING_IMPORT = 6; + /** + * This version was not imported successfully. It may not be used, enabled, + * disabled, or destroyed. The submitted key material has been discarded. + * Additional details can be found in + * [CryptoKeyVersion.import_failure_reason][google.cloud.kms.v1.CryptoKeyVersion.import_failure_reason]. + * + * Generated from protobuf enum IMPORT_FAILED = 7; + */ + const IMPORT_FAILED = 7; + /** + * This version was not generated successfully. It may not be used, enabled, + * disabled, or destroyed. Additional details can be found in + * [CryptoKeyVersion.generation_failure_reason][google.cloud.kms.v1.CryptoKeyVersion.generation_failure_reason]. + * + * Generated from protobuf enum GENERATION_FAILED = 8; + */ + const GENERATION_FAILED = 8; + /** + * This version was destroyed, and it may not be used or enabled again. + * Cloud KMS is waiting for the corresponding key material residing in an + * external key manager to be destroyed. + * + * Generated from protobuf enum PENDING_EXTERNAL_DESTRUCTION = 9; + */ + const PENDING_EXTERNAL_DESTRUCTION = 9; + /** + * This version was destroyed, and it may not be used or enabled again. + * However, Cloud KMS could not confirm that the corresponding key material + * residing in an external key manager was destroyed. Additional details can + * be found in + * [CryptoKeyVersion.external_destruction_failure_reason][google.cloud.kms.v1.CryptoKeyVersion.external_destruction_failure_reason]. + * + * Generated from protobuf enum EXTERNAL_DESTRUCTION_FAILED = 10; + */ + const EXTERNAL_DESTRUCTION_FAILED = 10; + + private static $valueToName = [ + self::CRYPTO_KEY_VERSION_STATE_UNSPECIFIED => 'CRYPTO_KEY_VERSION_STATE_UNSPECIFIED', + self::PENDING_GENERATION => 'PENDING_GENERATION', + self::ENABLED => 'ENABLED', + self::DISABLED => 'DISABLED', + self::DESTROYED => 'DESTROYED', + self::DESTROY_SCHEDULED => 'DESTROY_SCHEDULED', + self::PENDING_IMPORT => 'PENDING_IMPORT', + self::IMPORT_FAILED => 'IMPORT_FAILED', + self::GENERATION_FAILED => 'GENERATION_FAILED', + self::PENDING_EXTERNAL_DESTRUCTION => 'PENDING_EXTERNAL_DESTRUCTION', + self::EXTERNAL_DESTRUCTION_FAILED => 'EXTERNAL_DESTRUCTION_FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CryptoKeyVersionState::class, \Google\Cloud\Kms\V1\CryptoKeyVersion_CryptoKeyVersionState::class); + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionView.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionView.php new file mode 100644 index 000000000000..33a471de9ad7 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionView.php @@ -0,0 +1,67 @@ +google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView + */ +class CryptoKeyVersionView +{ + /** + * Default view for each + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Does not + * include the + * [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation] field. + * + * Generated from protobuf enum CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0; + */ + const CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0; + /** + * Provides all fields in each + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], including the + * [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation]. + * + * Generated from protobuf enum FULL = 1; + */ + const FULL = 1; + + private static $valueToName = [ + self::CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED => 'CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED', + self::FULL => 'FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CryptoKeyVersionView::class, \Google\Cloud\Kms\V1\CryptoKeyVersion_CryptoKeyVersionView::class); + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersionTemplate.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersionTemplate.php new file mode 100644 index 000000000000..6f88091103eb --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersionTemplate.php @@ -0,0 +1,150 @@ +google.cloud.kms.v1.CryptoKeyVersionTemplate + */ +class CryptoKeyVersionTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating + * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this + * template. Immutable. Defaults to + * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE]. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + */ + protected $protection_level = 0; + /** + * Required. + * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * to use when creating a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this + * template. + * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both + * this field is omitted and + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $algorithm = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $protection_level + * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating + * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this + * template. Immutable. Defaults to + * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE]. + * @type int $algorithm + * Required. + * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * to use when creating a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this + * template. + * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both + * this field is omitted and + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating + * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this + * template. Immutable. Defaults to + * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE]. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating + * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this + * template. Immutable. Defaults to + * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE]. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + + /** + * Required. + * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * to use when creating a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this + * template. + * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both + * this field is omitted and + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAlgorithm() + { + return $this->algorithm; + } + + /** + * Required. + * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * to use when creating a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this + * template. + * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both + * this field is omitted and + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAlgorithm($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionAlgorithm::class); + $this->algorithm = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptRequest.php new file mode 100644 index 000000000000..86cf3cc753e8 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptRequest.php @@ -0,0 +1,529 @@ +google.cloud.kms.v1.DecryptRequest + */ +class DecryptRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The + * server will choose the appropriate version. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The encrypted data originally returned in + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * + * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ciphertext = ''; + /** + * Optional. Optional data that must match the data originally supplied in + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $additional_authenticated_data = ''; + /** + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) + * is equal to + * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ciphertext_crc32c = null; + /** + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) + * is equal to + * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $additional_authenticated_data_crc32c = null; + + /** + * @param string $name Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The + * server will choose the appropriate version. Please see + * {@see KeyManagementServiceClient::cryptoKeyName()} for help formatting this field. + * @param string $ciphertext Required. The encrypted data originally returned in + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * + * @return \Google\Cloud\Kms\V1\DecryptRequest + * + * @experimental + */ + public static function build(string $name, string $ciphertext): self + { + return (new self()) + ->setName($name) + ->setCiphertext($ciphertext); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The + * server will choose the appropriate version. + * @type string $ciphertext + * Required. The encrypted data originally returned in + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * @type string $additional_authenticated_data + * Optional. Optional data that must match the data originally supplied in + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * @type \Google\Protobuf\Int64Value $ciphertext_crc32c + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) + * is equal to + * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type \Google\Protobuf\Int64Value $additional_authenticated_data_crc32c + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) + * is equal to + * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The + * server will choose the appropriate version. + * + * 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 + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The + * server will choose the appropriate version. + * + * 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; + } + + /** + * Required. The encrypted data originally returned in + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * + * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCiphertext() + { + return $this->ciphertext; + } + + /** + * Required. The encrypted data originally returned in + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * + * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCiphertext($var) + { + GPBUtil::checkString($var, False); + $this->ciphertext = $var; + + return $this; + } + + /** + * Optional. Optional data that must match the data originally supplied in + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAdditionalAuthenticatedData() + { + return $this->additional_authenticated_data; + } + + /** + * Optional. Optional data that must match the data originally supplied in + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAdditionalAuthenticatedData($var) + { + GPBUtil::checkString($var, False); + $this->additional_authenticated_data = $var; + + return $this; + } + + /** + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) + * is equal to + * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getCiphertextCrc32C() + { + return $this->ciphertext_crc32c; + } + + public function hasCiphertextCrc32C() + { + return isset($this->ciphertext_crc32c); + } + + public function clearCiphertextCrc32C() + { + unset($this->ciphertext_crc32c); + } + + /** + * Returns the unboxed value from getCiphertextCrc32C() + + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) + * is equal to + * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getCiphertextCrc32CUnwrapped() + { + return $this->readWrapperValue("ciphertext_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) + * is equal to + * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setCiphertextCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->ciphertext_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) + * is equal to + * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setCiphertextCrc32CUnwrapped($var) + { + $this->writeWrapperValue("ciphertext_crc32c", $var); + return $this;} + + /** + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) + * is equal to + * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getAdditionalAuthenticatedDataCrc32C() + { + return $this->additional_authenticated_data_crc32c; + } + + public function hasAdditionalAuthenticatedDataCrc32C() + { + return isset($this->additional_authenticated_data_crc32c); + } + + public function clearAdditionalAuthenticatedDataCrc32C() + { + unset($this->additional_authenticated_data_crc32c); + } + + /** + * Returns the unboxed value from getAdditionalAuthenticatedDataCrc32C() + + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) + * is equal to + * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getAdditionalAuthenticatedDataCrc32CUnwrapped() + { + return $this->readWrapperValue("additional_authenticated_data_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) + * is equal to + * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setAdditionalAuthenticatedDataCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->additional_authenticated_data_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) + * is equal to + * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setAdditionalAuthenticatedDataCrc32CUnwrapped($var) + { + $this->writeWrapperValue("additional_authenticated_data_crc32c", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptResponse.php new file mode 100644 index 000000000000..3910ec3ae0eb --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptResponse.php @@ -0,0 +1,315 @@ +google.cloud.kms.v1.DecryptResponse + */ +class DecryptResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The decrypted data originally supplied in + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. + * + * Generated from protobuf field bytes plaintext = 1; + */ + protected $plaintext = ''; + /** + * Integrity verification field. A CRC32C checksum of the returned + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. + * An integrity check of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: receiving this response message indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + */ + protected $plaintext_crc32c = null; + /** + * Whether the Decryption was performed using the primary key version. + * + * Generated from protobuf field bool used_primary = 3; + */ + protected $used_primary = false; + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; + */ + protected $protection_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $plaintext + * The decrypted data originally supplied in + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. + * @type \Google\Protobuf\Int64Value $plaintext_crc32c + * Integrity verification field. A CRC32C checksum of the returned + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. + * An integrity check of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: receiving this response message indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type bool $used_primary + * Whether the Decryption was performed using the primary key version. + * @type int $protection_level + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The decrypted data originally supplied in + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. + * + * Generated from protobuf field bytes plaintext = 1; + * @return string + */ + public function getPlaintext() + { + return $this->plaintext; + } + + /** + * The decrypted data originally supplied in + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. + * + * Generated from protobuf field bytes plaintext = 1; + * @param string $var + * @return $this + */ + public function setPlaintext($var) + { + GPBUtil::checkString($var, False); + $this->plaintext = $var; + + return $this; + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. + * An integrity check of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: receiving this response message indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @return \Google\Protobuf\Int64Value|null + */ + public function getPlaintextCrc32C() + { + return $this->plaintext_crc32c; + } + + public function hasPlaintextCrc32C() + { + return isset($this->plaintext_crc32c); + } + + public function clearPlaintextCrc32C() + { + unset($this->plaintext_crc32c); + } + + /** + * Returns the unboxed value from getPlaintextCrc32C() + + * Integrity verification field. A CRC32C checksum of the returned + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. + * An integrity check of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: receiving this response message indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @return int|string|null + */ + public function getPlaintextCrc32CUnwrapped() + { + return $this->readWrapperValue("plaintext_crc32c"); + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. + * An integrity check of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: receiving this response message indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setPlaintextCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->plaintext_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Integrity verification field. A CRC32C checksum of the returned + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. + * An integrity check of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * can be performed by computing the CRC32C checksum of + * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: receiving this response message indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @param int|string|null $var + * @return $this + */ + public function setPlaintextCrc32CUnwrapped($var) + { + $this->writeWrapperValue("plaintext_crc32c", $var); + return $this;} + + /** + * Whether the Decryption was performed using the primary key version. + * + * Generated from protobuf field bool used_primary = 3; + * @return bool + */ + public function getUsedPrimary() + { + return $this->used_primary; + } + + /** + * Whether the Decryption was performed using the primary key version. + * + * Generated from protobuf field bool used_primary = 3; + * @param bool $var + * @return $this + */ + public function setUsedPrimary($var) + { + GPBUtil::checkBool($var); + $this->used_primary = $var; + + return $this; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DestroyCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DestroyCryptoKeyVersionRequest.php new file mode 100644 index 000000000000..71fbcb00be4b --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DestroyCryptoKeyVersionRequest.php @@ -0,0 +1,87 @@ +google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + */ +class DestroyCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. Please see + * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\DestroyCryptoKeyVersionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. + * + * 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 + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. + * + * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Digest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Digest.php new file mode 100644 index 000000000000..90201ffc30de --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Digest.php @@ -0,0 +1,141 @@ +google.cloud.kms.v1.Digest + */ +class Digest extends \Google\Protobuf\Internal\Message +{ + protected $digest; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $sha256 + * A message digest produced with the SHA-256 algorithm. + * @type string $sha384 + * A message digest produced with the SHA-384 algorithm. + * @type string $sha512 + * A message digest produced with the SHA-512 algorithm. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * A message digest produced with the SHA-256 algorithm. + * + * Generated from protobuf field bytes sha256 = 1; + * @return string + */ + public function getSha256() + { + return $this->readOneof(1); + } + + public function hasSha256() + { + return $this->hasOneof(1); + } + + /** + * A message digest produced with the SHA-256 algorithm. + * + * Generated from protobuf field bytes sha256 = 1; + * @param string $var + * @return $this + */ + public function setSha256($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A message digest produced with the SHA-384 algorithm. + * + * Generated from protobuf field bytes sha384 = 2; + * @return string + */ + public function getSha384() + { + return $this->readOneof(2); + } + + public function hasSha384() + { + return $this->hasOneof(2); + } + + /** + * A message digest produced with the SHA-384 algorithm. + * + * Generated from protobuf field bytes sha384 = 2; + * @param string $var + * @return $this + */ + public function setSha384($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A message digest produced with the SHA-512 algorithm. + * + * Generated from protobuf field bytes sha512 = 3; + * @return string + */ + public function getSha512() + { + return $this->readOneof(3); + } + + public function hasSha512() + { + return $this->hasOneof(3); + } + + /** + * A message digest produced with the SHA-512 algorithm. + * + * Generated from protobuf field bytes sha512 = 3; + * @param string $var + * @return $this + */ + public function setSha512($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getDigest() + { + return $this->whichOneof("digest"); + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConfig.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConfig.php new file mode 100644 index 000000000000..92325efb4514 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConfig.php @@ -0,0 +1,123 @@ +google.cloud.kms.v1.EkmConfig + */ +class EkmConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name for the + * [EkmConfig][google.cloud.kms.v1.EkmConfig] in the format + * `projects/*/locations/*/ekmConfig`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. Resource name of the default + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. Setting this field to + * the empty string removes the default. + * + * Generated from protobuf field string default_ekm_connection = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $default_ekm_connection = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name for the + * [EkmConfig][google.cloud.kms.v1.EkmConfig] in the format + * `projects/*/locations/*/ekmConfig`. + * @type string $default_ekm_connection + * Optional. Resource name of the default + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. Setting this field to + * the empty string removes the default. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name for the + * [EkmConfig][google.cloud.kms.v1.EkmConfig] in the format + * `projects/*/locations/*/ekmConfig`. + * + * 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 for the + * [EkmConfig][google.cloud.kms.v1.EkmConfig] in the format + * `projects/*/locations/*/ekmConfig`. + * + * 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. Resource name of the default + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. Setting this field to + * the empty string removes the default. + * + * Generated from protobuf field string default_ekm_connection = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getDefaultEkmConnection() + { + return $this->default_ekm_connection; + } + + /** + * Optional. Resource name of the default + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. Setting this field to + * the empty string removes the default. + * + * Generated from protobuf field string default_ekm_connection = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDefaultEkmConnection($var) + { + GPBUtil::checkString($var, True); + $this->default_ekm_connection = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection.php new file mode 100644 index 000000000000..d8bbf9c4606f --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection.php @@ -0,0 +1,314 @@ +google.cloud.kms.v1.EkmConnection + */ +class EkmConnection extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name for the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] in the format + * `projects/*/locations/*/ekmConnections/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The time at which the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * A list of + * [ServiceResolvers][google.cloud.kms.v1.EkmConnection.ServiceResolver] where + * the EKM can be reached. There should be one ServiceResolver per EKM + * replica. Currently, only a single + * [ServiceResolver][google.cloud.kms.v1.EkmConnection.ServiceResolver] is + * supported. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection.ServiceResolver service_resolvers = 3; + */ + private $service_resolvers; + /** + * Optional. Etag of the currently stored + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. Describes who can perform control plane operations on the EKM. If + * unset, this defaults to + * [MANUAL][google.cloud.kms.v1.EkmConnection.KeyManagementMode.MANUAL]. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConnection.KeyManagementMode key_management_mode = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key_management_mode = 0; + /** + * Optional. Identifies the EKM Crypto Space that this + * [EkmConnection][google.cloud.kms.v1.EkmConnection] maps to. Note: This + * field is required if + * [KeyManagementMode][google.cloud.kms.v1.EkmConnection.KeyManagementMode] is + * [CLOUD_KMS][google.cloud.kms.v1.EkmConnection.KeyManagementMode.CLOUD_KMS]. + * + * Generated from protobuf field string crypto_space_path = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $crypto_space_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name for the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] in the format + * `projects/*/locations/*/ekmConnections/*`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time at which the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] was created. + * @type array<\Google\Cloud\Kms\V1\EkmConnection\ServiceResolver>|\Google\Protobuf\Internal\RepeatedField $service_resolvers + * A list of + * [ServiceResolvers][google.cloud.kms.v1.EkmConnection.ServiceResolver] where + * the EKM can be reached. There should be one ServiceResolver per EKM + * replica. Currently, only a single + * [ServiceResolver][google.cloud.kms.v1.EkmConnection.ServiceResolver] is + * supported. + * @type string $etag + * Optional. Etag of the currently stored + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * @type int $key_management_mode + * Optional. Describes who can perform control plane operations on the EKM. If + * unset, this defaults to + * [MANUAL][google.cloud.kms.v1.EkmConnection.KeyManagementMode.MANUAL]. + * @type string $crypto_space_path + * Optional. Identifies the EKM Crypto Space that this + * [EkmConnection][google.cloud.kms.v1.EkmConnection] maps to. Note: This + * field is required if + * [KeyManagementMode][google.cloud.kms.v1.EkmConnection.KeyManagementMode] is + * [CLOUD_KMS][google.cloud.kms.v1.EkmConnection.KeyManagementMode.CLOUD_KMS]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name for the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] in the format + * `projects/*/locations/*/ekmConnections/*`. + * + * 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 for the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] in the format + * `projects/*/locations/*/ekmConnections/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The time at which the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time at which the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * A list of + * [ServiceResolvers][google.cloud.kms.v1.EkmConnection.ServiceResolver] where + * the EKM can be reached. There should be one ServiceResolver per EKM + * replica. Currently, only a single + * [ServiceResolver][google.cloud.kms.v1.EkmConnection.ServiceResolver] is + * supported. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection.ServiceResolver service_resolvers = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceResolvers() + { + return $this->service_resolvers; + } + + /** + * A list of + * [ServiceResolvers][google.cloud.kms.v1.EkmConnection.ServiceResolver] where + * the EKM can be reached. There should be one ServiceResolver per EKM + * replica. Currently, only a single + * [ServiceResolver][google.cloud.kms.v1.EkmConnection.ServiceResolver] is + * supported. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection.ServiceResolver service_resolvers = 3; + * @param array<\Google\Cloud\Kms\V1\EkmConnection\ServiceResolver>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceResolvers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\EkmConnection\ServiceResolver::class); + $this->service_resolvers = $arr; + + return $this; + } + + /** + * Optional. Etag of the currently stored + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. Etag of the currently stored + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. Describes who can perform control plane operations on the EKM. If + * unset, this defaults to + * [MANUAL][google.cloud.kms.v1.EkmConnection.KeyManagementMode.MANUAL]. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConnection.KeyManagementMode key_management_mode = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getKeyManagementMode() + { + return $this->key_management_mode; + } + + /** + * Optional. Describes who can perform control plane operations on the EKM. If + * unset, this defaults to + * [MANUAL][google.cloud.kms.v1.EkmConnection.KeyManagementMode.MANUAL]. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConnection.KeyManagementMode key_management_mode = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setKeyManagementMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\EkmConnection\KeyManagementMode::class); + $this->key_management_mode = $var; + + return $this; + } + + /** + * Optional. Identifies the EKM Crypto Space that this + * [EkmConnection][google.cloud.kms.v1.EkmConnection] maps to. Note: This + * field is required if + * [KeyManagementMode][google.cloud.kms.v1.EkmConnection.KeyManagementMode] is + * [CLOUD_KMS][google.cloud.kms.v1.EkmConnection.KeyManagementMode.CLOUD_KMS]. + * + * Generated from protobuf field string crypto_space_path = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCryptoSpacePath() + { + return $this->crypto_space_path; + } + + /** + * Optional. Identifies the EKM Crypto Space that this + * [EkmConnection][google.cloud.kms.v1.EkmConnection] maps to. Note: This + * field is required if + * [KeyManagementMode][google.cloud.kms.v1.EkmConnection.KeyManagementMode] is + * [CLOUD_KMS][google.cloud.kms.v1.EkmConnection.KeyManagementMode.CLOUD_KMS]. + * + * Generated from protobuf field string crypto_space_path = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCryptoSpacePath($var) + { + GPBUtil::checkString($var, True); + $this->crypto_space_path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/KeyManagementMode.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/KeyManagementMode.php new file mode 100644 index 000000000000..03dd23462c6c --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/KeyManagementMode.php @@ -0,0 +1,90 @@ +google.cloud.kms.v1.EkmConnection.KeyManagementMode + */ +class KeyManagementMode +{ + /** + * Not specified. + * + * Generated from protobuf enum KEY_MANAGEMENT_MODE_UNSPECIFIED = 0; + */ + const KEY_MANAGEMENT_MODE_UNSPECIFIED = 0; + /** + * EKM-side key management operations on + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] created with this + * [EkmConnection][google.cloud.kms.v1.EkmConnection] must be initiated from + * the EKM directly and cannot be performed from Cloud KMS. This means that: + * * When creating a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] associated with + * this + * [EkmConnection][google.cloud.kms.v1.EkmConnection], the caller must + * supply the key path of pre-existing external key material that will be + * linked to the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * * Destruction of external key material cannot be requested via the + * Cloud KMS API and must be performed directly in the EKM. + * * Automatic rotation of key material is not supported. + * + * Generated from protobuf enum MANUAL = 1; + */ + const MANUAL = 1; + /** + * All [CryptoKeys][google.cloud.kms.v1.CryptoKey] created with this + * [EkmConnection][google.cloud.kms.v1.EkmConnection] use EKM-side key + * management operations initiated from Cloud KMS. This means that: + * * When a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * associated with this [EkmConnection][google.cloud.kms.v1.EkmConnection] + * is + * created, the EKM automatically generates new key material and a new + * key path. The caller cannot supply the key path of pre-existing + * external key material. + * * Destruction of external key material associated with this + * [EkmConnection][google.cloud.kms.v1.EkmConnection] can be requested by + * calling [DestroyCryptoKeyVersion][EkmService.DestroyCryptoKeyVersion]. + * * Automatic rotation of key material is supported. + * + * Generated from protobuf enum CLOUD_KMS = 2; + */ + const CLOUD_KMS = 2; + + private static $valueToName = [ + self::KEY_MANAGEMENT_MODE_UNSPECIFIED => 'KEY_MANAGEMENT_MODE_UNSPECIFIED', + self::MANUAL => 'MANUAL', + self::CLOUD_KMS => 'CLOUD_KMS', + ]; + + 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(KeyManagementMode::class, \Google\Cloud\Kms\V1\EkmConnection_KeyManagementMode::class); + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/ServiceResolver.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/ServiceResolver.php new file mode 100644 index 000000000000..37e72fe4b1a8 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/ServiceResolver.php @@ -0,0 +1,206 @@ +google.cloud.kms.v1.EkmConnection.ServiceResolver + */ +class ServiceResolver extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Service Directory service pointing to + * an EKM replica, in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * + * Generated from protobuf field string service_directory_service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $service_directory_service = ''; + /** + * Optional. The filter applied to the endpoints of the resolved service. If + * no filter is specified, all endpoints will be considered. An endpoint + * will be chosen arbitrarily from the filtered list for each request. + * For endpoint filter syntax and examples, see + * https://cloud.google.com/service-directory/docs/reference/rpc/google.cloud.servicedirectory.v1#resolveservicerequest. + * + * Generated from protobuf field string endpoint_filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $endpoint_filter = ''; + /** + * Required. The hostname of the EKM replica used at TLS and HTTP layers. + * + * Generated from protobuf field string hostname = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $hostname = ''; + /** + * Required. A list of leaf server certificates used to authenticate HTTPS + * connections to the EKM replica. Currently, a maximum of 10 + * [Certificate][google.cloud.kms.v1.Certificate] is supported. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.Certificate server_certificates = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $server_certificates; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_directory_service + * Required. The resource name of the Service Directory service pointing to + * an EKM replica, in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * @type string $endpoint_filter + * Optional. The filter applied to the endpoints of the resolved service. If + * no filter is specified, all endpoints will be considered. An endpoint + * will be chosen arbitrarily from the filtered list for each request. + * For endpoint filter syntax and examples, see + * https://cloud.google.com/service-directory/docs/reference/rpc/google.cloud.servicedirectory.v1#resolveservicerequest. + * @type string $hostname + * Required. The hostname of the EKM replica used at TLS and HTTP layers. + * @type array<\Google\Cloud\Kms\V1\Certificate>|\Google\Protobuf\Internal\RepeatedField $server_certificates + * Required. A list of leaf server certificates used to authenticate HTTPS + * connections to the EKM replica. Currently, a maximum of 10 + * [Certificate][google.cloud.kms.v1.Certificate] is supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Service Directory service pointing to + * an EKM replica, in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * + * Generated from protobuf field string service_directory_service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getServiceDirectoryService() + { + return $this->service_directory_service; + } + + /** + * Required. The resource name of the Service Directory service pointing to + * an EKM replica, in the format + * `projects/*/locations/*/namespaces/*/services/*`. + * + * Generated from protobuf field string service_directory_service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceDirectoryService($var) + { + GPBUtil::checkString($var, True); + $this->service_directory_service = $var; + + return $this; + } + + /** + * Optional. The filter applied to the endpoints of the resolved service. If + * no filter is specified, all endpoints will be considered. An endpoint + * will be chosen arbitrarily from the filtered list for each request. + * For endpoint filter syntax and examples, see + * https://cloud.google.com/service-directory/docs/reference/rpc/google.cloud.servicedirectory.v1#resolveservicerequest. + * + * Generated from protobuf field string endpoint_filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEndpointFilter() + { + return $this->endpoint_filter; + } + + /** + * Optional. The filter applied to the endpoints of the resolved service. If + * no filter is specified, all endpoints will be considered. An endpoint + * will be chosen arbitrarily from the filtered list for each request. + * For endpoint filter syntax and examples, see + * https://cloud.google.com/service-directory/docs/reference/rpc/google.cloud.servicedirectory.v1#resolveservicerequest. + * + * Generated from protobuf field string endpoint_filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEndpointFilter($var) + { + GPBUtil::checkString($var, True); + $this->endpoint_filter = $var; + + return $this; + } + + /** + * Required. The hostname of the EKM replica used at TLS and HTTP layers. + * + * Generated from protobuf field string hostname = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHostname() + { + return $this->hostname; + } + + /** + * Required. The hostname of the EKM replica used at TLS and HTTP layers. + * + * Generated from protobuf field string hostname = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHostname($var) + { + GPBUtil::checkString($var, True); + $this->hostname = $var; + + return $this; + } + + /** + * Required. A list of leaf server certificates used to authenticate HTTPS + * connections to the EKM replica. Currently, a maximum of 10 + * [Certificate][google.cloud.kms.v1.Certificate] is supported. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.Certificate server_certificates = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServerCertificates() + { + return $this->server_certificates; + } + + /** + * Required. A list of leaf server certificates used to authenticate HTTPS + * connections to the EKM replica. Currently, a maximum of 10 + * [Certificate][google.cloud.kms.v1.Certificate] is supported. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.Certificate server_certificates = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Kms\V1\Certificate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServerCertificates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\Certificate::class); + $this->server_certificates = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ServiceResolver::class, \Google\Cloud\Kms\V1\EkmConnection_ServiceResolver::class); + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptRequest.php new file mode 100644 index 000000000000..54a6c404dbc8 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptRequest.php @@ -0,0 +1,625 @@ +google.cloud.kms.v1.EncryptRequest + */ +class EncryptRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] or + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * encryption. + * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server + * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The data to encrypt. Must be no larger than 64KiB. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and + * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $plaintext = ''; + /** + * Optional. Optional data that, if specified, must also be provided during + * decryption through + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and + * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the + * AAD must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $additional_authenticated_data = ''; + /** + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) + * is equal to + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $plaintext_crc32c = null; + /** + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) + * is equal to + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $additional_authenticated_data_crc32c = null; + + /** + * @param string $name Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] or + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * encryption. + * + * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server + * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. + * @param string $plaintext Required. The data to encrypt. Must be no larger than 64KiB. + * + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and + * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * @return \Google\Cloud\Kms\V1\EncryptRequest + * + * @experimental + */ + public static function build(string $name, string $plaintext): self + { + return (new self()) + ->setName($name) + ->setPlaintext($plaintext); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] or + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * encryption. + * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server + * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. + * @type string $plaintext + * Required. The data to encrypt. Must be no larger than 64KiB. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and + * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * @type string $additional_authenticated_data + * Optional. Optional data that, if specified, must also be provided during + * decryption through + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and + * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the + * AAD must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * @type \Google\Protobuf\Int64Value $plaintext_crc32c + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) + * is equal to + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type \Google\Protobuf\Int64Value $additional_authenticated_data_crc32c + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) + * is equal to + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] or + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * encryption. + * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server + * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. + * + * 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 + * [CryptoKey][google.cloud.kms.v1.CryptoKey] or + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * encryption. + * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server + * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. + * + * 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; + } + + /** + * Required. The data to encrypt. Must be no larger than 64KiB. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and + * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPlaintext() + { + return $this->plaintext; + } + + /** + * Required. The data to encrypt. Must be no larger than 64KiB. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and + * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPlaintext($var) + { + GPBUtil::checkString($var, False); + $this->plaintext = $var; + + return $this; + } + + /** + * Optional. Optional data that, if specified, must also be provided during + * decryption through + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and + * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the + * AAD must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAdditionalAuthenticatedData() + { + return $this->additional_authenticated_data; + } + + /** + * Optional. Optional data that, if specified, must also be provided during + * decryption through + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and + * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the + * AAD must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAdditionalAuthenticatedData($var) + { + GPBUtil::checkString($var, False); + $this->additional_authenticated_data = $var; + + return $this; + } + + /** + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) + * is equal to + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getPlaintextCrc32C() + { + return $this->plaintext_crc32c; + } + + public function hasPlaintextCrc32C() + { + return isset($this->plaintext_crc32c); + } + + public function clearPlaintextCrc32C() + { + unset($this->plaintext_crc32c); + } + + /** + * Returns the unboxed value from getPlaintextCrc32C() + + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) + * is equal to + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getPlaintextCrc32CUnwrapped() + { + return $this->readWrapperValue("plaintext_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) + * is equal to + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setPlaintextCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->plaintext_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) + * is equal to + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setPlaintextCrc32CUnwrapped($var) + { + $this->writeWrapperValue("plaintext_crc32c", $var); + return $this;} + + /** + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) + * is equal to + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getAdditionalAuthenticatedDataCrc32C() + { + return $this->additional_authenticated_data_crc32c; + } + + public function hasAdditionalAuthenticatedDataCrc32C() + { + return isset($this->additional_authenticated_data_crc32c); + } + + public function clearAdditionalAuthenticatedDataCrc32C() + { + unset($this->additional_authenticated_data_crc32c); + } + + /** + * Returns the unboxed value from getAdditionalAuthenticatedDataCrc32C() + + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) + * is equal to + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getAdditionalAuthenticatedDataCrc32CUnwrapped() + { + return $this->readWrapperValue("additional_authenticated_data_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) + * is equal to + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setAdditionalAuthenticatedDataCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->additional_authenticated_data_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) + * is equal to + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setAdditionalAuthenticatedDataCrc32CUnwrapped($var) + { + $this->writeWrapperValue("additional_authenticated_data_crc32c", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptResponse.php new file mode 100644 index 000000000000..7a18418344b6 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptResponse.php @@ -0,0 +1,471 @@ +google.cloud.kms.v1.EncryptResponse + */ +class EncryptResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. Check this field to verify that the intended resource was used + * for encryption. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The encrypted data. + * + * Generated from protobuf field bytes ciphertext = 2; + */ + protected $ciphertext = ''; + /** + * Integrity verification field. A CRC32C checksum of the returned + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * An integrity check of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * can be performed by computing the CRC32C checksum of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; + */ + protected $ciphertext_crc32c = null; + /** + * Integrity verification field. A flag indicating whether + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. A false value of + * this field indicates either that + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_plaintext_crc32c = 5; + */ + protected $verified_plaintext_crc32c = false; + /** + * Integrity verification field. A flag indicating whether + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [AAD][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. A + * false value of this field indicates either that + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 6; + */ + protected $verified_additional_authenticated_data_crc32c = false; + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7; + */ + protected $protection_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. Check this field to verify that the intended resource was used + * for encryption. + * @type string $ciphertext + * The encrypted data. + * @type \Google\Protobuf\Int64Value $ciphertext_crc32c + * Integrity verification field. A CRC32C checksum of the returned + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * An integrity check of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * can be performed by computing the CRC32C checksum of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * @type bool $verified_plaintext_crc32c + * Integrity verification field. A flag indicating whether + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. A false value of + * this field indicates either that + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type bool $verified_additional_authenticated_data_crc32c + * Integrity verification field. A flag indicating whether + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [AAD][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. A + * false value of this field indicates either that + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type int $protection_level + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. Check this field to verify that the intended resource was used + * for encryption. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. Check this field to verify that the intended resource was used + * for encryption. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The encrypted data. + * + * Generated from protobuf field bytes ciphertext = 2; + * @return string + */ + public function getCiphertext() + { + return $this->ciphertext; + } + + /** + * The encrypted data. + * + * Generated from protobuf field bytes ciphertext = 2; + * @param string $var + * @return $this + */ + public function setCiphertext($var) + { + GPBUtil::checkString($var, False); + $this->ciphertext = $var; + + return $this; + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * An integrity check of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * can be performed by computing the CRC32C checksum of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; + * @return \Google\Protobuf\Int64Value|null + */ + public function getCiphertextCrc32C() + { + return $this->ciphertext_crc32c; + } + + public function hasCiphertextCrc32C() + { + return isset($this->ciphertext_crc32c); + } + + public function clearCiphertextCrc32C() + { + unset($this->ciphertext_crc32c); + } + + /** + * Returns the unboxed value from getCiphertextCrc32C() + + * Integrity verification field. A CRC32C checksum of the returned + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * An integrity check of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * can be performed by computing the CRC32C checksum of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; + * @return int|string|null + */ + public function getCiphertextCrc32CUnwrapped() + { + return $this->readWrapperValue("ciphertext_crc32c"); + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * An integrity check of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * can be performed by computing the CRC32C checksum of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setCiphertextCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->ciphertext_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Integrity verification field. A CRC32C checksum of the returned + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * An integrity check of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * can be performed by computing the CRC32C checksum of + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; + * @param int|string|null $var + * @return $this + */ + public function setCiphertextCrc32CUnwrapped($var) + { + $this->writeWrapperValue("ciphertext_crc32c", $var); + return $this;} + + /** + * Integrity verification field. A flag indicating whether + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. A false value of + * this field indicates either that + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_plaintext_crc32c = 5; + * @return bool + */ + public function getVerifiedPlaintextCrc32C() + { + return $this->verified_plaintext_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. A false value of + * this field indicates either that + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_plaintext_crc32c = 5; + * @param bool $var + * @return $this + */ + public function setVerifiedPlaintextCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_plaintext_crc32c = $var; + + return $this; + } + + /** + * Integrity verification field. A flag indicating whether + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [AAD][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. A + * false value of this field indicates either that + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 6; + * @return bool + */ + public function getVerifiedAdditionalAuthenticatedDataCrc32C() + { + return $this->verified_additional_authenticated_data_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [AAD][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. A + * false value of this field indicates either that + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 6; + * @param bool $var + * @return $this + */ + public function setVerifiedAdditionalAuthenticatedDataCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_additional_authenticated_data_crc32c = $var; + + return $this; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ExternalProtectionLevelOptions.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ExternalProtectionLevelOptions.php new file mode 100644 index 000000000000..9a8fb7d4fabb --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ExternalProtectionLevelOptions.php @@ -0,0 +1,122 @@ +google.cloud.kms.v1.ExternalProtectionLevelOptions + */ +class ExternalProtectionLevelOptions extends \Google\Protobuf\Internal\Message +{ + /** + * The URI for an external resource that this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents. + * + * Generated from protobuf field string external_key_uri = 1; + */ + protected $external_key_uri = ''; + /** + * The path to the external key material on the EKM when using + * [EkmConnection][google.cloud.kms.v1.EkmConnection] e.g., "v0/my/key". Set + * this field instead of external_key_uri when using an + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * + * Generated from protobuf field string ekm_connection_key_path = 2; + */ + protected $ekm_connection_key_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $external_key_uri + * The URI for an external resource that this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents. + * @type string $ekm_connection_key_path + * The path to the external key material on the EKM when using + * [EkmConnection][google.cloud.kms.v1.EkmConnection] e.g., "v0/my/key". Set + * this field instead of external_key_uri when using an + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The URI for an external resource that this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents. + * + * Generated from protobuf field string external_key_uri = 1; + * @return string + */ + public function getExternalKeyUri() + { + return $this->external_key_uri; + } + + /** + * The URI for an external resource that this + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents. + * + * Generated from protobuf field string external_key_uri = 1; + * @param string $var + * @return $this + */ + public function setExternalKeyUri($var) + { + GPBUtil::checkString($var, True); + $this->external_key_uri = $var; + + return $this; + } + + /** + * The path to the external key material on the EKM when using + * [EkmConnection][google.cloud.kms.v1.EkmConnection] e.g., "v0/my/key". Set + * this field instead of external_key_uri when using an + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * + * Generated from protobuf field string ekm_connection_key_path = 2; + * @return string + */ + public function getEkmConnectionKeyPath() + { + return $this->ekm_connection_key_path; + } + + /** + * The path to the external key material on the EKM when using + * [EkmConnection][google.cloud.kms.v1.EkmConnection] e.g., "v0/my/key". Set + * this field instead of external_key_uri when using an + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * + * Generated from protobuf field string ekm_connection_key_path = 2; + * @param string $var + * @return $this + */ + public function setEkmConnectionKeyPath($var) + { + GPBUtil::checkString($var, True); + $this->ekm_connection_key_path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesRequest.php new file mode 100644 index 000000000000..695206324a5a --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesRequest.php @@ -0,0 +1,179 @@ +google.cloud.kms.v1.GenerateRandomBytesRequest + */ +class GenerateRandomBytesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The project-specific location in which to generate random bytes. + * For example, "projects/my-project/locations/us-central1". + * + * Generated from protobuf field string location = 1; + */ + protected $location = ''; + /** + * The length in bytes of the amount of randomness to retrieve. Minimum 8 + * bytes, maximum 1024 bytes. + * + * Generated from protobuf field int32 length_bytes = 2; + */ + protected $length_bytes = 0; + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when + * generating the random data. Currently, only + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is + * supported. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; + */ + protected $protection_level = 0; + + /** + * @param string $location The project-specific location in which to generate random bytes. + * For example, "projects/my-project/locations/us-central1". + * @param int $lengthBytes The length in bytes of the amount of randomness to retrieve. Minimum 8 + * bytes, maximum 1024 bytes. + * @param int $protectionLevel The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when + * generating the random data. Currently, only + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is + * supported. + * For allowed values, use constants defined on {@see \Google\Cloud\Kms\V1\ProtectionLevel} + * + * @return \Google\Cloud\Kms\V1\GenerateRandomBytesRequest + * + * @experimental + */ + public static function build(string $location, int $lengthBytes, int $protectionLevel): self + { + return (new self()) + ->setLocation($location) + ->setLengthBytes($lengthBytes) + ->setProtectionLevel($protectionLevel); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $location + * The project-specific location in which to generate random bytes. + * For example, "projects/my-project/locations/us-central1". + * @type int $length_bytes + * The length in bytes of the amount of randomness to retrieve. Minimum 8 + * bytes, maximum 1024 bytes. + * @type int $protection_level + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when + * generating the random data. Currently, only + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is + * supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The project-specific location in which to generate random bytes. + * For example, "projects/my-project/locations/us-central1". + * + * Generated from protobuf field string location = 1; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * The project-specific location in which to generate random bytes. + * For example, "projects/my-project/locations/us-central1". + * + * Generated from protobuf field string location = 1; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * The length in bytes of the amount of randomness to retrieve. Minimum 8 + * bytes, maximum 1024 bytes. + * + * Generated from protobuf field int32 length_bytes = 2; + * @return int + */ + public function getLengthBytes() + { + return $this->length_bytes; + } + + /** + * The length in bytes of the amount of randomness to retrieve. Minimum 8 + * bytes, maximum 1024 bytes. + * + * Generated from protobuf field int32 length_bytes = 2; + * @param int $var + * @return $this + */ + public function setLengthBytes($var) + { + GPBUtil::checkInt32($var); + $this->length_bytes = $var; + + return $this; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when + * generating the random data. Currently, only + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is + * supported. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when + * generating the random data. Currently, only + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is + * supported. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesResponse.php new file mode 100644 index 000000000000..4cf4401fde68 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesResponse.php @@ -0,0 +1,211 @@ +google.cloud.kms.v1.GenerateRandomBytesResponse + */ +class GenerateRandomBytesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The generated data. + * + * Generated from protobuf field bytes data = 1; + */ + protected $data = ''; + /** + * Integrity verification field. A CRC32C checksum of the returned + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. + * An integrity check of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * can be performed by computing the CRC32C checksum of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3; + */ + protected $data_crc32c = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $data + * The generated data. + * @type \Google\Protobuf\Int64Value $data_crc32c + * Integrity verification field. A CRC32C checksum of the returned + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. + * An integrity check of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * can be performed by computing the CRC32C checksum of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The generated data. + * + * Generated from protobuf field bytes data = 1; + * @return string + */ + public function getData() + { + return $this->data; + } + + /** + * The generated data. + * + * Generated from protobuf field bytes data = 1; + * @param string $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkString($var, False); + $this->data = $var; + + return $this; + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. + * An integrity check of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * can be performed by computing the CRC32C checksum of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3; + * @return \Google\Protobuf\Int64Value|null + */ + public function getDataCrc32C() + { + return $this->data_crc32c; + } + + public function hasDataCrc32C() + { + return isset($this->data_crc32c); + } + + public function clearDataCrc32C() + { + unset($this->data_crc32c); + } + + /** + * Returns the unboxed value from getDataCrc32C() + + * Integrity verification field. A CRC32C checksum of the returned + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. + * An integrity check of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * can be performed by computing the CRC32C checksum of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3; + * @return int|string|null + */ + public function getDataCrc32CUnwrapped() + { + return $this->readWrapperValue("data_crc32c"); + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. + * An integrity check of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * can be performed by computing the CRC32C checksum of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setDataCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->data_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Integrity verification field. A CRC32C checksum of the returned + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. + * An integrity check of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * can be performed by computing the CRC32C checksum of + * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] + * and comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3; + * @param int|string|null $var + * @return $this + */ + public function setDataCrc32CUnwrapped($var) + { + $this->writeWrapperValue("data_crc32c", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyRequest.php new file mode 100644 index 000000000000..a022fcb8a83f --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyRequest.php @@ -0,0 +1,87 @@ +google.cloud.kms.v1.GetCryptoKeyRequest + */ +class GetCryptoKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. Please see + * {@see KeyManagementServiceClient::cryptoKeyName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\GetCryptoKeyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. + * + * 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][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. + * + * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyVersionRequest.php new file mode 100644 index 000000000000..1a7b994be0d8 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyVersionRequest.php @@ -0,0 +1,87 @@ +google.cloud.kms.v1.GetCryptoKeyVersionRequest + */ +class GetCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. Please see + * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\GetCryptoKeyVersionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. + * + * 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][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. + * + * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConfigRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConfigRequest.php new file mode 100644 index 000000000000..d51d9230caee --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConfigRequest.php @@ -0,0 +1,87 @@ +google.cloud.kms.v1.GetEkmConfigRequest + */ +class GetEkmConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the + * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the + * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. Please see + * {@see EkmServiceClient::ekmConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\GetEkmConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the + * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the + * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. + * + * 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][google.cloud.kms.v1.EkmConfig.name] of the + * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. + * + * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConnectionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConnectionRequest.php new file mode 100644 index 000000000000..8a5e1c04323e --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConnectionRequest.php @@ -0,0 +1,87 @@ +google.cloud.kms.v1.GetEkmConnectionRequest + */ +class GetEkmConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. Please see + * {@see EkmServiceClient::ekmConnectionName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\GetEkmConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. + * + * 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][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. + * + * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetImportJobRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetImportJobRequest.php new file mode 100644 index 000000000000..a8f2614ffbbd --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetImportJobRequest.php @@ -0,0 +1,87 @@ +google.cloud.kms.v1.GetImportJobRequest + */ +class GetImportJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the + * [ImportJob][google.cloud.kms.v1.ImportJob] to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The [name][google.cloud.kms.v1.ImportJob.name] of the + * [ImportJob][google.cloud.kms.v1.ImportJob] to get. Please see + * {@see KeyManagementServiceClient::importJobName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\GetImportJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the + * [ImportJob][google.cloud.kms.v1.ImportJob] to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the + * [ImportJob][google.cloud.kms.v1.ImportJob] to get. + * + * 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][google.cloud.kms.v1.ImportJob.name] of the + * [ImportJob][google.cloud.kms.v1.ImportJob] to get. + * + * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetKeyRingRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetKeyRingRequest.php new file mode 100644 index 000000000000..a34ae4a11196 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetKeyRingRequest.php @@ -0,0 +1,87 @@ +google.cloud.kms.v1.GetKeyRingRequest + */ +class GetKeyRingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The [name][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] to get. Please see + * {@see KeyManagementServiceClient::keyRingName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\GetKeyRingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] to get. + * + * 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][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] to get. + * + * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetPublicKeyRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetPublicKeyRequest.php new file mode 100644 index 000000000000..508c3434e2b9 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetPublicKeyRequest.php @@ -0,0 +1,87 @@ +google.cloud.kms.v1.GetPublicKeyRequest + */ +class GetPublicKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. Please see + * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\GetPublicKeyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. + * + * 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][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. + * + * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportCryptoKeyVersionRequest.php new file mode 100644 index 000000000000..9018eb71ff7e --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportCryptoKeyVersionRequest.php @@ -0,0 +1,491 @@ +google.cloud.kms.v1.ImportCryptoKeyVersionRequest + */ +class ImportCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to be imported into. + * The create permission is only required on this key when creating a new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The optional [name][google.cloud.kms.v1.CryptoKeyVersion.name] of + * an existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to + * target for an import operation. If this field is not present, a new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] containing the + * supplied key material is created. + * If this field is present, the supplied key material is imported into + * the existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. To + * import into an existing + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must be a child of + * [ImportCryptoKeyVersionRequest.parent][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.parent], + * have been previously created via [ImportCryptoKeyVersion][], and be in + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED] + * or + * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED] + * state. The key material and algorithm must match the previous + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] exactly if the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] has ever contained + * key material. + * + * Generated from protobuf field string crypto_key_version = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $crypto_key_version = ''; + /** + * Required. The + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * of the key being imported. This does not need to match the + * [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] this version imports into. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $algorithm = 0; + /** + * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the + * [ImportJob][google.cloud.kms.v1.ImportJob] that was used to wrap this key + * material. + * + * Generated from protobuf field string import_job = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $import_job = ''; + /** + * Optional. The wrapped key material to import. + * Before wrapping, key material must be formatted. If importing symmetric key + * material, the expected key material format is plain bytes. If importing + * asymmetric key material, the expected key material format is PKCS#8-encoded + * DER (the PrivateKeyInfo structure from RFC 5208). + * When wrapping with import methods + * ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256] + * or + * [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256] + * or + * [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256] + * or + * [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]), + * this field must contain the concatenation of: + *
    + *
  1. An ephemeral AES-256 wrapping key wrapped with the + * [public_key][google.cloud.kms.v1.ImportJob.public_key] using + * RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty + * label. + *
  2. + *
  3. The formatted key to be imported, wrapped with the ephemeral AES-256 + * key using AES-KWP (RFC 5649). + *
  4. + *
+ * This format is the same as the format produced by PKCS#11 mechanism + * CKM_RSA_AES_KEY_WRAP. + * When wrapping with import methods + * ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256] + * or + * [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]), + * this field must contain the formatted key to be imported, wrapped with the + * [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP + * with SHA-256, MGF1 with SHA-256, and an empty label. + * + * Generated from protobuf field bytes wrapped_key = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $wrapped_key = ''; + protected $wrapped_key_material; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to be imported into. + * The create permission is only required on this key when creating a new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * @type string $crypto_key_version + * Optional. The optional [name][google.cloud.kms.v1.CryptoKeyVersion.name] of + * an existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to + * target for an import operation. If this field is not present, a new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] containing the + * supplied key material is created. + * If this field is present, the supplied key material is imported into + * the existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. To + * import into an existing + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must be a child of + * [ImportCryptoKeyVersionRequest.parent][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.parent], + * have been previously created via [ImportCryptoKeyVersion][], and be in + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED] + * or + * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED] + * state. The key material and algorithm must match the previous + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] exactly if the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] has ever contained + * key material. + * @type int $algorithm + * Required. The + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * of the key being imported. This does not need to match the + * [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] this version imports into. + * @type string $import_job + * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the + * [ImportJob][google.cloud.kms.v1.ImportJob] that was used to wrap this key + * material. + * @type string $wrapped_key + * Optional. The wrapped key material to import. + * Before wrapping, key material must be formatted. If importing symmetric key + * material, the expected key material format is plain bytes. If importing + * asymmetric key material, the expected key material format is PKCS#8-encoded + * DER (the PrivateKeyInfo structure from RFC 5208). + * When wrapping with import methods + * ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256] + * or + * [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256] + * or + * [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256] + * or + * [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]), + * this field must contain the concatenation of: + *
    + *
  1. An ephemeral AES-256 wrapping key wrapped with the + * [public_key][google.cloud.kms.v1.ImportJob.public_key] using + * RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty + * label. + *
  2. + *
  3. The formatted key to be imported, wrapped with the ephemeral AES-256 + * key using AES-KWP (RFC 5649). + *
  4. + *
+ * This format is the same as the format produced by PKCS#11 mechanism + * CKM_RSA_AES_KEY_WRAP. + * When wrapping with import methods + * ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256] + * or + * [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]), + * this field must contain the formatted key to be imported, wrapped with the + * [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP + * with SHA-256, MGF1 with SHA-256, and an empty label. + * @type string $rsa_aes_wrapped_key + * Optional. This field has the same meaning as + * [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key]. + * Prefer to use that field in new work. Either that field or this field + * (but not both) must be specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to be imported into. + * The create permission is only required on this key when creating a new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to be imported into. + * The create permission is only required on this key when creating a new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The optional [name][google.cloud.kms.v1.CryptoKeyVersion.name] of + * an existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to + * target for an import operation. If this field is not present, a new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] containing the + * supplied key material is created. + * If this field is present, the supplied key material is imported into + * the existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. To + * import into an existing + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must be a child of + * [ImportCryptoKeyVersionRequest.parent][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.parent], + * have been previously created via [ImportCryptoKeyVersion][], and be in + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED] + * or + * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED] + * state. The key material and algorithm must match the previous + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] exactly if the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] has ever contained + * key material. + * + * Generated from protobuf field string crypto_key_version = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getCryptoKeyVersion() + { + return $this->crypto_key_version; + } + + /** + * Optional. The optional [name][google.cloud.kms.v1.CryptoKeyVersion.name] of + * an existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to + * target for an import operation. If this field is not present, a new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] containing the + * supplied key material is created. + * If this field is present, the supplied key material is imported into + * the existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. To + * import into an existing + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must be a child of + * [ImportCryptoKeyVersionRequest.parent][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.parent], + * have been previously created via [ImportCryptoKeyVersion][], and be in + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED] + * or + * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED] + * state. The key material and algorithm must match the previous + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] exactly if the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] has ever contained + * key material. + * + * Generated from protobuf field string crypto_key_version = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCryptoKeyVersion($var) + { + GPBUtil::checkString($var, True); + $this->crypto_key_version = $var; + + return $this; + } + + /** + * Required. The + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * of the key being imported. This does not need to match the + * [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] this version imports into. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAlgorithm() + { + return $this->algorithm; + } + + /** + * Required. The + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * of the key being imported. This does not need to match the + * [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] this version imports into. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAlgorithm($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionAlgorithm::class); + $this->algorithm = $var; + + return $this; + } + + /** + * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the + * [ImportJob][google.cloud.kms.v1.ImportJob] that was used to wrap this key + * material. + * + * Generated from protobuf field string import_job = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImportJob() + { + return $this->import_job; + } + + /** + * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the + * [ImportJob][google.cloud.kms.v1.ImportJob] that was used to wrap this key + * material. + * + * Generated from protobuf field string import_job = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImportJob($var) + { + GPBUtil::checkString($var, True); + $this->import_job = $var; + + return $this; + } + + /** + * Optional. The wrapped key material to import. + * Before wrapping, key material must be formatted. If importing symmetric key + * material, the expected key material format is plain bytes. If importing + * asymmetric key material, the expected key material format is PKCS#8-encoded + * DER (the PrivateKeyInfo structure from RFC 5208). + * When wrapping with import methods + * ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256] + * or + * [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256] + * or + * [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256] + * or + * [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]), + * this field must contain the concatenation of: + *
    + *
  1. An ephemeral AES-256 wrapping key wrapped with the + * [public_key][google.cloud.kms.v1.ImportJob.public_key] using + * RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty + * label. + *
  2. + *
  3. The formatted key to be imported, wrapped with the ephemeral AES-256 + * key using AES-KWP (RFC 5649). + *
  4. + *
+ * This format is the same as the format produced by PKCS#11 mechanism + * CKM_RSA_AES_KEY_WRAP. + * When wrapping with import methods + * ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256] + * or + * [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]), + * this field must contain the formatted key to be imported, wrapped with the + * [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP + * with SHA-256, MGF1 with SHA-256, and an empty label. + * + * Generated from protobuf field bytes wrapped_key = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getWrappedKey() + { + return $this->wrapped_key; + } + + /** + * Optional. The wrapped key material to import. + * Before wrapping, key material must be formatted. If importing symmetric key + * material, the expected key material format is plain bytes. If importing + * asymmetric key material, the expected key material format is PKCS#8-encoded + * DER (the PrivateKeyInfo structure from RFC 5208). + * When wrapping with import methods + * ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256] + * or + * [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256] + * or + * [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256] + * or + * [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]), + * this field must contain the concatenation of: + *
    + *
  1. An ephemeral AES-256 wrapping key wrapped with the + * [public_key][google.cloud.kms.v1.ImportJob.public_key] using + * RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty + * label. + *
  2. + *
  3. The formatted key to be imported, wrapped with the ephemeral AES-256 + * key using AES-KWP (RFC 5649). + *
  4. + *
+ * This format is the same as the format produced by PKCS#11 mechanism + * CKM_RSA_AES_KEY_WRAP. + * When wrapping with import methods + * ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256] + * or + * [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]), + * this field must contain the formatted key to be imported, wrapped with the + * [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP + * with SHA-256, MGF1 with SHA-256, and an empty label. + * + * Generated from protobuf field bytes wrapped_key = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setWrappedKey($var) + { + GPBUtil::checkString($var, False); + $this->wrapped_key = $var; + + return $this; + } + + /** + * Optional. This field has the same meaning as + * [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key]. + * Prefer to use that field in new work. Either that field or this field + * (but not both) must be specified. + * + * Generated from protobuf field bytes rsa_aes_wrapped_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRsaAesWrappedKey() + { + return $this->readOneof(5); + } + + public function hasRsaAesWrappedKey() + { + return $this->hasOneof(5); + } + + /** + * Optional. This field has the same meaning as + * [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key]. + * Prefer to use that field in new work. Either that field or this field + * (but not both) must be specified. + * + * Generated from protobuf field bytes rsa_aes_wrapped_key = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRsaAesWrappedKey($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getWrappedKeyMaterial() + { + return $this->whichOneof("wrapped_key_material"); + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob.php new file mode 100644 index 000000000000..6eae364be08c --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob.php @@ -0,0 +1,549 @@ +google.cloud.kms.v1.ImportJob + */ +class ImportJob extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name for this + * [ImportJob][google.cloud.kms.v1.ImportJob] in the format + * `projects/*/locations/*/keyRings/*/importJobs/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. Immutable. The wrapping method to be used for incoming key + * material. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportMethod import_method = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $import_method = 0; + /** + * Required. Immutable. The protection level of the + * [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * of the [version_template][google.cloud.kms.v1.CryptoKey.version_template] + * on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you attempt to import + * into. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $protection_level = 0; + /** + * Output only. The time at which this + * [ImportJob][google.cloud.kms.v1.ImportJob] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key + * material was generated. + * + * Generated from protobuf field .google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generate_time = null; + /** + * Output only. The time at which this + * [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for expiration and + * can no longer be used to import key material. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] + * expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is + * [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED]. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_event_time = null; + /** + * Output only. The current state of the + * [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can be used. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The public key with which to wrap key material prior to + * import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is + * [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE]. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $public_key = null; + /** + * Output only. Statement that was generated and signed by the key creator + * (for example, an HSM) at key creation time. Use this statement to verify + * attributes of the key as stored on the HSM, independently of Google. + * Only present if the chosen + * [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a + * protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $attestation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name for this + * [ImportJob][google.cloud.kms.v1.ImportJob] in the format + * `projects/*/locations/*/keyRings/*/importJobs/*`. + * @type int $import_method + * Required. Immutable. The wrapping method to be used for incoming key + * material. + * @type int $protection_level + * Required. Immutable. The protection level of the + * [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * of the [version_template][google.cloud.kms.v1.CryptoKey.version_template] + * on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you attempt to import + * into. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time at which this + * [ImportJob][google.cloud.kms.v1.ImportJob] was created. + * @type \Google\Protobuf\Timestamp $generate_time + * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key + * material was generated. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. The time at which this + * [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for expiration and + * can no longer be used to import key material. + * @type \Google\Protobuf\Timestamp $expire_event_time + * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] + * expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is + * [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED]. + * @type int $state + * Output only. The current state of the + * [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can be used. + * @type \Google\Cloud\Kms\V1\ImportJob\WrappingPublicKey $public_key + * Output only. The public key with which to wrap key material prior to + * import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is + * [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE]. + * @type \Google\Cloud\Kms\V1\KeyOperationAttestation $attestation + * Output only. Statement that was generated and signed by the key creator + * (for example, an HSM) at key creation time. Use this statement to verify + * attributes of the key as stored on the HSM, independently of Google. + * Only present if the chosen + * [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a + * protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name for this + * [ImportJob][google.cloud.kms.v1.ImportJob] in the format + * `projects/*/locations/*/keyRings/*/importJobs/*`. + * + * 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 for this + * [ImportJob][google.cloud.kms.v1.ImportJob] in the format + * `projects/*/locations/*/keyRings/*/importJobs/*`. + * + * 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; + } + + /** + * Required. Immutable. The wrapping method to be used for incoming key + * material. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportMethod import_method = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getImportMethod() + { + return $this->import_method; + } + + /** + * Required. Immutable. The wrapping method to be used for incoming key + * material. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportMethod import_method = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setImportMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ImportJob\ImportMethod::class); + $this->import_method = $var; + + return $this; + } + + /** + * Required. Immutable. The protection level of the + * [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * of the [version_template][google.cloud.kms.v1.CryptoKey.version_template] + * on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you attempt to import + * into. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * Required. Immutable. The protection level of the + * [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * of the [version_template][google.cloud.kms.v1.CryptoKey.version_template] + * on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you attempt to import + * into. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + + /** + * Output only. The time at which this + * [ImportJob][google.cloud.kms.v1.ImportJob] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time at which this + * [ImportJob][google.cloud.kms.v1.ImportJob] was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key + * material was generated. + * + * Generated from protobuf field .google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getGenerateTime() + { + return $this->generate_time; + } + + public function hasGenerateTime() + { + return isset($this->generate_time); + } + + public function clearGenerateTime() + { + unset($this->generate_time); + } + + /** + * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key + * material was generated. + * + * Generated from protobuf field .google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setGenerateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->generate_time = $var; + + return $this; + } + + /** + * Output only. The time at which this + * [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for expiration and + * can no longer be used to import key material. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. The time at which this + * [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for expiration and + * can no longer be used to import key material. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] + * expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is + * [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED]. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireEventTime() + { + return $this->expire_event_time; + } + + public function hasExpireEventTime() + { + return isset($this->expire_event_time); + } + + public function clearExpireEventTime() + { + unset($this->expire_event_time); + } + + /** + * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] + * expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is + * [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED]. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireEventTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_event_time = $var; + + return $this; + } + + /** + * Output only. The current state of the + * [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can be used. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the + * [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can be used. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ImportJob\ImportJobState::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The public key with which to wrap key material prior to + * import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is + * [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE]. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Kms\V1\ImportJob\WrappingPublicKey|null + */ + public function getPublicKey() + { + return $this->public_key; + } + + public function hasPublicKey() + { + return isset($this->public_key); + } + + public function clearPublicKey() + { + unset($this->public_key); + } + + /** + * Output only. The public key with which to wrap key material prior to + * import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is + * [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE]. + * + * Generated from protobuf field .google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Kms\V1\ImportJob\WrappingPublicKey $var + * @return $this + */ + public function setPublicKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\ImportJob\WrappingPublicKey::class); + $this->public_key = $var; + + return $this; + } + + /** + * Output only. Statement that was generated and signed by the key creator + * (for example, an HSM) at key creation time. Use this statement to verify + * attributes of the key as stored on the HSM, independently of Google. + * Only present if the chosen + * [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a + * protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Kms\V1\KeyOperationAttestation|null + */ + public function getAttestation() + { + return $this->attestation; + } + + public function hasAttestation() + { + return isset($this->attestation); + } + + public function clearAttestation() + { + unset($this->attestation); + } + + /** + * Output only. Statement that was generated and signed by the key creator + * (for example, an HSM) at key creation time. Use this statement to verify + * attributes of the key as stored on the HSM, independently of Google. + * Only present if the chosen + * [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a + * protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Kms\V1\KeyOperationAttestation $var + * @return $this + */ + public function setAttestation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\KeyOperationAttestation::class); + $this->attestation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportJobState.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportJobState.php new file mode 100644 index 000000000000..b6e7a3e918ae --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportJobState.php @@ -0,0 +1,79 @@ +google.cloud.kms.v1.ImportJob.ImportJobState + */ +class ImportJobState +{ + /** + * Not specified. + * + * Generated from protobuf enum IMPORT_JOB_STATE_UNSPECIFIED = 0; + */ + const IMPORT_JOB_STATE_UNSPECIFIED = 0; + /** + * The wrapping key for this job is still being generated. It may not be + * used. Cloud KMS will automatically mark this job as + * [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE] as soon as + * the wrapping key is generated. + * + * Generated from protobuf enum PENDING_GENERATION = 1; + */ + const PENDING_GENERATION = 1; + /** + * This job may be used in + * [CreateCryptoKey][google.cloud.kms.v1.KeyManagementService.CreateCryptoKey] + * and + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * requests. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * This job can no longer be used and may not leave this state once entered. + * + * Generated from protobuf enum EXPIRED = 3; + */ + const EXPIRED = 3; + + private static $valueToName = [ + self::IMPORT_JOB_STATE_UNSPECIFIED => 'IMPORT_JOB_STATE_UNSPECIFIED', + self::PENDING_GENERATION => 'PENDING_GENERATION', + self::ACTIVE => 'ACTIVE', + self::EXPIRED => 'EXPIRED', + ]; + + 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(ImportJobState::class, \Google\Cloud\Kms\V1\ImportJob_ImportJobState::class); + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportMethod.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportMethod.php new file mode 100644 index 000000000000..f9a854116277 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportMethod.php @@ -0,0 +1,120 @@ +google.cloud.kms.v1.ImportJob.ImportMethod + */ +class ImportMethod +{ + /** + * Not specified. + * + * Generated from protobuf enum IMPORT_METHOD_UNSPECIFIED = 0; + */ + const IMPORT_METHOD_UNSPECIFIED = 0; + /** + * This ImportMethod represents the CKM_RSA_AES_KEY_WRAP key wrapping + * scheme defined in the PKCS #11 standard. In summary, this involves + * wrapping the raw key with an ephemeral AES key, and wrapping the + * ephemeral AES key with a 3072 bit RSA key. For more details, see + * [RSA AES key wrap + * mechanism](http://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/cos01/pkcs11-curr-v2.40-cos01.html#_Toc408226908). + * + * Generated from protobuf enum RSA_OAEP_3072_SHA1_AES_256 = 1; + */ + const RSA_OAEP_3072_SHA1_AES_256 = 1; + /** + * This ImportMethod represents the CKM_RSA_AES_KEY_WRAP key wrapping + * scheme defined in the PKCS #11 standard. In summary, this involves + * wrapping the raw key with an ephemeral AES key, and wrapping the + * ephemeral AES key with a 4096 bit RSA key. For more details, see + * [RSA AES key wrap + * mechanism](http://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/cos01/pkcs11-curr-v2.40-cos01.html#_Toc408226908). + * + * Generated from protobuf enum RSA_OAEP_4096_SHA1_AES_256 = 2; + */ + const RSA_OAEP_4096_SHA1_AES_256 = 2; + /** + * This ImportMethod represents the CKM_RSA_AES_KEY_WRAP key wrapping + * scheme defined in the PKCS #11 standard. In summary, this involves + * wrapping the raw key with an ephemeral AES key, and wrapping the + * ephemeral AES key with a 3072 bit RSA key. For more details, see + * [RSA AES key wrap + * mechanism](http://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/cos01/pkcs11-curr-v2.40-cos01.html#_Toc408226908). + * + * Generated from protobuf enum RSA_OAEP_3072_SHA256_AES_256 = 3; + */ + const RSA_OAEP_3072_SHA256_AES_256 = 3; + /** + * This ImportMethod represents the CKM_RSA_AES_KEY_WRAP key wrapping + * scheme defined in the PKCS #11 standard. In summary, this involves + * wrapping the raw key with an ephemeral AES key, and wrapping the + * ephemeral AES key with a 4096 bit RSA key. For more details, see + * [RSA AES key wrap + * mechanism](http://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/cos01/pkcs11-curr-v2.40-cos01.html#_Toc408226908). + * + * Generated from protobuf enum RSA_OAEP_4096_SHA256_AES_256 = 4; + */ + const RSA_OAEP_4096_SHA256_AES_256 = 4; + /** + * This ImportMethod represents RSAES-OAEP with a 3072 bit RSA key. The + * key material to be imported is wrapped directly with the RSA key. Due + * to technical limitations of RSA wrapping, this method cannot be used to + * wrap RSA keys for import. + * + * Generated from protobuf enum RSA_OAEP_3072_SHA256 = 5; + */ + const RSA_OAEP_3072_SHA256 = 5; + /** + * This ImportMethod represents RSAES-OAEP with a 4096 bit RSA key. The + * key material to be imported is wrapped directly with the RSA key. Due + * to technical limitations of RSA wrapping, this method cannot be used to + * wrap RSA keys for import. + * + * Generated from protobuf enum RSA_OAEP_4096_SHA256 = 6; + */ + const RSA_OAEP_4096_SHA256 = 6; + + private static $valueToName = [ + self::IMPORT_METHOD_UNSPECIFIED => 'IMPORT_METHOD_UNSPECIFIED', + self::RSA_OAEP_3072_SHA1_AES_256 => 'RSA_OAEP_3072_SHA1_AES_256', + self::RSA_OAEP_4096_SHA1_AES_256 => 'RSA_OAEP_4096_SHA1_AES_256', + self::RSA_OAEP_3072_SHA256_AES_256 => 'RSA_OAEP_3072_SHA256_AES_256', + self::RSA_OAEP_4096_SHA256_AES_256 => 'RSA_OAEP_4096_SHA256_AES_256', + self::RSA_OAEP_3072_SHA256 => 'RSA_OAEP_3072_SHA256', + self::RSA_OAEP_4096_SHA256 => 'RSA_OAEP_4096_SHA256', + ]; + + 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(ImportMethod::class, \Google\Cloud\Kms\V1\ImportJob_ImportMethod::class); + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/WrappingPublicKey.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/WrappingPublicKey.php new file mode 100644 index 000000000000..63be4f5d952d --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/WrappingPublicKey.php @@ -0,0 +1,88 @@ +google.cloud.kms.v1.ImportJob.WrappingPublicKey + */ +class WrappingPublicKey extends \Google\Protobuf\Internal\Message +{ + /** + * The public key, encoded in PEM format. For more information, see the [RFC + * 7468](https://tools.ietf.org/html/rfc7468) sections for [General + * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] + * (https://tools.ietf.org/html/rfc7468#section-13). + * + * Generated from protobuf field string pem = 1; + */ + protected $pem = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $pem + * The public key, encoded in PEM format. For more information, see the [RFC + * 7468](https://tools.ietf.org/html/rfc7468) sections for [General + * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] + * (https://tools.ietf.org/html/rfc7468#section-13). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The public key, encoded in PEM format. For more information, see the [RFC + * 7468](https://tools.ietf.org/html/rfc7468) sections for [General + * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] + * (https://tools.ietf.org/html/rfc7468#section-13). + * + * Generated from protobuf field string pem = 1; + * @return string + */ + public function getPem() + { + return $this->pem; + } + + /** + * The public key, encoded in PEM format. For more information, see the [RFC + * 7468](https://tools.ietf.org/html/rfc7468) sections for [General + * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] + * (https://tools.ietf.org/html/rfc7468#section-13). + * + * Generated from protobuf field string pem = 1; + * @param string $var + * @return $this + */ + public function setPem($var) + { + GPBUtil::checkString($var, True); + $this->pem = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(WrappingPublicKey::class, \Google\Cloud\Kms\V1\ImportJob_WrappingPublicKey::class); + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation.php new file mode 100644 index 000000000000..faed7bffa9e1 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation.php @@ -0,0 +1,151 @@ +google.cloud.kms.v1.KeyOperationAttestation + */ +class KeyOperationAttestation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The format of the attestation data. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $format = 0; + /** + * Output only. The attestation data provided by the HSM when the key + * operation was performed. + * + * Generated from protobuf field bytes content = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $content = ''; + /** + * Output only. The certificate chains needed to validate the attestation + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.CertificateChains cert_chains = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $cert_chains = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $format + * Output only. The format of the attestation data. + * @type string $content + * Output only. The attestation data provided by the HSM when the key + * operation was performed. + * @type \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains $cert_chains + * Output only. The certificate chains needed to validate the attestation + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The format of the attestation data. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getFormat() + { + return $this->format; + } + + /** + * Output only. The format of the attestation data. + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setFormat($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\KeyOperationAttestation\AttestationFormat::class); + $this->format = $var; + + return $this; + } + + /** + * Output only. The attestation data provided by the HSM when the key + * operation was performed. + * + * Generated from protobuf field bytes content = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Output only. The attestation data provided by the HSM when the key + * operation was performed. + * + * Generated from protobuf field bytes content = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, False); + $this->content = $var; + + return $this; + } + + /** + * Output only. The certificate chains needed to validate the attestation + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.CertificateChains cert_chains = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains|null + */ + public function getCertChains() + { + return $this->cert_chains; + } + + public function hasCertChains() + { + return isset($this->cert_chains); + } + + public function clearCertChains() + { + unset($this->cert_chains); + } + + /** + * Output only. The certificate chains needed to validate the attestation + * + * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.CertificateChains cert_chains = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains $var + * @return $this + */ + public function setCertChains($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains::class); + $this->cert_chains = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/AttestationFormat.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/AttestationFormat.php new file mode 100644 index 000000000000..43880fade2c1 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/AttestationFormat.php @@ -0,0 +1,68 @@ +google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat + */ +class AttestationFormat +{ + /** + * Not specified. + * + * Generated from protobuf enum ATTESTATION_FORMAT_UNSPECIFIED = 0; + */ + const ATTESTATION_FORMAT_UNSPECIFIED = 0; + /** + * Cavium HSM attestation compressed with gzip. Note that this format is + * defined by Cavium and subject to change at any time. + * See + * https://www.marvell.com/products/security-solutions/nitrox-hs-adapters/software-key-attestation.html. + * + * Generated from protobuf enum CAVIUM_V1_COMPRESSED = 3; + */ + const CAVIUM_V1_COMPRESSED = 3; + /** + * Cavium HSM attestation V2 compressed with gzip. This is a new format + * introduced in Cavium's version 3.2-08. + * + * Generated from protobuf enum CAVIUM_V2_COMPRESSED = 4; + */ + const CAVIUM_V2_COMPRESSED = 4; + + private static $valueToName = [ + self::ATTESTATION_FORMAT_UNSPECIFIED => 'ATTESTATION_FORMAT_UNSPECIFIED', + self::CAVIUM_V1_COMPRESSED => 'CAVIUM_V1_COMPRESSED', + self::CAVIUM_V2_COMPRESSED => 'CAVIUM_V2_COMPRESSED', + ]; + + 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(AttestationFormat::class, \Google\Cloud\Kms\V1\KeyOperationAttestation_AttestationFormat::class); + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/CertificateChains.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/CertificateChains.php new file mode 100644 index 000000000000..b1eef375ad42 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/CertificateChains.php @@ -0,0 +1,140 @@ +google.cloud.kms.v1.KeyOperationAttestation.CertificateChains + */ +class CertificateChains extends \Google\Protobuf\Internal\Message +{ + /** + * Cavium certificate chain corresponding to the attestation. + * + * Generated from protobuf field repeated string cavium_certs = 1; + */ + private $cavium_certs; + /** + * Google card certificate chain corresponding to the attestation. + * + * Generated from protobuf field repeated string google_card_certs = 2; + */ + private $google_card_certs; + /** + * Google partition certificate chain corresponding to the attestation. + * + * Generated from protobuf field repeated string google_partition_certs = 3; + */ + private $google_partition_certs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $cavium_certs + * Cavium certificate chain corresponding to the attestation. + * @type array|\Google\Protobuf\Internal\RepeatedField $google_card_certs + * Google card certificate chain corresponding to the attestation. + * @type array|\Google\Protobuf\Internal\RepeatedField $google_partition_certs + * Google partition certificate chain corresponding to the attestation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Cavium certificate chain corresponding to the attestation. + * + * Generated from protobuf field repeated string cavium_certs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCaviumCerts() + { + return $this->cavium_certs; + } + + /** + * Cavium certificate chain corresponding to the attestation. + * + * Generated from protobuf field repeated string cavium_certs = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCaviumCerts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->cavium_certs = $arr; + + return $this; + } + + /** + * Google card certificate chain corresponding to the attestation. + * + * Generated from protobuf field repeated string google_card_certs = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGoogleCardCerts() + { + return $this->google_card_certs; + } + + /** + * Google card certificate chain corresponding to the attestation. + * + * Generated from protobuf field repeated string google_card_certs = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGoogleCardCerts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->google_card_certs = $arr; + + return $this; + } + + /** + * Google partition certificate chain corresponding to the attestation. + * + * Generated from protobuf field repeated string google_partition_certs = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGooglePartitionCerts() + { + return $this->google_partition_certs; + } + + /** + * Google partition certificate chain corresponding to the attestation. + * + * Generated from protobuf field repeated string google_partition_certs = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGooglePartitionCerts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->google_partition_certs = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CertificateChains::class, \Google\Cloud\Kms\V1\KeyOperationAttestation_CertificateChains::class); + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyRing.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyRing.php new file mode 100644 index 000000000000..797fe8942e0b --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyRing.php @@ -0,0 +1,124 @@ +google.cloud.kms.v1.KeyRing + */ +class KeyRing extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name for the + * [KeyRing][google.cloud.kms.v1.KeyRing] in the format + * `projects/*/locations/*/keyRings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The time at which this [KeyRing][google.cloud.kms.v1.KeyRing] + * was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name for the + * [KeyRing][google.cloud.kms.v1.KeyRing] in the format + * `projects/*/locations/*/keyRings/*`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time at which this [KeyRing][google.cloud.kms.v1.KeyRing] + * was created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name for the + * [KeyRing][google.cloud.kms.v1.KeyRing] in the format + * `projects/*/locations/*/keyRings/*`. + * + * 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 for the + * [KeyRing][google.cloud.kms.v1.KeyRing] in the format + * `projects/*/locations/*/keyRings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The time at which this [KeyRing][google.cloud.kms.v1.KeyRing] + * was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time at which this [KeyRing][google.cloud.kms.v1.KeyRing] + * was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsRequest.php new file mode 100644 index 000000000000..b429f3ce2435 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsRequest.php @@ -0,0 +1,314 @@ +google.cloud.kms.v1.ListCryptoKeyVersionsRequest + */ +class ListCryptoKeyVersionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Optional limit on the number of + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] to include in the + * response. Further [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] + * can subsequently be obtained by including the + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * The fields to include in the response. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + */ + protected $view = 0; + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. Please see + * {@see KeyManagementServiceClient::cryptoKeyName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\ListCryptoKeyVersionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * @type int $page_size + * Optional. Optional limit on the number of + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] to include in the + * response. Further [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] + * can subsequently be obtained by including the + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @type string $page_token + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]. + * @type int $view + * The fields to include in the response. + * @type string $filter + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type string $order_by + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * 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 + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Optional limit on the number of + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] to include in the + * response. Further [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] + * can subsequently be obtained by including the + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Optional limit on the number of + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] to include in the + * response. Further [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] + * can subsequently be obtained by including the + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * The fields to include in the response. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * The fields to include in the response. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionView::class); + $this->view = $var; + + return $this; + } + + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsResponse.php new file mode 100644 index 000000000000..bbbe9ccb0775 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsResponse.php @@ -0,0 +1,152 @@ +google.cloud.kms.v1.ListCryptoKeyVersionsResponse + */ +class ListCryptoKeyVersionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKeyVersion crypto_key_versions = 1; + */ + private $crypto_key_versions; + /** + * A token to retrieve next page of results. Pass this value in + * [ListCryptoKeyVersionsRequest.page_token][google.cloud.kms.v1.ListCryptoKeyVersionsRequest.page_token] + * to retrieve the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * The total number of + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] that matched the + * query. + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Kms\V1\CryptoKeyVersion>|\Google\Protobuf\Internal\RepeatedField $crypto_key_versions + * The list of [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * @type string $next_page_token + * A token to retrieve next page of results. Pass this value in + * [ListCryptoKeyVersionsRequest.page_token][google.cloud.kms.v1.ListCryptoKeyVersionsRequest.page_token] + * to retrieve the next page of results. + * @type int $total_size + * The total number of + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] that matched the + * query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKeyVersion crypto_key_versions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCryptoKeyVersions() + { + return $this->crypto_key_versions; + } + + /** + * The list of [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKeyVersion crypto_key_versions = 1; + * @param array<\Google\Cloud\Kms\V1\CryptoKeyVersion>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCryptoKeyVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\CryptoKeyVersion::class); + $this->crypto_key_versions = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. Pass this value in + * [ListCryptoKeyVersionsRequest.page_token][google.cloud.kms.v1.ListCryptoKeyVersionsRequest.page_token] + * 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 next page of results. Pass this value in + * [ListCryptoKeyVersionsRequest.page_token][google.cloud.kms.v1.ListCryptoKeyVersionsRequest.page_token] + * 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; + } + + /** + * The total number of + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] that matched the + * query. + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The total number of + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] that matched the + * query. + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysRequest.php new file mode 100644 index 000000000000..dc800232d1eb --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysRequest.php @@ -0,0 +1,309 @@ +google.cloud.kms.v1.ListCryptoKeysRequest + */ +class ListCryptoKeysRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Optional limit on the number of + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] to include in the response. + * Further [CryptoKeys][google.cloud.kms.v1.CryptoKey] can subsequently be + * obtained by including the + * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * The fields of the primary version to include in the response. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + */ + protected $version_view = 0; + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. Please see + * {@see KeyManagementServiceClient::keyRingName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\ListCryptoKeysRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. + * @type int $page_size + * Optional. Optional limit on the number of + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] to include in the response. + * Further [CryptoKeys][google.cloud.kms.v1.CryptoKey] can subsequently be + * obtained by including the + * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @type string $page_token + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]. + * @type int $version_view + * The fields of the primary version to include in the response. + * @type string $filter + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type string $order_by + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. + * + * 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 [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Optional limit on the number of + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] to include in the response. + * Further [CryptoKeys][google.cloud.kms.v1.CryptoKey] can subsequently be + * obtained by including the + * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Optional limit on the number of + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] to include in the response. + * Further [CryptoKeys][google.cloud.kms.v1.CryptoKey] can subsequently be + * obtained by including the + * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Optional pagination token, returned earlier via + * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * The fields of the primary version to include in the response. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + * @return int + */ + public function getVersionView() + { + return $this->version_view; + } + + /** + * The fields of the primary version to include in the response. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + * @param int $var + * @return $this + */ + public function setVersionView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionView::class); + $this->version_view = $var; + + return $this; + } + + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysResponse.php new file mode 100644 index 000000000000..256c1b36b885 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysResponse.php @@ -0,0 +1,148 @@ +google.cloud.kms.v1.ListCryptoKeysResponse + */ +class ListCryptoKeysResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKey crypto_keys = 1; + */ + private $crypto_keys; + /** + * A token to retrieve next page of results. Pass this value in + * [ListCryptoKeysRequest.page_token][google.cloud.kms.v1.ListCryptoKeysRequest.page_token] + * to retrieve the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * The total number of [CryptoKeys][google.cloud.kms.v1.CryptoKey] that + * matched the query. + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Kms\V1\CryptoKey>|\Google\Protobuf\Internal\RepeatedField $crypto_keys + * The list of [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * @type string $next_page_token + * A token to retrieve next page of results. Pass this value in + * [ListCryptoKeysRequest.page_token][google.cloud.kms.v1.ListCryptoKeysRequest.page_token] + * to retrieve the next page of results. + * @type int $total_size + * The total number of [CryptoKeys][google.cloud.kms.v1.CryptoKey] that + * matched the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKey crypto_keys = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCryptoKeys() + { + return $this->crypto_keys; + } + + /** + * The list of [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKey crypto_keys = 1; + * @param array<\Google\Cloud\Kms\V1\CryptoKey>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCryptoKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\CryptoKey::class); + $this->crypto_keys = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. Pass this value in + * [ListCryptoKeysRequest.page_token][google.cloud.kms.v1.ListCryptoKeysRequest.page_token] + * 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 next page of results. Pass this value in + * [ListCryptoKeysRequest.page_token][google.cloud.kms.v1.ListCryptoKeysRequest.page_token] + * 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; + } + + /** + * The total number of [CryptoKeys][google.cloud.kms.v1.CryptoKey] that + * matched the query. + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The total number of [CryptoKeys][google.cloud.kms.v1.CryptoKey] that + * matched the query. + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsRequest.php new file mode 100644 index 000000000000..00bdce40d8da --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsRequest.php @@ -0,0 +1,280 @@ +google.cloud.kms.v1.ListEkmConnectionsRequest + */ +class ListEkmConnectionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the location associated with the + * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format + * `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Optional limit on the number of + * [EkmConnections][google.cloud.kms.v1.EkmConnection] to include in the + * response. Further [EkmConnections][google.cloud.kms.v1.EkmConnection] can + * subsequently be obtained by including the + * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Optional pagination token, returned earlier via + * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The resource name of the location associated with the + * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format + * `projects/*/locations/*`. Please see + * {@see EkmServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\ListEkmConnectionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the location associated with the + * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format + * `projects/*/locations/*`. + * @type int $page_size + * Optional. Optional limit on the number of + * [EkmConnections][google.cloud.kms.v1.EkmConnection] to include in the + * response. Further [EkmConnections][google.cloud.kms.v1.EkmConnection] can + * subsequently be obtained by including the + * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @type string $page_token + * Optional. Optional pagination token, returned earlier via + * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token]. + * @type string $filter + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type string $order_by + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the location associated with the + * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format + * `projects/*/locations/*`. + * + * 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 location associated with the + * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format + * `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Optional limit on the number of + * [EkmConnections][google.cloud.kms.v1.EkmConnection] to include in the + * response. Further [EkmConnections][google.cloud.kms.v1.EkmConnection] can + * subsequently be obtained by including the + * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Optional limit on the number of + * [EkmConnections][google.cloud.kms.v1.EkmConnection] to include in the + * response. Further [EkmConnections][google.cloud.kms.v1.EkmConnection] can + * subsequently be obtained by including the + * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Optional pagination token, returned earlier via + * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Optional pagination token, returned earlier via + * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsResponse.php new file mode 100644 index 000000000000..cf84a145df5e --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsResponse.php @@ -0,0 +1,148 @@ +google.cloud.kms.v1.ListEkmConnectionsResponse + */ +class ListEkmConnectionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of [EkmConnections][google.cloud.kms.v1.EkmConnection]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection ekm_connections = 1; + */ + private $ekm_connections; + /** + * A token to retrieve next page of results. Pass this value in + * [ListEkmConnectionsRequest.page_token][google.cloud.kms.v1.ListEkmConnectionsRequest.page_token] + * to retrieve the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * The total number of [EkmConnections][google.cloud.kms.v1.EkmConnection] + * that matched the query. + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Kms\V1\EkmConnection>|\Google\Protobuf\Internal\RepeatedField $ekm_connections + * The list of [EkmConnections][google.cloud.kms.v1.EkmConnection]. + * @type string $next_page_token + * A token to retrieve next page of results. Pass this value in + * [ListEkmConnectionsRequest.page_token][google.cloud.kms.v1.ListEkmConnectionsRequest.page_token] + * to retrieve the next page of results. + * @type int $total_size + * The total number of [EkmConnections][google.cloud.kms.v1.EkmConnection] + * that matched the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * The list of [EkmConnections][google.cloud.kms.v1.EkmConnection]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection ekm_connections = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEkmConnections() + { + return $this->ekm_connections; + } + + /** + * The list of [EkmConnections][google.cloud.kms.v1.EkmConnection]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection ekm_connections = 1; + * @param array<\Google\Cloud\Kms\V1\EkmConnection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEkmConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\EkmConnection::class); + $this->ekm_connections = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. Pass this value in + * [ListEkmConnectionsRequest.page_token][google.cloud.kms.v1.ListEkmConnectionsRequest.page_token] + * 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 next page of results. Pass this value in + * [ListEkmConnectionsRequest.page_token][google.cloud.kms.v1.ListEkmConnectionsRequest.page_token] + * 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; + } + + /** + * The total number of [EkmConnections][google.cloud.kms.v1.EkmConnection] + * that matched the query. + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The total number of [EkmConnections][google.cloud.kms.v1.EkmConnection] + * that matched the query. + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsRequest.php new file mode 100644 index 000000000000..463eb5440cc1 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsRequest.php @@ -0,0 +1,275 @@ +google.cloud.kms.v1.ListImportJobsRequest + */ +class ListImportJobsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Optional limit on the number of + * [ImportJobs][google.cloud.kms.v1.ImportJob] to include in the response. + * Further [ImportJobs][google.cloud.kms.v1.ImportJob] can subsequently be + * obtained by including the + * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Optional pagination token, returned earlier via + * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. Please see + * {@see KeyManagementServiceClient::keyRingName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\ListImportJobsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. + * @type int $page_size + * Optional. Optional limit on the number of + * [ImportJobs][google.cloud.kms.v1.ImportJob] to include in the response. + * Further [ImportJobs][google.cloud.kms.v1.ImportJob] can subsequently be + * obtained by including the + * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @type string $page_token + * Optional. Optional pagination token, returned earlier via + * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token]. + * @type string $filter + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type string $order_by + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. + * + * 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 [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Optional limit on the number of + * [ImportJobs][google.cloud.kms.v1.ImportJob] to include in the response. + * Further [ImportJobs][google.cloud.kms.v1.ImportJob] can subsequently be + * obtained by including the + * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Optional limit on the number of + * [ImportJobs][google.cloud.kms.v1.ImportJob] to include in the response. + * Further [ImportJobs][google.cloud.kms.v1.ImportJob] can subsequently be + * obtained by including the + * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Optional pagination token, returned earlier via + * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Optional pagination token, returned earlier via + * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsResponse.php new file mode 100644 index 000000000000..04f11ca76dd2 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsResponse.php @@ -0,0 +1,148 @@ +google.cloud.kms.v1.ListImportJobsResponse + */ +class ListImportJobsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of [ImportJobs][google.cloud.kms.v1.ImportJob]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.ImportJob import_jobs = 1; + */ + private $import_jobs; + /** + * A token to retrieve next page of results. Pass this value in + * [ListImportJobsRequest.page_token][google.cloud.kms.v1.ListImportJobsRequest.page_token] + * to retrieve the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * The total number of [ImportJobs][google.cloud.kms.v1.ImportJob] that + * matched the query. + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Kms\V1\ImportJob>|\Google\Protobuf\Internal\RepeatedField $import_jobs + * The list of [ImportJobs][google.cloud.kms.v1.ImportJob]. + * @type string $next_page_token + * A token to retrieve next page of results. Pass this value in + * [ListImportJobsRequest.page_token][google.cloud.kms.v1.ListImportJobsRequest.page_token] + * to retrieve the next page of results. + * @type int $total_size + * The total number of [ImportJobs][google.cloud.kms.v1.ImportJob] that + * matched the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of [ImportJobs][google.cloud.kms.v1.ImportJob]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.ImportJob import_jobs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getImportJobs() + { + return $this->import_jobs; + } + + /** + * The list of [ImportJobs][google.cloud.kms.v1.ImportJob]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.ImportJob import_jobs = 1; + * @param array<\Google\Cloud\Kms\V1\ImportJob>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setImportJobs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\ImportJob::class); + $this->import_jobs = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. Pass this value in + * [ListImportJobsRequest.page_token][google.cloud.kms.v1.ListImportJobsRequest.page_token] + * 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 next page of results. Pass this value in + * [ListImportJobsRequest.page_token][google.cloud.kms.v1.ListImportJobsRequest.page_token] + * 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; + } + + /** + * The total number of [ImportJobs][google.cloud.kms.v1.ImportJob] that + * matched the query. + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The total number of [ImportJobs][google.cloud.kms.v1.ImportJob] that + * matched the query. + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsRequest.php new file mode 100644 index 000000000000..5f2032f8741e --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsRequest.php @@ -0,0 +1,280 @@ +google.cloud.kms.v1.ListKeyRingsRequest + */ +class ListKeyRingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Optional limit on the number of + * [KeyRings][google.cloud.kms.v1.KeyRing] to include in the response. Further + * [KeyRings][google.cloud.kms.v1.KeyRing] can subsequently be obtained by + * including the + * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Optional pagination token, returned earlier via + * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. Please see + * {@see KeyManagementServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\ListKeyRingsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. + * @type int $page_size + * Optional. Optional limit on the number of + * [KeyRings][google.cloud.kms.v1.KeyRing] to include in the response. Further + * [KeyRings][google.cloud.kms.v1.KeyRing] can subsequently be obtained by + * including the + * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @type string $page_token + * Optional. Optional pagination token, returned earlier via + * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token]. + * @type string $filter + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type string $order_by + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. + * + * 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 location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Optional limit on the number of + * [KeyRings][google.cloud.kms.v1.KeyRing] to include in the response. Further + * [KeyRings][google.cloud.kms.v1.KeyRing] can subsequently be obtained by + * including the + * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Optional limit on the number of + * [KeyRings][google.cloud.kms.v1.KeyRing] to include in the response. Further + * [KeyRings][google.cloud.kms.v1.KeyRing] can subsequently be obtained by + * including the + * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token] + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Optional pagination token, returned earlier via + * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Optional pagination token, returned earlier via + * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token]. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsResponse.php new file mode 100644 index 000000000000..3deac0ea2e0f --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsResponse.php @@ -0,0 +1,148 @@ +google.cloud.kms.v1.ListKeyRingsResponse + */ +class ListKeyRingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of [KeyRings][google.cloud.kms.v1.KeyRing]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.KeyRing key_rings = 1; + */ + private $key_rings; + /** + * A token to retrieve next page of results. Pass this value in + * [ListKeyRingsRequest.page_token][google.cloud.kms.v1.ListKeyRingsRequest.page_token] + * to retrieve the next page of results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * The total number of [KeyRings][google.cloud.kms.v1.KeyRing] that matched + * the query. + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Kms\V1\KeyRing>|\Google\Protobuf\Internal\RepeatedField $key_rings + * The list of [KeyRings][google.cloud.kms.v1.KeyRing]. + * @type string $next_page_token + * A token to retrieve next page of results. Pass this value in + * [ListKeyRingsRequest.page_token][google.cloud.kms.v1.ListKeyRingsRequest.page_token] + * to retrieve the next page of results. + * @type int $total_size + * The total number of [KeyRings][google.cloud.kms.v1.KeyRing] that matched + * the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of [KeyRings][google.cloud.kms.v1.KeyRing]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.KeyRing key_rings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKeyRings() + { + return $this->key_rings; + } + + /** + * The list of [KeyRings][google.cloud.kms.v1.KeyRing]. + * + * Generated from protobuf field repeated .google.cloud.kms.v1.KeyRing key_rings = 1; + * @param array<\Google\Cloud\Kms\V1\KeyRing>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKeyRings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\KeyRing::class); + $this->key_rings = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. Pass this value in + * [ListKeyRingsRequest.page_token][google.cloud.kms.v1.ListKeyRingsRequest.page_token] + * 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 next page of results. Pass this value in + * [ListKeyRingsRequest.page_token][google.cloud.kms.v1.ListKeyRingsRequest.page_token] + * 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; + } + + /** + * The total number of [KeyRings][google.cloud.kms.v1.KeyRing] that matched + * the query. + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The total number of [KeyRings][google.cloud.kms.v1.KeyRing] that matched + * the query. + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/LocationMetadata.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/LocationMetadata.php new file mode 100644 index 000000000000..656adb13aac7 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/LocationMetadata.php @@ -0,0 +1,126 @@ +google.cloud.kms.v1.LocationMetadata + */ +class LocationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this + * location. + * + * Generated from protobuf field bool hsm_available = 1; + */ + protected $hsm_available = false; + /** + * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] can be created in + * this location. + * + * Generated from protobuf field bool ekm_available = 2; + */ + protected $ekm_available = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $hsm_available + * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this + * location. + * @type bool $ekm_available + * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] can be created in + * this location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this + * location. + * + * Generated from protobuf field bool hsm_available = 1; + * @return bool + */ + public function getHsmAvailable() + { + return $this->hsm_available; + } + + /** + * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this + * location. + * + * Generated from protobuf field bool hsm_available = 1; + * @param bool $var + * @return $this + */ + public function setHsmAvailable($var) + { + GPBUtil::checkBool($var); + $this->hsm_available = $var; + + return $this; + } + + /** + * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] can be created in + * this location. + * + * Generated from protobuf field bool ekm_available = 2; + * @return bool + */ + public function getEkmAvailable() + { + return $this->ekm_available; + } + + /** + * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] can be created in + * this location. + * + * Generated from protobuf field bool ekm_available = 2; + * @param bool $var + * @return $this + */ + public function setEkmAvailable($var) + { + GPBUtil::checkBool($var); + $this->ekm_available = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignRequest.php new file mode 100644 index 000000000000..efc81a1661d3 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignRequest.php @@ -0,0 +1,300 @@ +google.cloud.kms.v1.MacSignRequest + */ +class MacSignRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The data to sign. The MAC tag is computed over this data field + * based on the specific algorithm. + * + * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data = ''; + /** + * Optional. An optional CRC32C checksum of the + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is + * equal to + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $data_crc32c = null; + + /** + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. Please see + * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. + * @param string $data Required. The data to sign. The MAC tag is computed over this data field + * based on the specific algorithm. + * + * @return \Google\Cloud\Kms\V1\MacSignRequest + * + * @experimental + */ + public static function build(string $name, string $data): self + { + return (new self()) + ->setName($name) + ->setData($data); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. + * @type string $data + * Required. The data to sign. The MAC tag is computed over this data field + * based on the specific algorithm. + * @type \Google\Protobuf\Int64Value $data_crc32c + * Optional. An optional CRC32C checksum of the + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is + * equal to + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. + * + * 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 + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. + * + * 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; + } + + /** + * Required. The data to sign. The MAC tag is computed over this data field + * based on the specific algorithm. + * + * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getData() + { + return $this->data; + } + + /** + * Required. The data to sign. The MAC tag is computed over this data field + * based on the specific algorithm. + * + * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkString($var, False); + $this->data = $var; + + return $this; + } + + /** + * Optional. An optional CRC32C checksum of the + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is + * equal to + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getDataCrc32C() + { + return $this->data_crc32c; + } + + public function hasDataCrc32C() + { + return isset($this->data_crc32c); + } + + public function clearDataCrc32C() + { + unset($this->data_crc32c); + } + + /** + * Returns the unboxed value from getDataCrc32C() + + * Optional. An optional CRC32C checksum of the + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is + * equal to + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getDataCrc32CUnwrapped() + { + return $this->readWrapperValue("data_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is + * equal to + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setDataCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->data_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is + * equal to + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setDataCrc32CUnwrapped($var) + { + $this->writeWrapperValue("data_crc32c", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignResponse.php new file mode 100644 index 000000000000..632a972782b3 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignResponse.php @@ -0,0 +1,377 @@ +google.cloud.kms.v1.MacSignResponse + */ +class MacSignResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * Check this field to verify that the intended resource was used for signing. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The created signature. + * + * Generated from protobuf field bytes mac = 2; + */ + protected $mac = ''; + /** + * Integrity verification field. A CRC32C checksum of the returned + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An + * integrity check of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be + * performed by computing the CRC32C checksum of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and + * comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 3; + */ + protected $mac_crc32c = null; + /** + * Integrity verification field. A flag indicating whether + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacSignRequest.data]. A false value of this + * field indicates either that + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_data_crc32c = 4; + */ + protected $verified_data_crc32c = false; + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; + */ + protected $protection_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * Check this field to verify that the intended resource was used for signing. + * @type string $mac + * The created signature. + * @type \Google\Protobuf\Int64Value $mac_crc32c + * Integrity verification field. A CRC32C checksum of the returned + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An + * integrity check of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be + * performed by computing the CRC32C checksum of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and + * comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * @type bool $verified_data_crc32c + * Integrity verification field. A flag indicating whether + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacSignRequest.data]. A false value of this + * field indicates either that + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type int $protection_level + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * Check this field to verify that the intended resource was used for signing. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * Check this field to verify that the intended resource was used for signing. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The created signature. + * + * Generated from protobuf field bytes mac = 2; + * @return string + */ + public function getMac() + { + return $this->mac; + } + + /** + * The created signature. + * + * Generated from protobuf field bytes mac = 2; + * @param string $var + * @return $this + */ + public function setMac($var) + { + GPBUtil::checkString($var, False); + $this->mac = $var; + + return $this; + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An + * integrity check of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be + * performed by computing the CRC32C checksum of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and + * comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 3; + * @return \Google\Protobuf\Int64Value|null + */ + public function getMacCrc32C() + { + return $this->mac_crc32c; + } + + public function hasMacCrc32C() + { + return isset($this->mac_crc32c); + } + + public function clearMacCrc32C() + { + unset($this->mac_crc32c); + } + + /** + * Returns the unboxed value from getMacCrc32C() + + * Integrity verification field. A CRC32C checksum of the returned + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An + * integrity check of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be + * performed by computing the CRC32C checksum of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and + * comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 3; + * @return int|string|null + */ + public function getMacCrc32CUnwrapped() + { + return $this->readWrapperValue("mac_crc32c"); + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An + * integrity check of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be + * performed by computing the CRC32C checksum of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and + * comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 3; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setMacCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->mac_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Integrity verification field. A CRC32C checksum of the returned + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An + * integrity check of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be + * performed by computing the CRC32C checksum of + * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and + * comparing your results to this field. Discard the response in case of + * non-matching checksum values, and perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 3; + * @param int|string|null $var + * @return $this + */ + public function setMacCrc32CUnwrapped($var) + { + $this->writeWrapperValue("mac_crc32c", $var); + return $this;} + + /** + * Integrity verification field. A flag indicating whether + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacSignRequest.data]. A false value of this + * field indicates either that + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_data_crc32c = 4; + * @return bool + */ + public function getVerifiedDataCrc32C() + { + return $this->verified_data_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacSignRequest.data]. A false value of this + * field indicates either that + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_data_crc32c = 4; + * @param bool $var + * @return $this + */ + public function setVerifiedDataCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_data_crc32c = $var; + + return $this; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyRequest.php new file mode 100644 index 000000000000..57af029a1136 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyRequest.php @@ -0,0 +1,508 @@ +google.cloud.kms.v1.MacVerifyRequest + */ +class MacVerifyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * verification. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The data used previously as a + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate + * the MAC tag. + * + * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data = ''; + /** + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) + * is equal to + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $data_crc32c = null; + /** + * Required. The signature to verify. + * + * Generated from protobuf field bytes mac = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $mac = ''; + /** + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.tag][]) is equal to + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mac_crc32c = null; + + /** + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * verification. Please see + * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. + * @param string $data Required. The data used previously as a + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate + * the MAC tag. + * @param string $mac Required. The signature to verify. + * + * @return \Google\Cloud\Kms\V1\MacVerifyRequest + * + * @experimental + */ + public static function build(string $name, string $data, string $mac): self + { + return (new self()) + ->setName($name) + ->setData($data) + ->setMac($mac); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * verification. + * @type string $data + * Required. The data used previously as a + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate + * the MAC tag. + * @type \Google\Protobuf\Int64Value $data_crc32c + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) + * is equal to + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type string $mac + * Required. The signature to verify. + * @type \Google\Protobuf\Int64Value $mac_crc32c + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.tag][]) is equal to + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * verification. + * + * 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 + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * verification. + * + * 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; + } + + /** + * Required. The data used previously as a + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate + * the MAC tag. + * + * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getData() + { + return $this->data; + } + + /** + * Required. The data used previously as a + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate + * the MAC tag. + * + * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkString($var, False); + $this->data = $var; + + return $this; + } + + /** + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) + * is equal to + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getDataCrc32C() + { + return $this->data_crc32c; + } + + public function hasDataCrc32C() + { + return isset($this->data_crc32c); + } + + public function clearDataCrc32C() + { + unset($this->data_crc32c); + } + + /** + * Returns the unboxed value from getDataCrc32C() + + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) + * is equal to + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getDataCrc32CUnwrapped() + { + return $this->readWrapperValue("data_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) + * is equal to + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setDataCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->data_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) + * is equal to + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setDataCrc32CUnwrapped($var) + { + $this->writeWrapperValue("data_crc32c", $var); + return $this;} + + /** + * Required. The signature to verify. + * + * Generated from protobuf field bytes mac = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMac() + { + return $this->mac; + } + + /** + * Required. The signature to verify. + * + * Generated from protobuf field bytes mac = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMac($var) + { + GPBUtil::checkString($var, False); + $this->mac = $var; + + return $this; + } + + /** + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.tag][]) is equal to + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getMacCrc32C() + { + return $this->mac_crc32c; + } + + public function hasMacCrc32C() + { + return isset($this->mac_crc32c); + } + + public function clearMacCrc32C() + { + unset($this->mac_crc32c); + } + + /** + * Returns the unboxed value from getMacCrc32C() + + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.tag][]) is equal to + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getMacCrc32CUnwrapped() + { + return $this->readWrapperValue("mac_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.tag][]) is equal to + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setMacCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->mac_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.tag][]) is equal to + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * + * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setMacCrc32CUnwrapped($var) + { + $this->writeWrapperValue("mac_crc32c", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyResponse.php new file mode 100644 index 000000000000..457f9f454810 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyResponse.php @@ -0,0 +1,386 @@ +google.cloud.kms.v1.MacVerifyResponse + */ +class MacVerifyResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for + * verification. Check this field to verify that the intended resource was + * used for verification. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * This field indicates whether or not the verification operation for + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] over + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] was + * successful. + * + * Generated from protobuf field bool success = 2; + */ + protected $success = false; + /** + * Integrity verification field. A flag indicating whether + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacVerifyRequest.data]. A false value of this + * field indicates either that + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_data_crc32c = 3; + */ + protected $verified_data_crc32c = false; + /** + * Integrity verification field. A flag indicating whether + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacVerifyRequest.mac]. A false value of this + * field indicates either that + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_mac_crc32c = 4; + */ + protected $verified_mac_crc32c = false; + /** + * Integrity verification field. This value is used for the integrity + * verification of [MacVerifyResponse.success]. If the value of this field + * contradicts the value of [MacVerifyResponse.success], discard the response + * and perform a limited number of retries. + * + * Generated from protobuf field bool verified_success_integrity = 5; + */ + protected $verified_success_integrity = false; + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for + * verification. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; + */ + protected $protection_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for + * verification. Check this field to verify that the intended resource was + * used for verification. + * @type bool $success + * This field indicates whether or not the verification operation for + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] over + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] was + * successful. + * @type bool $verified_data_crc32c + * Integrity verification field. A flag indicating whether + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacVerifyRequest.data]. A false value of this + * field indicates either that + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type bool $verified_mac_crc32c + * Integrity verification field. A flag indicating whether + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacVerifyRequest.mac]. A false value of this + * field indicates either that + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type bool $verified_success_integrity + * Integrity verification field. This value is used for the integrity + * verification of [MacVerifyResponse.success]. If the value of this field + * contradicts the value of [MacVerifyResponse.success], discard the response + * and perform a limited number of retries. + * @type int $protection_level + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for + * verification. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for + * verification. Check this field to verify that the intended resource was + * used for verification. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for + * verification. Check this field to verify that the intended resource was + * used for verification. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * This field indicates whether or not the verification operation for + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] over + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] was + * successful. + * + * Generated from protobuf field bool success = 2; + * @return bool + */ + public function getSuccess() + { + return $this->success; + } + + /** + * This field indicates whether or not the verification operation for + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] over + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] was + * successful. + * + * Generated from protobuf field bool success = 2; + * @param bool $var + * @return $this + */ + public function setSuccess($var) + { + GPBUtil::checkBool($var); + $this->success = $var; + + return $this; + } + + /** + * Integrity verification field. A flag indicating whether + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacVerifyRequest.data]. A false value of this + * field indicates either that + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_data_crc32c = 3; + * @return bool + */ + public function getVerifiedDataCrc32C() + { + return $this->verified_data_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacVerifyRequest.data]. A false value of this + * field indicates either that + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_data_crc32c = 3; + * @param bool $var + * @return $this + */ + public function setVerifiedDataCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_data_crc32c = $var; + + return $this; + } + + /** + * Integrity verification field. A flag indicating whether + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacVerifyRequest.mac]. A false value of this + * field indicates either that + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_mac_crc32c = 4; + * @return bool + */ + public function getVerifiedMacCrc32C() + { + return $this->verified_mac_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the + * [data][google.cloud.kms.v1.MacVerifyRequest.mac]. A false value of this + * field indicates either that + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_mac_crc32c = 4; + * @param bool $var + * @return $this + */ + public function setVerifiedMacCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_mac_crc32c = $var; + + return $this; + } + + /** + * Integrity verification field. This value is used for the integrity + * verification of [MacVerifyResponse.success]. If the value of this field + * contradicts the value of [MacVerifyResponse.success], discard the response + * and perform a limited number of retries. + * + * Generated from protobuf field bool verified_success_integrity = 5; + * @return bool + */ + public function getVerifiedSuccessIntegrity() + { + return $this->verified_success_integrity; + } + + /** + * Integrity verification field. This value is used for the integrity + * verification of [MacVerifyResponse.success]. If the value of this field + * contradicts the value of [MacVerifyResponse.success], discard the response + * and perform a limited number of retries. + * + * Generated from protobuf field bool verified_success_integrity = 5; + * @param bool $var + * @return $this + */ + public function setVerifiedSuccessIntegrity($var) + { + GPBUtil::checkBool($var); + $this->verified_success_integrity = $var; + + return $this; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for + * verification. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for + * verification. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ProtectionLevel.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ProtectionLevel.php new file mode 100644 index 000000000000..e6f74d6c62b8 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ProtectionLevel.php @@ -0,0 +1,77 @@ +google.cloud.kms.v1.ProtectionLevel + */ +class ProtectionLevel +{ + /** + * Not specified. + * + * Generated from protobuf enum PROTECTION_LEVEL_UNSPECIFIED = 0; + */ + const PROTECTION_LEVEL_UNSPECIFIED = 0; + /** + * Crypto operations are performed in software. + * + * Generated from protobuf enum SOFTWARE = 1; + */ + const SOFTWARE = 1; + /** + * Crypto operations are performed in a Hardware Security Module. + * + * Generated from protobuf enum HSM = 2; + */ + const HSM = 2; + /** + * Crypto operations are performed by an external key manager. + * + * Generated from protobuf enum EXTERNAL = 3; + */ + const EXTERNAL = 3; + /** + * Crypto operations are performed in an EKM-over-VPC backend. + * + * Generated from protobuf enum EXTERNAL_VPC = 4; + */ + const EXTERNAL_VPC = 4; + + private static $valueToName = [ + self::PROTECTION_LEVEL_UNSPECIFIED => 'PROTECTION_LEVEL_UNSPECIFIED', + self::SOFTWARE => 'SOFTWARE', + self::HSM => 'HSM', + self::EXTERNAL => 'EXTERNAL', + self::EXTERNAL_VPC => 'EXTERNAL_VPC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/PublicKey.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/PublicKey.php new file mode 100644 index 000000000000..7309923596b0 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/PublicKey.php @@ -0,0 +1,354 @@ +google.cloud.kms.v1.PublicKey + */ +class PublicKey extends \Google\Protobuf\Internal\Message +{ + /** + * The public key, encoded in PEM format. For more information, see the + * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for + * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] + * (https://tools.ietf.org/html/rfc7468#section-13). + * + * Generated from protobuf field string pem = 1; + */ + protected $pem = ''; + /** + * The + * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * associated with this key. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + */ + protected $algorithm = 0; + /** + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by + * computing the CRC32C checksum of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your + * results to this field. Discard the response in case of non-matching + * checksum values, and perform a limited number of retries. A persistent + * mismatch may indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * NOTE: This field is in Beta. + * + * Generated from protobuf field .google.protobuf.Int64Value pem_crc32c = 3; + */ + protected $pem_crc32c = null; + /** + * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. + * Provided here for verification. + * NOTE: This field is in Beta. + * + * Generated from protobuf field string name = 4; + */ + protected $name = ''; + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; + */ + protected $protection_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $pem + * The public key, encoded in PEM format. For more information, see the + * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for + * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] + * (https://tools.ietf.org/html/rfc7468#section-13). + * @type int $algorithm + * The + * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * associated with this key. + * @type \Google\Protobuf\Int64Value $pem_crc32c + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by + * computing the CRC32C checksum of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your + * results to this field. Discard the response in case of non-matching + * checksum values, and perform a limited number of retries. A persistent + * mismatch may indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * NOTE: This field is in Beta. + * @type string $name + * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. + * Provided here for verification. + * NOTE: This field is in Beta. + * @type int $protection_level + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The public key, encoded in PEM format. For more information, see the + * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for + * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] + * (https://tools.ietf.org/html/rfc7468#section-13). + * + * Generated from protobuf field string pem = 1; + * @return string + */ + public function getPem() + { + return $this->pem; + } + + /** + * The public key, encoded in PEM format. For more information, see the + * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for + * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] + * (https://tools.ietf.org/html/rfc7468#section-13). + * + * Generated from protobuf field string pem = 1; + * @param string $var + * @return $this + */ + public function setPem($var) + { + GPBUtil::checkString($var, True); + $this->pem = $var; + + return $this; + } + + /** + * The + * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * associated with this key. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + * @return int + */ + public function getAlgorithm() + { + return $this->algorithm; + } + + /** + * The + * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * associated with this key. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + * @param int $var + * @return $this + */ + public function setAlgorithm($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionAlgorithm::class); + $this->algorithm = $var; + + return $this; + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by + * computing the CRC32C checksum of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your + * results to this field. Discard the response in case of non-matching + * checksum values, and perform a limited number of retries. A persistent + * mismatch may indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * NOTE: This field is in Beta. + * + * Generated from protobuf field .google.protobuf.Int64Value pem_crc32c = 3; + * @return \Google\Protobuf\Int64Value|null + */ + public function getPemCrc32C() + { + return $this->pem_crc32c; + } + + public function hasPemCrc32C() + { + return isset($this->pem_crc32c); + } + + public function clearPemCrc32C() + { + unset($this->pem_crc32c); + } + + /** + * Returns the unboxed value from getPemCrc32C() + + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by + * computing the CRC32C checksum of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your + * results to this field. Discard the response in case of non-matching + * checksum values, and perform a limited number of retries. A persistent + * mismatch may indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * NOTE: This field is in Beta. + * + * Generated from protobuf field .google.protobuf.Int64Value pem_crc32c = 3; + * @return int|string|null + */ + public function getPemCrc32CUnwrapped() + { + return $this->readWrapperValue("pem_crc32c"); + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by + * computing the CRC32C checksum of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your + * results to this field. Discard the response in case of non-matching + * checksum values, and perform a limited number of retries. A persistent + * mismatch may indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * NOTE: This field is in Beta. + * + * Generated from protobuf field .google.protobuf.Int64Value pem_crc32c = 3; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setPemCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->pem_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by + * computing the CRC32C checksum of + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your + * results to this field. Discard the response in case of non-matching + * checksum values, and perform a limited number of retries. A persistent + * mismatch may indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * NOTE: This field is in Beta. + * + * Generated from protobuf field .google.protobuf.Int64Value pem_crc32c = 3; + * @param int|string|null $var + * @return $this + */ + public function setPemCrc32CUnwrapped($var) + { + $this->writeWrapperValue("pem_crc32c", $var); + return $this;} + + /** + * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. + * Provided here for verification. + * NOTE: This field is in Beta. + * + * Generated from protobuf field string name = 4; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. + * Provided here for verification. + * NOTE: This field is in Beta. + * + * Generated from protobuf field string name = 4; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptRequest.php new file mode 100644 index 000000000000..3d6cd5c1a96f --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptRequest.php @@ -0,0 +1,707 @@ +google.cloud.kms.v1.RawDecryptRequest + */ +class RawDecryptRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The encrypted data originally returned in + * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. + * + * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ciphertext = ''; + /** + * Optional. Optional data that must match the data originally supplied in + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $additional_authenticated_data = ''; + /** + * Required. The initialization vector (IV) used during encryption, which must + * match the data originally provided in + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * + * Generated from protobuf field bytes initialization_vector = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $initialization_vector = ''; + /** + * The length of the authentication tag that is appended to the end of + * the ciphertext. If unspecified (0), the default value for the key's + * algorithm will be used (for AES-GCM, the default value is 16). + * + * Generated from protobuf field int32 tag_length = 5; + */ + protected $tag_length = 0; + /** + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received ciphertext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(ciphertext) is equal + * to ciphertext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ciphertext_crc32c = null; + /** + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $additional_authenticated_data_crc32c = null; + /** + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and + * if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $initialization_vector_crc32c = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. + * @type string $ciphertext + * Required. The encrypted data originally returned in + * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. + * @type string $additional_authenticated_data + * Optional. Optional data that must match the data originally supplied in + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * @type string $initialization_vector + * Required. The initialization vector (IV) used during encryption, which must + * match the data originally provided in + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * @type int $tag_length + * The length of the authentication tag that is appended to the end of + * the ciphertext. If unspecified (0), the default value for the key's + * algorithm will be used (for AES-GCM, the default value is 16). + * @type \Google\Protobuf\Int64Value $ciphertext_crc32c + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received ciphertext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(ciphertext) is equal + * to ciphertext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * @type \Google\Protobuf\Int64Value $additional_authenticated_data_crc32c + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * @type \Google\Protobuf\Int64Value $initialization_vector_crc32c + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and + * if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. + * + * 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; + } + + /** + * Required. The encrypted data originally returned in + * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. + * + * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCiphertext() + { + return $this->ciphertext; + } + + /** + * Required. The encrypted data originally returned in + * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. + * + * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCiphertext($var) + { + GPBUtil::checkString($var, False); + $this->ciphertext = $var; + + return $this; + } + + /** + * Optional. Optional data that must match the data originally supplied in + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAdditionalAuthenticatedData() + { + return $this->additional_authenticated_data; + } + + /** + * Optional. Optional data that must match the data originally supplied in + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAdditionalAuthenticatedData($var) + { + GPBUtil::checkString($var, False); + $this->additional_authenticated_data = $var; + + return $this; + } + + /** + * Required. The initialization vector (IV) used during encryption, which must + * match the data originally provided in + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * + * Generated from protobuf field bytes initialization_vector = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInitializationVector() + { + return $this->initialization_vector; + } + + /** + * Required. The initialization vector (IV) used during encryption, which must + * match the data originally provided in + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * + * Generated from protobuf field bytes initialization_vector = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInitializationVector($var) + { + GPBUtil::checkString($var, False); + $this->initialization_vector = $var; + + return $this; + } + + /** + * The length of the authentication tag that is appended to the end of + * the ciphertext. If unspecified (0), the default value for the key's + * algorithm will be used (for AES-GCM, the default value is 16). + * + * Generated from protobuf field int32 tag_length = 5; + * @return int + */ + public function getTagLength() + { + return $this->tag_length; + } + + /** + * The length of the authentication tag that is appended to the end of + * the ciphertext. If unspecified (0), the default value for the key's + * algorithm will be used (for AES-GCM, the default value is 16). + * + * Generated from protobuf field int32 tag_length = 5; + * @param int $var + * @return $this + */ + public function setTagLength($var) + { + GPBUtil::checkInt32($var); + $this->tag_length = $var; + + return $this; + } + + /** + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received ciphertext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(ciphertext) is equal + * to ciphertext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getCiphertextCrc32C() + { + return $this->ciphertext_crc32c; + } + + public function hasCiphertextCrc32C() + { + return isset($this->ciphertext_crc32c); + } + + public function clearCiphertextCrc32C() + { + unset($this->ciphertext_crc32c); + } + + /** + * Returns the unboxed value from getCiphertextCrc32C() + + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received ciphertext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(ciphertext) is equal + * to ciphertext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getCiphertextCrc32CUnwrapped() + { + return $this->readWrapperValue("ciphertext_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received ciphertext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(ciphertext) is equal + * to ciphertext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setCiphertextCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->ciphertext_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received ciphertext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(ciphertext) is equal + * to ciphertext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setCiphertextCrc32CUnwrapped($var) + { + $this->writeWrapperValue("ciphertext_crc32c", $var); + return $this;} + + /** + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getAdditionalAuthenticatedDataCrc32C() + { + return $this->additional_authenticated_data_crc32c; + } + + public function hasAdditionalAuthenticatedDataCrc32C() + { + return isset($this->additional_authenticated_data_crc32c); + } + + public function clearAdditionalAuthenticatedDataCrc32C() + { + unset($this->additional_authenticated_data_crc32c); + } + + /** + * Returns the unboxed value from getAdditionalAuthenticatedDataCrc32C() + + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getAdditionalAuthenticatedDataCrc32CUnwrapped() + { + return $this->readWrapperValue("additional_authenticated_data_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setAdditionalAuthenticatedDataCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->additional_authenticated_data_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setAdditionalAuthenticatedDataCrc32CUnwrapped($var) + { + $this->writeWrapperValue("additional_authenticated_data_crc32c", $var); + return $this;} + + /** + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and + * if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getInitializationVectorCrc32C() + { + return $this->initialization_vector_crc32c; + } + + public function hasInitializationVectorCrc32C() + { + return isset($this->initialization_vector_crc32c); + } + + public function clearInitializationVectorCrc32C() + { + unset($this->initialization_vector_crc32c); + } + + /** + * Returns the unboxed value from getInitializationVectorCrc32C() + + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and + * if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getInitializationVectorCrc32CUnwrapped() + { + return $this->readWrapperValue("initialization_vector_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and + * if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setInitializationVectorCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->initialization_vector_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and + * if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setInitializationVectorCrc32CUnwrapped($var) + { + $this->writeWrapperValue("initialization_vector_crc32c", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptResponse.php new file mode 100644 index 000000000000..6ce9ba157ce9 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptResponse.php @@ -0,0 +1,511 @@ +google.cloud.kms.v1.RawDecryptResponse + */ +class RawDecryptResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The decrypted data. + * + * Generated from protobuf field bytes plaintext = 1; + */ + protected $plaintext = ''; + /** + * Integrity verification field. A CRC32C checksum of the returned + * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. + * An integrity check of plaintext can be performed by computing the CRC32C + * checksum of plaintext and comparing your results to this field. Discard the + * response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: receiving this response message + * indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + */ + protected $plaintext_crc32c = null; + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; + */ + protected $protection_level = 0; + /** + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the ciphertext. A false value of this + * field indicates either that + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_ciphertext_crc32c = 4; + */ + protected $verified_ciphertext_crc32c = false; + /** + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of additional_authenticated_data. A false + * value of this field indicates either that // + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 5; + */ + protected $verified_additional_authenticated_data_crc32c = false; + /** + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of initialization_vector. A false value of + * this field indicates either that + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_initialization_vector_crc32c = 6; + */ + protected $verified_initialization_vector_crc32c = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $plaintext + * The decrypted data. + * @type \Google\Protobuf\Int64Value $plaintext_crc32c + * Integrity verification field. A CRC32C checksum of the returned + * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. + * An integrity check of plaintext can be performed by computing the CRC32C + * checksum of plaintext and comparing your results to this field. Discard the + * response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: receiving this response message + * indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * @type int $protection_level + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * @type bool $verified_ciphertext_crc32c + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the ciphertext. A false value of this + * field indicates either that + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type bool $verified_additional_authenticated_data_crc32c + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of additional_authenticated_data. A false + * value of this field indicates either that // + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type bool $verified_initialization_vector_crc32c + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of initialization_vector. A false value of + * this field indicates either that + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The decrypted data. + * + * Generated from protobuf field bytes plaintext = 1; + * @return string + */ + public function getPlaintext() + { + return $this->plaintext; + } + + /** + * The decrypted data. + * + * Generated from protobuf field bytes plaintext = 1; + * @param string $var + * @return $this + */ + public function setPlaintext($var) + { + GPBUtil::checkString($var, False); + $this->plaintext = $var; + + return $this; + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. + * An integrity check of plaintext can be performed by computing the CRC32C + * checksum of plaintext and comparing your results to this field. Discard the + * response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: receiving this response message + * indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @return \Google\Protobuf\Int64Value|null + */ + public function getPlaintextCrc32C() + { + return $this->plaintext_crc32c; + } + + public function hasPlaintextCrc32C() + { + return isset($this->plaintext_crc32c); + } + + public function clearPlaintextCrc32C() + { + unset($this->plaintext_crc32c); + } + + /** + * Returns the unboxed value from getPlaintextCrc32C() + + * Integrity verification field. A CRC32C checksum of the returned + * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. + * An integrity check of plaintext can be performed by computing the CRC32C + * checksum of plaintext and comparing your results to this field. Discard the + * response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: receiving this response message + * indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @return int|string|null + */ + public function getPlaintextCrc32CUnwrapped() + { + return $this->readWrapperValue("plaintext_crc32c"); + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. + * An integrity check of plaintext can be performed by computing the CRC32C + * checksum of plaintext and comparing your results to this field. Discard the + * response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: receiving this response message + * indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setPlaintextCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->plaintext_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Integrity verification field. A CRC32C checksum of the returned + * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. + * An integrity check of plaintext can be performed by computing the CRC32C + * checksum of plaintext and comparing your results to this field. Discard the + * response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: receiving this response message + * indicates that + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + * successfully decrypt the + * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; + * @param int|string|null $var + * @return $this + */ + public function setPlaintextCrc32CUnwrapped($var) + { + $this->writeWrapperValue("plaintext_crc32c", $var); + return $this;} + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * decryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + + /** + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the ciphertext. A false value of this + * field indicates either that + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_ciphertext_crc32c = 4; + * @return bool + */ + public function getVerifiedCiphertextCrc32C() + { + return $this->verified_ciphertext_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the ciphertext. A false value of this + * field indicates either that + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_ciphertext_crc32c = 4; + * @param bool $var + * @return $this + */ + public function setVerifiedCiphertextCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_ciphertext_crc32c = $var; + + return $this; + } + + /** + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of additional_authenticated_data. A false + * value of this field indicates either that // + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 5; + * @return bool + */ + public function getVerifiedAdditionalAuthenticatedDataCrc32C() + { + return $this->verified_additional_authenticated_data_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of additional_authenticated_data. A false + * value of this field indicates either that // + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 5; + * @param bool $var + * @return $this + */ + public function setVerifiedAdditionalAuthenticatedDataCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_additional_authenticated_data_crc32c = $var; + + return $this; + } + + /** + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of initialization_vector. A false value of + * this field indicates either that + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_initialization_vector_crc32c = 6; + * @return bool + */ + public function getVerifiedInitializationVectorCrc32C() + { + return $this->verified_initialization_vector_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of initialization_vector. A false value of + * this field indicates either that + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_initialization_vector_crc32c = 6; + * @param bool $var + * @return $this + */ + public function setVerifiedInitializationVectorCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_initialization_vector_crc32c = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptRequest.php new file mode 100644 index 000000000000..1f1d581d1d0d --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptRequest.php @@ -0,0 +1,743 @@ +google.cloud.kms.v1.RawEncryptRequest + */ +class RawEncryptRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * encryption. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The data to encrypt. Must be no larger than 64KiB. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $plaintext = ''; + /** + * Optional. Optional data that, if specified, must also be provided during + * decryption through + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * This field may only be used in conjunction with an + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm] that accepts + * additional authenticated data (for example, AES-GCM). + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $additional_authenticated_data = ''; + /** + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received plaintext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(plaintext) is equal + * to plaintext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $plaintext_crc32c = null; + /** + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $additional_authenticated_data_crc32c = null; + /** + * Optional. A customer-supplied initialization vector that will be used for + * encryption. If it is not provided for AES-CBC and AES-CTR, one will be + * generated. It will be returned in + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * + * Generated from protobuf field bytes initialization_vector = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $initialization_vector = ''; + /** + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to + * initialization_vector_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $initialization_vector_crc32c = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * encryption. + * @type string $plaintext + * Required. The data to encrypt. Must be no larger than 64KiB. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * @type string $additional_authenticated_data + * Optional. Optional data that, if specified, must also be provided during + * decryption through + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * This field may only be used in conjunction with an + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm] that accepts + * additional authenticated data (for example, AES-GCM). + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * @type \Google\Protobuf\Int64Value $plaintext_crc32c + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received plaintext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(plaintext) is equal + * to plaintext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * @type \Google\Protobuf\Int64Value $additional_authenticated_data_crc32c + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * @type string $initialization_vector + * Optional. A customer-supplied initialization vector that will be used for + * encryption. If it is not provided for AES-CBC and AES-CTR, one will be + * generated. It will be returned in + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * @type \Google\Protobuf\Int64Value $initialization_vector_crc32c + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to + * initialization_vector_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * encryption. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * encryption. + * + * 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; + } + + /** + * Required. The data to encrypt. Must be no larger than 64KiB. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPlaintext() + { + return $this->plaintext; + } + + /** + * Required. The data to encrypt. Must be no larger than 64KiB. + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPlaintext($var) + { + GPBUtil::checkString($var, False); + $this->plaintext = $var; + + return $this; + } + + /** + * Optional. Optional data that, if specified, must also be provided during + * decryption through + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * This field may only be used in conjunction with an + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm] that accepts + * additional authenticated data (for example, AES-GCM). + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAdditionalAuthenticatedData() + { + return $this->additional_authenticated_data; + } + + /** + * Optional. Optional data that, if specified, must also be provided during + * decryption through + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * This field may only be used in conjunction with an + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm] that accepts + * additional authenticated data (for example, AES-GCM). + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * + * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAdditionalAuthenticatedData($var) + { + GPBUtil::checkString($var, False); + $this->additional_authenticated_data = $var; + + return $this; + } + + /** + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received plaintext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(plaintext) is equal + * to plaintext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getPlaintextCrc32C() + { + return $this->plaintext_crc32c; + } + + public function hasPlaintextCrc32C() + { + return isset($this->plaintext_crc32c); + } + + public function clearPlaintextCrc32C() + { + unset($this->plaintext_crc32c); + } + + /** + * Returns the unboxed value from getPlaintextCrc32C() + + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received plaintext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(plaintext) is equal + * to plaintext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getPlaintextCrc32CUnwrapped() + { + return $this->readWrapperValue("plaintext_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received plaintext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(plaintext) is equal + * to plaintext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setPlaintextCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->plaintext_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received plaintext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(plaintext) is equal + * to plaintext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setPlaintextCrc32CUnwrapped($var) + { + $this->writeWrapperValue("plaintext_crc32c", $var); + return $this;} + + /** + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getAdditionalAuthenticatedDataCrc32C() + { + return $this->additional_authenticated_data_crc32c; + } + + public function hasAdditionalAuthenticatedDataCrc32C() + { + return isset($this->additional_authenticated_data_crc32c); + } + + public function clearAdditionalAuthenticatedDataCrc32C() + { + unset($this->additional_authenticated_data_crc32c); + } + + /** + * Returns the unboxed value from getAdditionalAuthenticatedDataCrc32C() + + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getAdditionalAuthenticatedDataCrc32CUnwrapped() + { + return $this->readWrapperValue("additional_authenticated_data_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setAdditionalAuthenticatedDataCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->additional_authenticated_data_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setAdditionalAuthenticatedDataCrc32CUnwrapped($var) + { + $this->writeWrapperValue("additional_authenticated_data_crc32c", $var); + return $this;} + + /** + * Optional. A customer-supplied initialization vector that will be used for + * encryption. If it is not provided for AES-CBC and AES-CTR, one will be + * generated. It will be returned in + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * + * Generated from protobuf field bytes initialization_vector = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getInitializationVector() + { + return $this->initialization_vector; + } + + /** + * Optional. A customer-supplied initialization vector that will be used for + * encryption. If it is not provided for AES-CBC and AES-CTR, one will be + * generated. It will be returned in + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * + * Generated from protobuf field bytes initialization_vector = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setInitializationVector($var) + { + GPBUtil::checkString($var, False); + $this->initialization_vector = $var; + + return $this; + } + + /** + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to + * initialization_vector_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getInitializationVectorCrc32C() + { + return $this->initialization_vector_crc32c; + } + + public function hasInitializationVectorCrc32C() + { + return isset($this->initialization_vector_crc32c); + } + + public function clearInitializationVectorCrc32C() + { + unset($this->initialization_vector_crc32c); + } + + /** + * Returns the unboxed value from getInitializationVectorCrc32C() + + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to + * initialization_vector_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getInitializationVectorCrc32CUnwrapped() + { + return $this->readWrapperValue("initialization_vector_crc32c"); + } + + /** + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to + * initialization_vector_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setInitializationVectorCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->initialization_vector_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to + * initialization_vector_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setInitializationVectorCrc32CUnwrapped($var) + { + $this->writeWrapperValue("initialization_vector_crc32c", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptResponse.php new file mode 100644 index 000000000000..b779e66f66c8 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptResponse.php @@ -0,0 +1,744 @@ +google.cloud.kms.v1.RawEncryptResponse + */ +class RawEncryptResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The encrypted data. In the case of AES-GCM, the authentication tag + * is the [tag_length][google.cloud.kms.v1.RawEncryptResponse.tag_length] + * bytes at the end of this field. + * + * Generated from protobuf field bytes ciphertext = 1; + */ + protected $ciphertext = ''; + /** + * The initialization vector (IV) generated by the service during + * encryption. This value must be stored and provided in + * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector] + * at decryption time. + * + * Generated from protobuf field bytes initialization_vector = 2; + */ + protected $initialization_vector = ''; + /** + * The length of the authentication tag that is appended to + * the end of the ciphertext. + * + * Generated from protobuf field int32 tag_length = 3; + */ + protected $tag_length = 0; + /** + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. + * An integrity check of ciphertext can be performed by computing the CRC32C + * checksum of ciphertext and comparing your results to this field. Discard + * the response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: This field is defined as int64 + * for reasons of compatibility across different languages. However, it is a + * non-negative integer, which will never exceed 2^32-1, and can be safely + * downconverted to uint32 in languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; + */ + protected $ciphertext_crc32c = null; + /** + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * An integrity check of initialization_vector can be performed by computing + * the CRC32C checksum of initialization_vector and comparing your results to + * this field. Discard the response in case of non-matching checksum values, + * and perform a limited number of retries. A persistent mismatch may indicate + * an issue in your computation of the CRC32C checksum. Note: This field is + * defined as int64 for reasons of compatibility across different languages. + * However, it is a non-negative integer, which will never exceed 2^32-1, and + * can be safely downconverted to uint32 in languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 5; + */ + protected $initialization_vector_crc32c = null; + /** + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the plaintext. A false value of this + * field indicates either that + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_plaintext_crc32c = 6; + */ + protected $verified_plaintext_crc32c = false; + /** + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of additional_authenticated_data. A false + * value of this field indicates either that // + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 7; + */ + protected $verified_additional_authenticated_data_crc32c = false; + /** + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of initialization_vector. A false value of + * this field indicates either that + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_initialization_vector_crc32c = 10; + */ + protected $verified_initialization_vector_crc32c = false; + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. Check this field to verify that the intended resource was used + * for encryption. + * + * Generated from protobuf field string name = 8; + */ + protected $name = ''; + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9; + */ + protected $protection_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ciphertext + * The encrypted data. In the case of AES-GCM, the authentication tag + * is the [tag_length][google.cloud.kms.v1.RawEncryptResponse.tag_length] + * bytes at the end of this field. + * @type string $initialization_vector + * The initialization vector (IV) generated by the service during + * encryption. This value must be stored and provided in + * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector] + * at decryption time. + * @type int $tag_length + * The length of the authentication tag that is appended to + * the end of the ciphertext. + * @type \Google\Protobuf\Int64Value $ciphertext_crc32c + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. + * An integrity check of ciphertext can be performed by computing the CRC32C + * checksum of ciphertext and comparing your results to this field. Discard + * the response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: This field is defined as int64 + * for reasons of compatibility across different languages. However, it is a + * non-negative integer, which will never exceed 2^32-1, and can be safely + * downconverted to uint32 in languages that support this type. + * @type \Google\Protobuf\Int64Value $initialization_vector_crc32c + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * An integrity check of initialization_vector can be performed by computing + * the CRC32C checksum of initialization_vector and comparing your results to + * this field. Discard the response in case of non-matching checksum values, + * and perform a limited number of retries. A persistent mismatch may indicate + * an issue in your computation of the CRC32C checksum. Note: This field is + * defined as int64 for reasons of compatibility across different languages. + * However, it is a non-negative integer, which will never exceed 2^32-1, and + * can be safely downconverted to uint32 in languages that support this type. + * @type bool $verified_plaintext_crc32c + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the plaintext. A false value of this + * field indicates either that + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type bool $verified_additional_authenticated_data_crc32c + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of additional_authenticated_data. A false + * value of this field indicates either that // + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type bool $verified_initialization_vector_crc32c + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of initialization_vector. A false value of + * this field indicates either that + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * @type string $name + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. Check this field to verify that the intended resource was used + * for encryption. + * @type int $protection_level + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The encrypted data. In the case of AES-GCM, the authentication tag + * is the [tag_length][google.cloud.kms.v1.RawEncryptResponse.tag_length] + * bytes at the end of this field. + * + * Generated from protobuf field bytes ciphertext = 1; + * @return string + */ + public function getCiphertext() + { + return $this->ciphertext; + } + + /** + * The encrypted data. In the case of AES-GCM, the authentication tag + * is the [tag_length][google.cloud.kms.v1.RawEncryptResponse.tag_length] + * bytes at the end of this field. + * + * Generated from protobuf field bytes ciphertext = 1; + * @param string $var + * @return $this + */ + public function setCiphertext($var) + { + GPBUtil::checkString($var, False); + $this->ciphertext = $var; + + return $this; + } + + /** + * The initialization vector (IV) generated by the service during + * encryption. This value must be stored and provided in + * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector] + * at decryption time. + * + * Generated from protobuf field bytes initialization_vector = 2; + * @return string + */ + public function getInitializationVector() + { + return $this->initialization_vector; + } + + /** + * The initialization vector (IV) generated by the service during + * encryption. This value must be stored and provided in + * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector] + * at decryption time. + * + * Generated from protobuf field bytes initialization_vector = 2; + * @param string $var + * @return $this + */ + public function setInitializationVector($var) + { + GPBUtil::checkString($var, False); + $this->initialization_vector = $var; + + return $this; + } + + /** + * The length of the authentication tag that is appended to + * the end of the ciphertext. + * + * Generated from protobuf field int32 tag_length = 3; + * @return int + */ + public function getTagLength() + { + return $this->tag_length; + } + + /** + * The length of the authentication tag that is appended to + * the end of the ciphertext. + * + * Generated from protobuf field int32 tag_length = 3; + * @param int $var + * @return $this + */ + public function setTagLength($var) + { + GPBUtil::checkInt32($var); + $this->tag_length = $var; + + return $this; + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. + * An integrity check of ciphertext can be performed by computing the CRC32C + * checksum of ciphertext and comparing your results to this field. Discard + * the response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: This field is defined as int64 + * for reasons of compatibility across different languages. However, it is a + * non-negative integer, which will never exceed 2^32-1, and can be safely + * downconverted to uint32 in languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; + * @return \Google\Protobuf\Int64Value|null + */ + public function getCiphertextCrc32C() + { + return $this->ciphertext_crc32c; + } + + public function hasCiphertextCrc32C() + { + return isset($this->ciphertext_crc32c); + } + + public function clearCiphertextCrc32C() + { + unset($this->ciphertext_crc32c); + } + + /** + * Returns the unboxed value from getCiphertextCrc32C() + + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. + * An integrity check of ciphertext can be performed by computing the CRC32C + * checksum of ciphertext and comparing your results to this field. Discard + * the response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: This field is defined as int64 + * for reasons of compatibility across different languages. However, it is a + * non-negative integer, which will never exceed 2^32-1, and can be safely + * downconverted to uint32 in languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; + * @return int|string|null + */ + public function getCiphertextCrc32CUnwrapped() + { + return $this->readWrapperValue("ciphertext_crc32c"); + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. + * An integrity check of ciphertext can be performed by computing the CRC32C + * checksum of ciphertext and comparing your results to this field. Discard + * the response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: This field is defined as int64 + * for reasons of compatibility across different languages. However, it is a + * non-negative integer, which will never exceed 2^32-1, and can be safely + * downconverted to uint32 in languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setCiphertextCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->ciphertext_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. + * An integrity check of ciphertext can be performed by computing the CRC32C + * checksum of ciphertext and comparing your results to this field. Discard + * the response in case of non-matching checksum values, and perform a limited + * number of retries. A persistent mismatch may indicate an issue in your + * computation of the CRC32C checksum. Note: This field is defined as int64 + * for reasons of compatibility across different languages. However, it is a + * non-negative integer, which will never exceed 2^32-1, and can be safely + * downconverted to uint32 in languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; + * @param int|string|null $var + * @return $this + */ + public function setCiphertextCrc32CUnwrapped($var) + { + $this->writeWrapperValue("ciphertext_crc32c", $var); + return $this;} + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * An integrity check of initialization_vector can be performed by computing + * the CRC32C checksum of initialization_vector and comparing your results to + * this field. Discard the response in case of non-matching checksum values, + * and perform a limited number of retries. A persistent mismatch may indicate + * an issue in your computation of the CRC32C checksum. Note: This field is + * defined as int64 for reasons of compatibility across different languages. + * However, it is a non-negative integer, which will never exceed 2^32-1, and + * can be safely downconverted to uint32 in languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 5; + * @return \Google\Protobuf\Int64Value|null + */ + public function getInitializationVectorCrc32C() + { + return $this->initialization_vector_crc32c; + } + + public function hasInitializationVectorCrc32C() + { + return isset($this->initialization_vector_crc32c); + } + + public function clearInitializationVectorCrc32C() + { + unset($this->initialization_vector_crc32c); + } + + /** + * Returns the unboxed value from getInitializationVectorCrc32C() + + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * An integrity check of initialization_vector can be performed by computing + * the CRC32C checksum of initialization_vector and comparing your results to + * this field. Discard the response in case of non-matching checksum values, + * and perform a limited number of retries. A persistent mismatch may indicate + * an issue in your computation of the CRC32C checksum. Note: This field is + * defined as int64 for reasons of compatibility across different languages. + * However, it is a non-negative integer, which will never exceed 2^32-1, and + * can be safely downconverted to uint32 in languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 5; + * @return int|string|null + */ + public function getInitializationVectorCrc32CUnwrapped() + { + return $this->readWrapperValue("initialization_vector_crc32c"); + } + + /** + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * An integrity check of initialization_vector can be performed by computing + * the CRC32C checksum of initialization_vector and comparing your results to + * this field. Discard the response in case of non-matching checksum values, + * and perform a limited number of retries. A persistent mismatch may indicate + * an issue in your computation of the CRC32C checksum. Note: This field is + * defined as int64 for reasons of compatibility across different languages. + * However, it is a non-negative integer, which will never exceed 2^32-1, and + * can be safely downconverted to uint32 in languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 5; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setInitializationVectorCrc32C($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->initialization_vector_crc32c = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Integrity verification field. A CRC32C checksum of the returned + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * An integrity check of initialization_vector can be performed by computing + * the CRC32C checksum of initialization_vector and comparing your results to + * this field. Discard the response in case of non-matching checksum values, + * and perform a limited number of retries. A persistent mismatch may indicate + * an issue in your computation of the CRC32C checksum. Note: This field is + * defined as int64 for reasons of compatibility across different languages. + * However, it is a non-negative integer, which will never exceed 2^32-1, and + * can be safely downconverted to uint32 in languages that support this type. + * + * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 5; + * @param int|string|null $var + * @return $this + */ + public function setInitializationVectorCrc32CUnwrapped($var) + { + $this->writeWrapperValue("initialization_vector_crc32c", $var); + return $this;} + + /** + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the plaintext. A false value of this + * field indicates either that + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_plaintext_crc32c = 6; + * @return bool + */ + public function getVerifiedPlaintextCrc32C() + { + return $this->verified_plaintext_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of the plaintext. A false value of this + * field indicates either that + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_plaintext_crc32c = 6; + * @param bool $var + * @return $this + */ + public function setVerifiedPlaintextCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_plaintext_crc32c = $var; + + return $this; + } + + /** + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of additional_authenticated_data. A false + * value of this field indicates either that // + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 7; + * @return bool + */ + public function getVerifiedAdditionalAuthenticatedDataCrc32C() + { + return $this->verified_additional_authenticated_data_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of additional_authenticated_data. A false + * value of this field indicates either that // + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 7; + * @param bool $var + * @return $this + */ + public function setVerifiedAdditionalAuthenticatedDataCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_additional_authenticated_data_crc32c = $var; + + return $this; + } + + /** + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of initialization_vector. A false value of + * this field indicates either that + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_initialization_vector_crc32c = 10; + * @return bool + */ + public function getVerifiedInitializationVectorCrc32C() + { + return $this->verified_initialization_vector_crc32c; + } + + /** + * Integrity verification field. A flag indicating whether + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * was received by + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + * for the integrity verification of initialization_vector. A false value of + * this field indicates either that + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * was left unset or that it was not delivered to + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + * set + * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] + * but this field is still false, discard the response and perform a limited + * number of retries. + * + * Generated from protobuf field bool verified_initialization_vector_crc32c = 10; + * @param bool $var + * @return $this + */ + public function setVerifiedInitializationVectorCrc32C($var) + { + GPBUtil::checkBool($var); + $this->verified_initialization_vector_crc32c = $var; + + return $this; + } + + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. Check this field to verify that the intended resource was used + * for encryption. + * + * Generated from protobuf field string name = 8; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. Check this field to verify that the intended resource was used + * for encryption. + * + * Generated from protobuf field string name = 8; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9; + * @return int + */ + public function getProtectionLevel() + { + return $this->protection_level; + } + + /** + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + * encryption. + * + * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9; + * @param int $var + * @return $this + */ + public function setProtectionLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); + $this->protection_level = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RestoreCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RestoreCryptoKeyVersionRequest.php new file mode 100644 index 000000000000..d62fe8e8863c --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RestoreCryptoKeyVersionRequest.php @@ -0,0 +1,87 @@ +google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + */ +class RestoreCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. Please see + * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\RestoreCryptoKeyVersionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. + * + * 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 + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. + * + * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyPrimaryVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyPrimaryVersionRequest.php new file mode 100644 index 000000000000..1a9161832a5e --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyPrimaryVersionRequest.php @@ -0,0 +1,128 @@ +google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + */ +class UpdateCryptoKeyPrimaryVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The id of the child + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. + * + * Generated from protobuf field string crypto_key_version_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $crypto_key_version_id = ''; + + /** + * @param string $name Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. Please see + * {@see KeyManagementServiceClient::cryptoKeyName()} for help formatting this field. + * @param string $cryptoKeyVersionId Required. The id of the child + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. + * + * @return \Google\Cloud\Kms\V1\UpdateCryptoKeyPrimaryVersionRequest + * + * @experimental + */ + public static function build(string $name, string $cryptoKeyVersionId): self + { + return (new self()) + ->setName($name) + ->setCryptoKeyVersionId($cryptoKeyVersionId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. + * @type string $crypto_key_version_id + * Required. The id of the child + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. + * + * 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 + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. + * + * 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; + } + + /** + * Required. The id of the child + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. + * + * Generated from protobuf field string crypto_key_version_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCryptoKeyVersionId() + { + return $this->crypto_key_version_id; + } + + /** + * Required. The id of the child + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. + * + * Generated from protobuf field string crypto_key_version_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCryptoKeyVersionId($var) + { + GPBUtil::checkString($var, True); + $this->crypto_key_version_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyRequest.php new file mode 100644 index 000000000000..b11e974dbe70 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyRequest.php @@ -0,0 +1,137 @@ +google.cloud.kms.v1.UpdateCryptoKeyRequest + */ +class UpdateCryptoKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $crypto_key = null; + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Kms\V1\CryptoKey $cryptoKey Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. + * + * @return \Google\Cloud\Kms\V1\UpdateCryptoKeyRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Kms\V1\CryptoKey $cryptoKey, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCryptoKey($cryptoKey) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Kms\V1\CryptoKey $crypto_key + * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields to be updated in this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Kms\V1\CryptoKey|null + */ + public function getCryptoKey() + { + return $this->crypto_key; + } + + public function hasCryptoKey() + { + return isset($this->crypto_key); + } + + public function clearCryptoKey() + { + unset($this->crypto_key); + } + + /** + * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Kms\V1\CryptoKey $var + * @return $this + */ + public function setCryptoKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKey::class); + $this->crypto_key = $var; + + return $this; + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyVersionRequest.php new file mode 100644 index 000000000000..c91c56d8b516 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyVersionRequest.php @@ -0,0 +1,142 @@ +google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + */ +class UpdateCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * updated values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $crypto_key_version = null; + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Kms\V1\CryptoKeyVersion $cryptoKeyVersion Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * updated values. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. + * + * @return \Google\Cloud\Kms\V1\UpdateCryptoKeyVersionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Kms\V1\CryptoKeyVersion $cryptoKeyVersion, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCryptoKeyVersion($cryptoKeyVersion) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Kms\V1\CryptoKeyVersion $crypto_key_version + * Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * updated values. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields to be updated in this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * updated values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Kms\V1\CryptoKeyVersion|null + */ + public function getCryptoKeyVersion() + { + return $this->crypto_key_version; + } + + public function hasCryptoKeyVersion() + { + return isset($this->crypto_key_version); + } + + public function clearCryptoKeyVersion() + { + unset($this->crypto_key_version); + } + + /** + * Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * updated values. + * + * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Kms\V1\CryptoKeyVersion $var + * @return $this + */ + public function setCryptoKeyVersion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKeyVersion::class); + $this->crypto_key_version = $var; + + return $this; + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConfigRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConfigRequest.php new file mode 100644 index 000000000000..e33d285b04a2 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConfigRequest.php @@ -0,0 +1,137 @@ +google.cloud.kms.v1.UpdateEkmConfigRequest + */ +class UpdateEkmConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConfig ekm_config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ekm_config = null; + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Kms\V1\EkmConfig $ekmConfig Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. + * + * @return \Google\Cloud\Kms\V1\UpdateEkmConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Kms\V1\EkmConfig $ekmConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setEkmConfig($ekmConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Kms\V1\EkmConfig $ekm_config + * Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields to be updated in this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConfig ekm_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Kms\V1\EkmConfig|null + */ + public function getEkmConfig() + { + return $this->ekm_config; + } + + public function hasEkmConfig() + { + return isset($this->ekm_config); + } + + public function clearEkmConfig() + { + unset($this->ekm_config); + } + + /** + * Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConfig ekm_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Kms\V1\EkmConfig $var + * @return $this + */ + public function setEkmConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\EkmConfig::class); + $this->ekm_config = $var; + + return $this; + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConnectionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConnectionRequest.php new file mode 100644 index 000000000000..0a77d3a6ab24 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConnectionRequest.php @@ -0,0 +1,142 @@ +google.cloud.kms.v1.UpdateEkmConnectionRequest + */ +class UpdateEkmConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ekm_connection = null; + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Kms\V1\EkmConnection $ekmConnection Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated + * values. + * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. + * + * @return \Google\Cloud\Kms\V1\UpdateEkmConnectionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Kms\V1\EkmConnection $ekmConnection, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setEkmConnection($ekmConnection) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Kms\V1\EkmConnection $ekm_connection + * Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated + * values. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. List of fields to be updated in this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Kms\V1\EkmConnection|null + */ + public function getEkmConnection() + { + return $this->ekm_connection; + } + + public function hasEkmConnection() + { + return isset($this->ekm_connection); + } + + public function clearEkmConnection() + { + unset($this->ekm_connection); + } + + /** + * Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated + * values. + * + * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Kms\V1\EkmConnection $var + * @return $this + */ + public function setEkmConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\EkmConnection::class); + $this->ekm_connection = $var; + + return $this; + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. List of fields to be updated in this request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityRequest.php new file mode 100644 index 000000000000..7ad43869a480 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityRequest.php @@ -0,0 +1,87 @@ +google.cloud.kms.v1.VerifyConnectivityRequest + */ +class VerifyConnectivityRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. Please see + * {@see EkmServiceClient::ekmConnectionName()} for help formatting this field. + * + * @return \Google\Cloud\Kms\V1\VerifyConnectivityRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. + * + * 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][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. + * + * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityResponse.php new file mode 100644 index 000000000000..4221f23c7637 --- /dev/null +++ b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityResponse.php @@ -0,0 +1,34 @@ +google.cloud.kms.v1.VerifyConnectivityResponse + */ +class VerifyConnectivityResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/create_ekm_connection.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/create_ekm_connection.php new file mode 100644 index 000000000000..da0a80095906 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/create_ekm_connection.php @@ -0,0 +1,80 @@ +setParent($formattedParent) + ->setEkmConnectionId($ekmConnectionId) + ->setEkmConnection($ekmConnection); + + // Call the API and handle any network failures. + try { + /** @var EkmConnection $response */ + $response = $ekmServiceClient->createEkmConnection($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EkmServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $ekmConnectionId = '[EKM_CONNECTION_ID]'; + + create_ekm_connection_sample($formattedParent, $ekmConnectionId); +} +// [END cloudkms_v1_generated_EkmService_CreateEkmConnection_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_config.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_config.php new file mode 100644 index 000000000000..513e4675c0f5 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_config.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var EkmConfig $response */ + $response = $ekmServiceClient->getEkmConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EkmServiceClient::ekmConfigName('[PROJECT]', '[LOCATION]'); + + get_ekm_config_sample($formattedName); +} +// [END cloudkms_v1_generated_EkmService_GetEkmConfig_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_connection.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_connection.php new file mode 100644 index 000000000000..af11f93fdf09 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_connection.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var EkmConnection $response */ + $response = $ekmServiceClient->getEkmConnection($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EkmServiceClient::ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + + get_ekm_connection_sample($formattedName); +} +// [END cloudkms_v1_generated_EkmService_GetEkmConnection_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_iam_policy.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..68149cdc7afa --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $ekmServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudkms_v1_generated_EkmService_GetIamPolicy_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_location.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_location.php new file mode 100644 index 000000000000..310924b508b7 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_EkmService_GetLocation_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_ekm_connections.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_ekm_connections.php new file mode 100644 index 000000000000..d0be2f4c697e --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_ekm_connections.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $ekmServiceClient->listEkmConnections($request); + + /** @var EkmConnection $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EkmServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_ekm_connections_sample($formattedParent); +} +// [END cloudkms_v1_generated_EkmService_ListEkmConnections_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_locations.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_locations.php new file mode 100644 index 000000000000..1bb19c6e2482 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_EkmService_ListLocations_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/set_iam_policy.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..8d33c45f5688 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $ekmServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudkms_v1_generated_EkmService_SetIamPolicy_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/test_iam_permissions.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..5f04484afdcb --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $ekmServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudkms_v1_generated_EkmService_TestIamPermissions_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_config.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_config.php new file mode 100644 index 000000000000..4545f68080e6 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_config.php @@ -0,0 +1,63 @@ +setEkmConfig($ekmConfig) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var EkmConfig $response */ + $response = $ekmServiceClient->updateEkmConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_EkmService_UpdateEkmConfig_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_connection.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_connection.php new file mode 100644 index 000000000000..25e0f134db8c --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_connection.php @@ -0,0 +1,62 @@ +setEkmConnection($ekmConnection) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var EkmConnection $response */ + $response = $ekmServiceClient->updateEkmConnection($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_EkmService_UpdateEkmConnection_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/verify_connectivity.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/verify_connectivity.php new file mode 100644 index 000000000000..f3a099f99485 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/verify_connectivity.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var VerifyConnectivityResponse $response */ + $response = $ekmServiceClient->verifyConnectivity($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EkmServiceClient::ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + + verify_connectivity_sample($formattedName); +} +// [END cloudkms_v1_generated_EkmService_VerifyConnectivity_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_decrypt.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_decrypt.php new file mode 100644 index 000000000000..09b3e01d23b1 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_decrypt.php @@ -0,0 +1,88 @@ +setName($formattedName) + ->setCiphertext($ciphertext); + + // Call the API and handle any network failures. + try { + /** @var AsymmetricDecryptResponse $response */ + $response = $keyManagementServiceClient->asymmetricDecrypt($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]', + '[CRYPTO_KEY_VERSION]' + ); + $ciphertext = '...'; + + asymmetric_decrypt_sample($formattedName, $ciphertext); +} +// [END cloudkms_v1_generated_KeyManagementService_AsymmetricDecrypt_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_sign.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_sign.php new file mode 100644 index 000000000000..b8467961948b --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_sign.php @@ -0,0 +1,86 @@ +setName($formattedName) + ->setDigest($digest); + + // Call the API and handle any network failures. + try { + /** @var AsymmetricSignResponse $response */ + $response = $keyManagementServiceClient->asymmetricSign($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]', + '[CRYPTO_KEY_VERSION]' + ); + + asymmetric_sign_sample($formattedName); +} +// [END cloudkms_v1_generated_KeyManagementService_AsymmetricSign_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key.php new file mode 100644 index 000000000000..b2bc66b850b6 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key.php @@ -0,0 +1,83 @@ +setParent($formattedParent) + ->setCryptoKeyId($cryptoKeyId) + ->setCryptoKey($cryptoKey); + + // Call the API and handle any network failures. + try { + /** @var CryptoKey $response */ + $response = $keyManagementServiceClient->createCryptoKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KeyManagementServiceClient::keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $cryptoKeyId = '[CRYPTO_KEY_ID]'; + + create_crypto_key_sample($formattedParent, $cryptoKeyId); +} +// [END cloudkms_v1_generated_KeyManagementService_CreateCryptoKey_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key_version.php new file mode 100644 index 000000000000..71cc05d5681f --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key_version.php @@ -0,0 +1,85 @@ +setParent($formattedParent) + ->setCryptoKeyVersion($cryptoKeyVersion); + + // Call the API and handle any network failures. + try { + /** @var CryptoKeyVersion $response */ + $response = $keyManagementServiceClient->createCryptoKeyVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KeyManagementServiceClient::cryptoKeyName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]' + ); + + create_crypto_key_version_sample($formattedParent); +} +// [END cloudkms_v1_generated_KeyManagementService_CreateCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_import_job.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_import_job.php new file mode 100644 index 000000000000..510ff5be970a --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_import_job.php @@ -0,0 +1,106 @@ +setImportMethod($importJobImportMethod) + ->setProtectionLevel($importJobProtectionLevel); + $request = (new CreateImportJobRequest()) + ->setParent($formattedParent) + ->setImportJobId($importJobId) + ->setImportJob($importJob); + + // Call the API and handle any network failures. + try { + /** @var ImportJob $response */ + $response = $keyManagementServiceClient->createImportJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KeyManagementServiceClient::keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $importJobId = '[IMPORT_JOB_ID]'; + $importJobImportMethod = ImportMethod::IMPORT_METHOD_UNSPECIFIED; + $importJobProtectionLevel = ProtectionLevel::PROTECTION_LEVEL_UNSPECIFIED; + + create_import_job_sample( + $formattedParent, + $importJobId, + $importJobImportMethod, + $importJobProtectionLevel + ); +} +// [END cloudkms_v1_generated_KeyManagementService_CreateImportJob_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_key_ring.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_key_ring.php new file mode 100644 index 000000000000..5f8ee1d3ad45 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_key_ring.php @@ -0,0 +1,80 @@ +setParent($formattedParent) + ->setKeyRingId($keyRingId) + ->setKeyRing($keyRing); + + // Call the API and handle any network failures. + try { + /** @var KeyRing $response */ + $response = $keyManagementServiceClient->createKeyRing($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KeyManagementServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $keyRingId = '[KEY_RING_ID]'; + + create_key_ring_sample($formattedParent, $keyRingId); +} +// [END cloudkms_v1_generated_KeyManagementService_CreateKeyRing_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/decrypt.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/decrypt.php new file mode 100644 index 000000000000..b5a474d68f41 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/decrypt.php @@ -0,0 +1,85 @@ +setName($formattedName) + ->setCiphertext($ciphertext); + + // Call the API and handle any network failures. + try { + /** @var DecryptResponse $response */ + $response = $keyManagementServiceClient->decrypt($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::cryptoKeyName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]' + ); + $ciphertext = '...'; + + decrypt_sample($formattedName, $ciphertext); +} +// [END cloudkms_v1_generated_KeyManagementService_Decrypt_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/destroy_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/destroy_crypto_key_version.php new file mode 100644 index 000000000000..b0090eef2c77 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/destroy_crypto_key_version.php @@ -0,0 +1,98 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CryptoKeyVersion $response */ + $response = $keyManagementServiceClient->destroyCryptoKeyVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]', + '[CRYPTO_KEY_VERSION]' + ); + + destroy_crypto_key_version_sample($formattedName); +} +// [END cloudkms_v1_generated_KeyManagementService_DestroyCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/encrypt.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/encrypt.php new file mode 100644 index 000000000000..7f719bcf2ef5 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/encrypt.php @@ -0,0 +1,92 @@ +setName($name) + ->setPlaintext($plaintext); + + // Call the API and handle any network failures. + try { + /** @var EncryptResponse $response */ + $response = $keyManagementServiceClient->encrypt($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $plaintext = '...'; + + encrypt_sample($name, $plaintext); +} +// [END cloudkms_v1_generated_KeyManagementService_Encrypt_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/generate_random_bytes.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/generate_random_bytes.php new file mode 100644 index 000000000000..a63710011bfd --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/generate_random_bytes.php @@ -0,0 +1,58 @@ +generateRandomBytes($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_KeyManagementService_GenerateRandomBytes_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key.php new file mode 100644 index 000000000000..4919946c0081 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CryptoKey $response */ + $response = $keyManagementServiceClient->getCryptoKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::cryptoKeyName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]' + ); + + get_crypto_key_sample($formattedName); +} +// [END cloudkms_v1_generated_KeyManagementService_GetCryptoKey_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key_version.php new file mode 100644 index 000000000000..17903f74ced5 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key_version.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CryptoKeyVersion $response */ + $response = $keyManagementServiceClient->getCryptoKeyVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]', + '[CRYPTO_KEY_VERSION]' + ); + + get_crypto_key_version_sample($formattedName); +} +// [END cloudkms_v1_generated_KeyManagementService_GetCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_iam_policy.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..71a0fe28319b --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $keyManagementServiceClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudkms_v1_generated_KeyManagementService_GetIamPolicy_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_import_job.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_import_job.php new file mode 100644 index 000000000000..0d020d202343 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_import_job.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ImportJob $response */ + $response = $keyManagementServiceClient->getImportJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::importJobName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[IMPORT_JOB]' + ); + + get_import_job_sample($formattedName); +} +// [END cloudkms_v1_generated_KeyManagementService_GetImportJob_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_key_ring.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_key_ring.php new file mode 100644 index 000000000000..b21c49ace1d3 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_key_ring.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var KeyRing $response */ + $response = $keyManagementServiceClient->getKeyRing($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + + get_key_ring_sample($formattedName); +} +// [END cloudkms_v1_generated_KeyManagementService_GetKeyRing_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_location.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_location.php new file mode 100644 index 000000000000..d5aa66a0b9d9 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_KeyManagementService_GetLocation_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_public_key.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_public_key.php new file mode 100644 index 000000000000..e30e488a9e65 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_public_key.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var PublicKey $response */ + $response = $keyManagementServiceClient->getPublicKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]', + '[CRYPTO_KEY_VERSION]' + ); + + get_public_key_sample($formattedName); +} +// [END cloudkms_v1_generated_KeyManagementService_GetPublicKey_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/import_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/import_crypto_key_version.php new file mode 100644 index 000000000000..8e82a9df1cc8 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/import_crypto_key_version.php @@ -0,0 +1,103 @@ +setParent($formattedParent) + ->setAlgorithm($algorithm) + ->setImportJob($importJob); + + // Call the API and handle any network failures. + try { + /** @var CryptoKeyVersion $response */ + $response = $keyManagementServiceClient->importCryptoKeyVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KeyManagementServiceClient::cryptoKeyName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]' + ); + $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; + $importJob = '[IMPORT_JOB]'; + + import_crypto_key_version_sample($formattedParent, $algorithm, $importJob); +} +// [END cloudkms_v1_generated_KeyManagementService_ImportCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_key_versions.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_key_versions.php new file mode 100644 index 000000000000..015a526ed4d2 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_key_versions.php @@ -0,0 +1,83 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $keyManagementServiceClient->listCryptoKeyVersions($request); + + /** @var CryptoKeyVersion $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KeyManagementServiceClient::cryptoKeyName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]' + ); + + list_crypto_key_versions_sample($formattedParent); +} +// [END cloudkms_v1_generated_KeyManagementService_ListCryptoKeyVersions_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_keys.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_keys.php new file mode 100644 index 000000000000..29a2ae2517ef --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_keys.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $keyManagementServiceClient->listCryptoKeys($request); + + /** @var CryptoKey $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KeyManagementServiceClient::keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + + list_crypto_keys_sample($formattedParent); +} +// [END cloudkms_v1_generated_KeyManagementService_ListCryptoKeys_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_import_jobs.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_import_jobs.php new file mode 100644 index 000000000000..8ffb69c6a6de --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_import_jobs.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $keyManagementServiceClient->listImportJobs($request); + + /** @var ImportJob $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KeyManagementServiceClient::keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + + list_import_jobs_sample($formattedParent); +} +// [END cloudkms_v1_generated_KeyManagementService_ListImportJobs_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_key_rings.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_key_rings.php new file mode 100644 index 000000000000..1aa8f0bbc947 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_key_rings.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $keyManagementServiceClient->listKeyRings($request); + + /** @var KeyRing $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KeyManagementServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_key_rings_sample($formattedParent); +} +// [END cloudkms_v1_generated_KeyManagementService_ListKeyRings_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_locations.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_locations.php new file mode 100644 index 000000000000..fa3ffc21350e --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_KeyManagementService_ListLocations_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_sign.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_sign.php new file mode 100644 index 000000000000..41eb52ab8f14 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_sign.php @@ -0,0 +1,85 @@ +setName($formattedName) + ->setData($data); + + // Call the API and handle any network failures. + try { + /** @var MacSignResponse $response */ + $response = $keyManagementServiceClient->macSign($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]', + '[CRYPTO_KEY_VERSION]' + ); + $data = '...'; + + mac_sign_sample($formattedName, $data); +} +// [END cloudkms_v1_generated_KeyManagementService_MacSign_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_verify.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_verify.php new file mode 100644 index 000000000000..31bbf3714133 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_verify.php @@ -0,0 +1,90 @@ +setName($formattedName) + ->setData($data) + ->setMac($mac); + + // Call the API and handle any network failures. + try { + /** @var MacVerifyResponse $response */ + $response = $keyManagementServiceClient->macVerify($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]', + '[CRYPTO_KEY_VERSION]' + ); + $data = '...'; + $mac = '...'; + + mac_verify_sample($formattedName, $data, $mac); +} +// [END cloudkms_v1_generated_KeyManagementService_MacVerify_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_decrypt.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_decrypt.php new file mode 100644 index 000000000000..45d7fd391947 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_decrypt.php @@ -0,0 +1,84 @@ +setName($name) + ->setCiphertext($ciphertext) + ->setInitializationVector($initializationVector); + + // Call the API and handle any network failures. + try { + /** @var RawDecryptResponse $response */ + $response = $keyManagementServiceClient->rawDecrypt($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $ciphertext = '...'; + $initializationVector = '...'; + + raw_decrypt_sample($name, $ciphertext, $initializationVector); +} +// [END cloudkms_v1_generated_KeyManagementService_RawDecrypt_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_encrypt.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_encrypt.php new file mode 100644 index 000000000000..6087bc112e2c --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_encrypt.php @@ -0,0 +1,88 @@ +setName($name) + ->setPlaintext($plaintext); + + // Call the API and handle any network failures. + try { + /** @var RawEncryptResponse $response */ + $response = $keyManagementServiceClient->rawEncrypt($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $plaintext = '...'; + + raw_encrypt_sample($name, $plaintext); +} +// [END cloudkms_v1_generated_KeyManagementService_RawEncrypt_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/restore_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/restore_crypto_key_version.php new file mode 100644 index 000000000000..5d17fc937aaf --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/restore_crypto_key_version.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CryptoKeyVersion $response */ + $response = $keyManagementServiceClient->restoreCryptoKeyVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]', + '[CRYPTO_KEY_VERSION]' + ); + + restore_crypto_key_version_sample($formattedName); +} +// [END cloudkms_v1_generated_KeyManagementService_RestoreCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/set_iam_policy.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..e3db153a0131 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $keyManagementServiceClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudkms_v1_generated_KeyManagementService_SetIamPolicy_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/test_iam_permissions.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..f7d0482b677c --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $keyManagementServiceClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudkms_v1_generated_KeyManagementService_TestIamPermissions_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key.php new file mode 100644 index 000000000000..083529fff6b1 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key.php @@ -0,0 +1,62 @@ +setCryptoKey($cryptoKey) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var CryptoKey $response */ + $response = $keyManagementServiceClient->updateCryptoKey($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKey_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_primary_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_primary_version.php new file mode 100644 index 000000000000..6bf7dc69fbd7 --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_primary_version.php @@ -0,0 +1,88 @@ +setName($formattedName) + ->setCryptoKeyVersionId($cryptoKeyVersionId); + + // Call the API and handle any network failures. + try { + /** @var CryptoKey $response */ + $response = $keyManagementServiceClient->updateCryptoKeyPrimaryVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KeyManagementServiceClient::cryptoKeyName( + '[PROJECT]', + '[LOCATION]', + '[KEY_RING]', + '[CRYPTO_KEY]' + ); + $cryptoKeyVersionId = '[CRYPTO_KEY_VERSION_ID]'; + + update_crypto_key_primary_version_sample($formattedName, $cryptoKeyVersionId); +} +// [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_version.php new file mode 100644 index 000000000000..156a84fa5eae --- /dev/null +++ b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_version.php @@ -0,0 +1,73 @@ +setCryptoKeyVersion($cryptoKeyVersion) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var CryptoKeyVersion $response */ + $response = $keyManagementServiceClient->updateCryptoKeyVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/src/V1/Client/EkmServiceClient.php b/owl-bot-staging/Kms/v1/src/V1/Client/EkmServiceClient.php new file mode 100644 index 000000000000..8375c57c58af --- /dev/null +++ b/owl-bot-staging/Kms/v1/src/V1/Client/EkmServiceClient.php @@ -0,0 +1,635 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/ekm_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/ekm_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/ekm_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/ekm_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a ekm_config + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted ekm_config resource. + */ + public static function ekmConfigName(string $project, string $location): string + { + return self::getPathTemplate('ekmConfig')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * ekm_connection resource. + * + * @param string $project + * @param string $location + * @param string $ekmConnection + * + * @return string The formatted ekm_connection resource. + */ + public static function ekmConnectionName(string $project, string $location, string $ekmConnection): string + { + return self::getPathTemplate('ekmConnection')->render([ + 'project' => $project, + 'location' => $location, + 'ekm_connection' => $ekmConnection, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName(string $project, string $location, string $namespace, string $service): string + { + return self::getPathTemplate('service')->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - ekmConfig: projects/{project}/locations/{location}/ekmConfig + * - ekmConnection: projects/{project}/locations/{location}/ekmConnections/{ekm_connection} + * - location: projects/{project}/locations/{location} + * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * 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 'cloudkms.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given + * Project and Location. + * + * The async variant is {@see EkmServiceClient::createEkmConnectionAsync()} . + * + * @example samples/V1/EkmServiceClient/create_ekm_connection.php + * + * @param CreateEkmConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 EkmConnection + * + * @throws ApiException Thrown if the API call fails. + */ + public function createEkmConnection(CreateEkmConnectionRequest $request, array $callOptions = []): EkmConnection + { + return $this->startApiCall('CreateEkmConnection', $request, $callOptions)->wait(); + } + + /** + * Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + * for a given project and location. + * + * The async variant is {@see EkmServiceClient::getEkmConfigAsync()} . + * + * @example samples/V1/EkmServiceClient/get_ekm_config.php + * + * @param GetEkmConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 EkmConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEkmConfig(GetEkmConfigRequest $request, array $callOptions = []): EkmConfig + { + return $this->startApiCall('GetEkmConfig', $request, $callOptions)->wait(); + } + + /** + * Returns metadata for a given + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * + * The async variant is {@see EkmServiceClient::getEkmConnectionAsync()} . + * + * @example samples/V1/EkmServiceClient/get_ekm_connection.php + * + * @param GetEkmConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 EkmConnection + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEkmConnection(GetEkmConnectionRequest $request, array $callOptions = []): EkmConnection + { + return $this->startApiCall('GetEkmConnection', $request, $callOptions)->wait(); + } + + /** + * Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. + * + * The async variant is {@see EkmServiceClient::listEkmConnectionsAsync()} . + * + * @example samples/V1/EkmServiceClient/list_ekm_connections.php + * + * @param ListEkmConnectionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEkmConnections(ListEkmConnectionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListEkmConnections', $request, $callOptions); + } + + /** + * Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + * for a given project and location. + * + * The async variant is {@see EkmServiceClient::updateEkmConfigAsync()} . + * + * @example samples/V1/EkmServiceClient/update_ekm_config.php + * + * @param UpdateEkmConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 EkmConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateEkmConfig(UpdateEkmConfigRequest $request, array $callOptions = []): EkmConfig + { + return $this->startApiCall('UpdateEkmConfig', $request, $callOptions)->wait(); + } + + /** + * Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata. + * + * The async variant is {@see EkmServiceClient::updateEkmConnectionAsync()} . + * + * @example samples/V1/EkmServiceClient/update_ekm_connection.php + * + * @param UpdateEkmConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 EkmConnection + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateEkmConnection(UpdateEkmConnectionRequest $request, array $callOptions = []): EkmConnection + { + return $this->startApiCall('UpdateEkmConnection', $request, $callOptions)->wait(); + } + + /** + * Verifies that Cloud KMS can successfully connect to the external key + * manager specified by an [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * If there is an error connecting to the EKM, this method returns a + * FAILED_PRECONDITION status containing structured information as described + * at https://cloud.google.com/kms/docs/reference/ekm_errors. + * + * The async variant is {@see EkmServiceClient::verifyConnectivityAsync()} . + * + * @example samples/V1/EkmServiceClient/verify_connectivity.php + * + * @param VerifyConnectivityRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 VerifyConnectivityResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function verifyConnectivity(VerifyConnectivityRequest $request, array $callOptions = []): VerifyConnectivityResponse + { + return $this->startApiCall('VerifyConnectivity', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see EkmServiceClient::getLocationAsync()} . + * + * @example samples/V1/EkmServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see EkmServiceClient::listLocationsAsync()} . + * + * @example samples/V1/EkmServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see EkmServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/EkmServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see EkmServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/EkmServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is {@see EkmServiceClient::testIamPermissionsAsync()} . + * + * @example samples/V1/EkmServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Kms/v1/src/V1/Client/KeyManagementServiceClient.php b/owl-bot-staging/Kms/v1/src/V1/Client/KeyManagementServiceClient.php new file mode 100644 index 000000000000..bd0830b6946c --- /dev/null +++ b/owl-bot-staging/Kms/v1/src/V1/Client/KeyManagementServiceClient.php @@ -0,0 +1,1374 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/key_management_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/key_management_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/key_management_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/key_management_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * crypto_key_version resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * @param string $cryptoKeyVersion + * + * @return string The formatted crypto_key_version resource. + */ + public static function cryptoKeyVersionName(string $project, string $location, string $keyRing, string $cryptoKey, string $cryptoKeyVersion): string + { + return self::getPathTemplate('cryptoKeyVersion')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + 'crypto_key_version' => $cryptoKeyVersion, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a import_job + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $importJob + * + * @return string The formatted import_job resource. + */ + public static function importJobName(string $project, string $location, string $keyRing, string $importJob): string + { + return self::getPathTemplate('importJob')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'import_job' => $importJob, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a key_ring + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * + * @return string The formatted key_ring resource. + */ + public static function keyRingName(string $project, string $location, string $keyRing): string + { + return self::getPathTemplate('keyRing')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} + * - importJob: projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job} + * - keyRing: projects/{project}/locations/{location}/keyRings/{key_ring} + * - location: projects/{project}/locations/{location} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * 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 'cloudkms.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Decrypts data that was encrypted with a public key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] + * corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + * ASYMMETRIC_DECRYPT. + * + * The async variant is {@see KeyManagementServiceClient::asymmetricDecryptAsync()} + * . + * + * @example samples/V1/KeyManagementServiceClient/asymmetric_decrypt.php + * + * @param AsymmetricDecryptRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 AsymmetricDecryptResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function asymmetricDecrypt(AsymmetricDecryptRequest $request, array $callOptions = []): AsymmetricDecryptResponse + { + return $this->startApiCall('AsymmetricDecrypt', $request, $callOptions)->wait(); + } + + /** + * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + * ASYMMETRIC_SIGN, producing a signature that can be verified with the public + * key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + * + * The async variant is {@see KeyManagementServiceClient::asymmetricSignAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/asymmetric_sign.php + * + * @param AsymmetricSignRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 AsymmetricSignResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function asymmetricSign(AsymmetricSignRequest $request, array $callOptions = []): AsymmetricSignResponse + { + return $this->startApiCall('AsymmetricSign', $request, $callOptions)->wait(); + } + + /** + * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a + * [KeyRing][google.cloud.kms.v1.KeyRing]. + * + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and + * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] + * are required. + * + * The async variant is {@see KeyManagementServiceClient::createCryptoKeyAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/create_crypto_key.php + * + * @param CreateCryptoKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CryptoKey + * + * @throws ApiException Thrown if the API call fails. + */ + public function createCryptoKey(CreateCryptoKeyRequest $request, array $callOptions = []): CryptoKey + { + return $this->startApiCall('CreateCryptoKey', $request, $callOptions)->wait(); + } + + /** + * Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a + * [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * The server will assign the next sequential id. If unset, + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. + * + * The async variant is + * {@see KeyManagementServiceClient::createCryptoKeyVersionAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/create_crypto_key_version.php + * + * @param CreateCryptoKeyVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CryptoKeyVersion + * + * @throws ApiException Thrown if the API call fails. + */ + public function createCryptoKeyVersion(CreateCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion + { + return $this->startApiCall('CreateCryptoKeyVersion', $request, $callOptions)->wait(); + } + + /** + * Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a + * [KeyRing][google.cloud.kms.v1.KeyRing]. + * + * [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is + * required. + * + * The async variant is {@see KeyManagementServiceClient::createImportJobAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/create_import_job.php + * + * @param CreateImportJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 ImportJob + * + * @throws ApiException Thrown if the API call fails. + */ + public function createImportJob(CreateImportJobRequest $request, array $callOptions = []): ImportJob + { + return $this->startApiCall('CreateImportJob', $request, $callOptions)->wait(); + } + + /** + * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and + * Location. + * + * The async variant is {@see KeyManagementServiceClient::createKeyRingAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/create_key_ring.php + * + * @param CreateKeyRingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 KeyRing + * + * @throws ApiException Thrown if the API call fails. + */ + public function createKeyRing(CreateKeyRingRequest $request, array $callOptions = []): KeyRing + { + return $this->startApiCall('CreateKeyRing', $request, $callOptions)->wait(); + } + + /** + * Decrypts data that was protected by + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * + * The async variant is {@see KeyManagementServiceClient::decryptAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/decrypt.php + * + * @param DecryptRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 DecryptResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function decrypt(DecryptRequest $request, array $callOptions = []): DecryptResponse + { + return $this->startApiCall('Decrypt', $request, $callOptions)->wait(); + } + + /** + * Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for + * destruction. + * + * Upon calling this method, + * [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will + * be set to + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will + * be set to the time + * [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] + * in the future. At that time, the + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically + * change to + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], + * and the key material will be irrevocably destroyed. + * + * Before the + * [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is + * reached, + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + * may be called to reverse the process. + * + * The async variant is + * {@see KeyManagementServiceClient::destroyCryptoKeyVersionAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/destroy_crypto_key_version.php + * + * @param DestroyCryptoKeyVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CryptoKeyVersion + * + * @throws ApiException Thrown if the API call fails. + */ + public function destroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion + { + return $this->startApiCall('DestroyCryptoKeyVersion', $request, $callOptions)->wait(); + } + + /** + * Encrypts data, so that it can only be recovered by a call to + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * + * The async variant is {@see KeyManagementServiceClient::encryptAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/encrypt.php + * + * @param EncryptRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 EncryptResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function encrypt(EncryptRequest $request, array $callOptions = []): EncryptResponse + { + return $this->startApiCall('Encrypt', $request, $callOptions)->wait(); + } + + /** + * Generate random bytes using the Cloud KMS randomness source in the provided + * location. + * + * The async variant is + * {@see KeyManagementServiceClient::generateRandomBytesAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/generate_random_bytes.php + * + * @param GenerateRandomBytesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 GenerateRandomBytesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateRandomBytes(GenerateRandomBytesRequest $request, array $callOptions = []): GenerateRandomBytesResponse + { + return $this->startApiCall('GenerateRandomBytes', $request, $callOptions)->wait(); + } + + /** + * Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as + * well as its [primary][google.cloud.kms.v1.CryptoKey.primary] + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * The async variant is {@see KeyManagementServiceClient::getCryptoKeyAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/get_crypto_key.php + * + * @param GetCryptoKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CryptoKey + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCryptoKey(GetCryptoKeyRequest $request, array $callOptions = []): CryptoKey + { + return $this->startApiCall('GetCryptoKey', $request, $callOptions)->wait(); + } + + /** + * Returns metadata for a given + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * The async variant is + * {@see KeyManagementServiceClient::getCryptoKeyVersionAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/get_crypto_key_version.php + * + * @param GetCryptoKeyVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CryptoKeyVersion + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCryptoKeyVersion(GetCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion + { + return $this->startApiCall('GetCryptoKeyVersion', $request, $callOptions)->wait(); + } + + /** + * Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. + * + * The async variant is {@see KeyManagementServiceClient::getImportJobAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/get_import_job.php + * + * @param GetImportJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 ImportJob + * + * @throws ApiException Thrown if the API call fails. + */ + public function getImportJob(GetImportJobRequest $request, array $callOptions = []): ImportJob + { + return $this->startApiCall('GetImportJob', $request, $callOptions)->wait(); + } + + /** + * Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. + * + * The async variant is {@see KeyManagementServiceClient::getKeyRingAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/get_key_ring.php + * + * @param GetKeyRingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 KeyRing + * + * @throws ApiException Thrown if the API call fails. + */ + public function getKeyRing(GetKeyRingRequest $request, array $callOptions = []): KeyRing + { + return $this->startApiCall('GetKeyRing', $request, $callOptions)->wait(); + } + + /** + * Returns the public key for the given + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] + * or + * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + * + * The async variant is {@see KeyManagementServiceClient::getPublicKeyAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/get_public_key.php + * + * @param GetPublicKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PublicKey + * + * @throws ApiException Thrown if the API call fails. + */ + public function getPublicKey(GetPublicKeyRequest $request, array $callOptions = []): PublicKey + { + return $this->startApiCall('GetPublicKey', $request, $callOptions)->wait(); + } + + /** + * Import wrapped key material into a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If + * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] is additionally + * specified in the request, key material will be reimported into that + * version. Otherwise, a new version will be created, and will be assigned the + * next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * The async variant is + * {@see KeyManagementServiceClient::importCryptoKeyVersionAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/import_crypto_key_version.php + * + * @param ImportCryptoKeyVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CryptoKeyVersion + * + * @throws ApiException Thrown if the API call fails. + */ + public function importCryptoKeyVersion(ImportCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion + { + return $this->startApiCall('ImportCryptoKeyVersion', $request, $callOptions)->wait(); + } + + /** + * Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * + * The async variant is + * {@see KeyManagementServiceClient::listCryptoKeyVersionsAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/list_crypto_key_versions.php + * + * @param ListCryptoKeyVersionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listCryptoKeyVersions(ListCryptoKeyVersionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListCryptoKeyVersions', $request, $callOptions); + } + + /** + * Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * + * The async variant is {@see KeyManagementServiceClient::listCryptoKeysAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/list_crypto_keys.php + * + * @param ListCryptoKeysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listCryptoKeys(ListCryptoKeysRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListCryptoKeys', $request, $callOptions); + } + + /** + * Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. + * + * The async variant is {@see KeyManagementServiceClient::listImportJobsAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/list_import_jobs.php + * + * @param ListImportJobsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listImportJobs(ListImportJobsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListImportJobs', $request, $callOptions); + } + + /** + * Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + * + * The async variant is {@see KeyManagementServiceClient::listKeyRingsAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/list_key_rings.php + * + * @param ListKeyRingsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listKeyRings(ListKeyRingsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListKeyRings', $request, $callOptions); + } + + /** + * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, + * producing a tag that can be verified by another source with the same key. + * + * The async variant is {@see KeyManagementServiceClient::macSignAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/mac_sign.php + * + * @param MacSignRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 MacSignResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function macSign(MacSignRequest $request, array $callOptions = []): MacSignResponse + { + return $this->startApiCall('MacSign', $request, $callOptions)->wait(); + } + + /** + * Verifies MAC tag using a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns + * a response that indicates whether or not the verification was successful. + * + * The async variant is {@see KeyManagementServiceClient::macVerifyAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/mac_verify.php + * + * @param MacVerifyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 MacVerifyResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function macVerify(MacVerifyRequest $request, array $callOptions = []): MacVerifyResponse + { + return $this->startApiCall('MacVerify', $request, $callOptions)->wait(); + } + + /** + * Decrypts data that was originally encrypted using a raw cryptographic + * mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + * must be + * [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. + * + * The async variant is {@see KeyManagementServiceClient::rawDecryptAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/raw_decrypt.php + * + * @param RawDecryptRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 RawDecryptResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function rawDecrypt(RawDecryptRequest $request, array $callOptions = []): RawDecryptResponse + { + return $this->startApiCall('RawDecrypt', $request, $callOptions)->wait(); + } + + /** + * Encrypts data using portable cryptographic primitives. Most users should + * choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than + * their raw counterparts. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. + * + * The async variant is {@see KeyManagementServiceClient::rawEncryptAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/raw_encrypt.php + * + * @param RawEncryptRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 RawEncryptResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function rawEncrypt(RawEncryptRequest $request, array $callOptions = []): RawEncryptResponse + { + return $this->startApiCall('RawEncrypt', $request, $callOptions)->wait(); + } + + /** + * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * state. + * + * Upon restoration of the CryptoKeyVersion, + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will + * be cleared. + * + * The async variant is + * {@see KeyManagementServiceClient::restoreCryptoKeyVersionAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/restore_crypto_key_version.php + * + * @param RestoreCryptoKeyVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CryptoKeyVersion + * + * @throws ApiException Thrown if the API call fails. + */ + public function restoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion + { + return $this->startApiCall('RestoreCryptoKeyVersion', $request, $callOptions)->wait(); + } + + /** + * Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * The async variant is {@see KeyManagementServiceClient::updateCryptoKeyAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/update_crypto_key.php + * + * @param UpdateCryptoKeyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CryptoKey + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCryptoKey(UpdateCryptoKeyRequest $request, array $callOptions = []): CryptoKey + { + return $this->startApiCall('UpdateCryptoKey', $request, $callOptions)->wait(); + } + + /** + * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that + * will be used in + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * + * Returns an error if called on a key whose purpose is not + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * + * The async variant is + * {@see KeyManagementServiceClient::updateCryptoKeyPrimaryVersionAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/update_crypto_key_primary_version.php + * + * @param UpdateCryptoKeyPrimaryVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CryptoKey + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest $request, array $callOptions = []): CryptoKey + { + return $this->startApiCall('UpdateCryptoKeyPrimaryVersion', $request, $callOptions)->wait(); + } + + /** + * Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s + * metadata. + * + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] + * and + * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] + * using this method. See + * [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] + * and + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + * to move between other states. + * + * The async variant is + * {@see KeyManagementServiceClient::updateCryptoKeyVersionAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/update_crypto_key_version.php + * + * @param UpdateCryptoKeyVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 CryptoKeyVersion + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCryptoKeyVersion(UpdateCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion + { + return $this->startApiCall('UpdateCryptoKeyVersion', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see KeyManagementServiceClient::getLocationAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see KeyManagementServiceClient::listLocationsAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see KeyManagementServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see KeyManagementServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is + * {@see KeyManagementServiceClient::testIamPermissionsAsync()} . + * + * @example samples/V1/KeyManagementServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * 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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Kms/v1/src/V1/EkmServiceClient.php b/owl-bot-staging/Kms/v1/src/V1/EkmServiceClient.php new file mode 100644 index 000000000000..c5197b35e4f8 --- /dev/null +++ b/owl-bot-staging/Kms/v1/src/V1/EkmServiceClient.php @@ -0,0 +1,34 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $ekmConnectionId = 'ekm_connection_id'; + * $ekmConnection = new EkmConnection(); + * $response = $ekmServiceClient->createEkmConnection($formattedParent, $ekmConnectionId, $ekmConnection); + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Kms\V1\Client\EkmServiceClient}. + */ +class EkmServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.kms.v1.EkmService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'cloudkms.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudkms.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloudkms', + ]; + + private static $ekmConfigNameTemplate; + + private static $ekmConnectionNameTemplate; + + private static $locationNameTemplate; + + private static $serviceNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/ekm_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/ekm_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/ekm_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/ekm_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getEkmConfigNameTemplate() + { + if (self::$ekmConfigNameTemplate == null) { + self::$ekmConfigNameTemplate = new PathTemplate('projects/{project}/locations/{location}/ekmConfig'); + } + + return self::$ekmConfigNameTemplate; + } + + private static function getEkmConnectionNameTemplate() + { + if (self::$ekmConnectionNameTemplate == null) { + self::$ekmConnectionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/ekmConnections/{ekm_connection}'); + } + + return self::$ekmConnectionNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getServiceNameTemplate() + { + if (self::$serviceNameTemplate == null) { + self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); + } + + return self::$serviceNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'ekmConfig' => self::getEkmConfigNameTemplate(), + 'ekmConnection' => self::getEkmConnectionNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'service' => self::getServiceNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a ekm_config + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted ekm_config resource. + */ + public static function ekmConfigName($project, $location) + { + return self::getEkmConfigNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * ekm_connection resource. + * + * @param string $project + * @param string $location + * @param string $ekmConnection + * + * @return string The formatted ekm_connection resource. + */ + public static function ekmConnectionName($project, $location, $ekmConnection) + { + return self::getEkmConnectionNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'ekm_connection' => $ekmConnection, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $namespace + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName($project, $location, $namespace, $service) + { + return self::getServiceNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'namespace' => $namespace, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - ekmConfig: projects/{project}/locations/{location}/ekmConfig + * - ekmConnection: projects/{project}/locations/{location}/ekmConnections/{ekm_connection} + * - location: projects/{project}/locations/{location} + * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * 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 'cloudkms.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given + * Project and Location. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * $formattedParent = $ekmServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $ekmConnectionId = 'ekm_connection_id'; + * $ekmConnection = new EkmConnection(); + * $response = $ekmServiceClient->createEkmConnection($formattedParent, $ekmConnectionId, $ekmConnection); + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the location associated with the + * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format + * `projects/*/locations/*`. + * @param string $ekmConnectionId Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}`. + * @param EkmConnection $ekmConnection Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with + * initial field values. + * @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\Kms\V1\EkmConnection + * + * @throws ApiException if the remote call fails + */ + public function createEkmConnection($parent, $ekmConnectionId, $ekmConnection, array $optionalArgs = []) + { + $request = new CreateEkmConnectionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setEkmConnectionId($ekmConnectionId); + $request->setEkmConnection($ekmConnection); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateEkmConnection', EkmConnection::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + * for a given project and location. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * $formattedName = $ekmServiceClient->ekmConfigName('[PROJECT]', '[LOCATION]'); + * $response = $ekmServiceClient->getEkmConfig($formattedName); + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the + * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. + * @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\Kms\V1\EkmConfig + * + * @throws ApiException if the remote call fails + */ + public function getEkmConfig($name, array $optionalArgs = []) + { + $request = new GetEkmConfigRequest(); + $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('GetEkmConfig', EkmConfig::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns metadata for a given + * [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * $formattedName = $ekmServiceClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + * $response = $ekmServiceClient->getEkmConnection($formattedName); + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. + * @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\Kms\V1\EkmConnection + * + * @throws ApiException if the remote call fails + */ + public function getEkmConnection($name, array $optionalArgs = []) + { + $request = new GetEkmConnectionRequest(); + $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('GetEkmConnection', EkmConnection::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * $formattedParent = $ekmServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $ekmServiceClient->listEkmConnections($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $ekmServiceClient->listEkmConnections($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the location associated with the + * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format + * `projects/*/locations/*`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type string $orderBy + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listEkmConnections($parent, array $optionalArgs = []) + { + $request = new ListEkmConnectionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListEkmConnections', $optionalArgs, ListEkmConnectionsResponse::class, $request); + } + + /** + * Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + * for a given project and location. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * $ekmConfig = new EkmConfig(); + * $updateMask = new FieldMask(); + * $response = $ekmServiceClient->updateEkmConfig($ekmConfig, $updateMask); + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param EkmConfig $ekmConfig Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. + * @param FieldMask $updateMask Required. List of fields to be updated in this request. + * @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\Kms\V1\EkmConfig + * + * @throws ApiException if the remote call fails + */ + public function updateEkmConfig($ekmConfig, $updateMask, array $optionalArgs = []) + { + $request = new UpdateEkmConfigRequest(); + $requestParamHeaders = []; + $request->setEkmConfig($ekmConfig); + $request->setUpdateMask($updateMask); + $requestParamHeaders['ekm_config.name'] = $ekmConfig->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateEkmConfig', EkmConfig::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * $ekmConnection = new EkmConnection(); + * $updateMask = new FieldMask(); + * $response = $ekmServiceClient->updateEkmConnection($ekmConnection, $updateMask); + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param EkmConnection $ekmConnection Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated + * values. + * @param FieldMask $updateMask Required. List of fields to be updated in this request. + * @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\Kms\V1\EkmConnection + * + * @throws ApiException if the remote call fails + */ + public function updateEkmConnection($ekmConnection, $updateMask, array $optionalArgs = []) + { + $request = new UpdateEkmConnectionRequest(); + $requestParamHeaders = []; + $request->setEkmConnection($ekmConnection); + $request->setUpdateMask($updateMask); + $requestParamHeaders['ekm_connection.name'] = $ekmConnection->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateEkmConnection', EkmConnection::class, $optionalArgs, $request)->wait(); + } + + /** + * Verifies that Cloud KMS can successfully connect to the external key + * manager specified by an [EkmConnection][google.cloud.kms.v1.EkmConnection]. + * If there is an error connecting to the EKM, this method returns a + * FAILED_PRECONDITION status containing structured information as described + * at https://cloud.google.com/kms/docs/reference/ekm_errors. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * $formattedName = $ekmServiceClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + * $response = $ekmServiceClient->verifyConnectivity($formattedName); + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the + * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. + * @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\Kms\V1\VerifyConnectivityResponse + * + * @throws ApiException if the remote call fails + */ + public function verifyConnectivity($name, array $optionalArgs = []) + { + $request = new VerifyConnectivityRequest(); + $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('VerifyConnectivity', VerifyConnectivityResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * $response = $ekmServiceClient->getLocation(); + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $ekmServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $ekmServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * $resource = 'resource'; + * $response = $ekmServiceClient->getIamPolicy($resource); + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $ekmServiceClient->setIamPolicy($resource, $policy); + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * Sample code: + * ``` + * $ekmServiceClient = new EkmServiceClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $ekmServiceClient->testIamPermissions($resource, $permissions); + * } finally { + * $ekmServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } +} diff --git a/owl-bot-staging/Kms/v1/src/V1/Gapic/KeyManagementServiceGapicClient.php b/owl-bot-staging/Kms/v1/src/V1/Gapic/KeyManagementServiceGapicClient.php new file mode 100644 index 000000000000..5e00193b416b --- /dev/null +++ b/owl-bot-staging/Kms/v1/src/V1/Gapic/KeyManagementServiceGapicClient.php @@ -0,0 +1,2841 @@ +cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + * $ciphertext = '...'; + * $response = $keyManagementServiceClient->asymmetricDecrypt($formattedName, $ciphertext); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Kms\V1\Client\KeyManagementServiceClient}. + */ +class KeyManagementServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.kms.v1.KeyManagementService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'cloudkms.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudkms.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloudkms', + ]; + + private static $cryptoKeyNameTemplate; + + private static $cryptoKeyVersionNameTemplate; + + private static $importJobNameTemplate; + + private static $keyRingNameTemplate; + + private static $locationNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/key_management_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/key_management_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/key_management_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/key_management_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getCryptoKeyNameTemplate() + { + if (self::$cryptoKeyNameTemplate == null) { + self::$cryptoKeyNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}'); + } + + return self::$cryptoKeyNameTemplate; + } + + private static function getCryptoKeyVersionNameTemplate() + { + if (self::$cryptoKeyVersionNameTemplate == null) { + self::$cryptoKeyVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}'); + } + + return self::$cryptoKeyVersionNameTemplate; + } + + private static function getImportJobNameTemplate() + { + if (self::$importJobNameTemplate == null) { + self::$importJobNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}'); + } + + return self::$importJobNameTemplate; + } + + private static function getKeyRingNameTemplate() + { + if (self::$keyRingNameTemplate == null) { + self::$keyRingNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}'); + } + + return self::$keyRingNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'cryptoKey' => self::getCryptoKeyNameTemplate(), + 'cryptoKeyVersion' => self::getCryptoKeyVersionNameTemplate(), + 'importJob' => self::getImportJobNameTemplate(), + 'keyRing' => self::getKeyRingNameTemplate(), + 'location' => self::getLocationNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName($project, $location, $keyRing, $cryptoKey) + { + return self::getCryptoKeyNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * crypto_key_version resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * @param string $cryptoKeyVersion + * + * @return string The formatted crypto_key_version resource. + */ + public static function cryptoKeyVersionName($project, $location, $keyRing, $cryptoKey, $cryptoKeyVersion) + { + return self::getCryptoKeyVersionNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + 'crypto_key_version' => $cryptoKeyVersion, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a import_job + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $importJob + * + * @return string The formatted import_job resource. + */ + public static function importJobName($project, $location, $keyRing, $importJob) + { + return self::getImportJobNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'import_job' => $importJob, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a key_ring + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * + * @return string The formatted key_ring resource. + */ + public static function keyRingName($project, $location, $keyRing) + { + return self::getKeyRingNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} + * - importJob: projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job} + * - keyRing: projects/{project}/locations/{location}/keyRings/{key_ring} + * - location: projects/{project}/locations/{location} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * 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 'cloudkms.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Decrypts data that was encrypted with a public key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] + * corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + * ASYMMETRIC_DECRYPT. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + * $ciphertext = '...'; + * $response = $keyManagementServiceClient->asymmetricDecrypt($formattedName, $ciphertext); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. + * @param string $ciphertext Required. The data encrypted with the named + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using + * OAEP. + * @param array $optionalArgs { + * Optional. + * + * @type Int64Value $ciphertextCrc32c + * Optional. An optional CRC32C checksum of the + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) + * is equal to + * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\AsymmetricDecryptResponse + * + * @throws ApiException if the remote call fails + */ + public function asymmetricDecrypt($name, $ciphertext, array $optionalArgs = []) + { + $request = new AsymmetricDecryptRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setCiphertext($ciphertext); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['ciphertextCrc32c'])) { + $request->setCiphertextCrc32c($optionalArgs['ciphertextCrc32c']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('AsymmetricDecrypt', AsymmetricDecryptResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + * ASYMMETRIC_SIGN, producing a signature that can be verified with the public + * key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + * $digest = new Digest(); + * $response = $keyManagementServiceClient->asymmetricSign($formattedName, $digest); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. + * @param Digest $digest Optional. The digest of the data to sign. The digest must be produced with + * the same digest algorithm as specified by the key version's + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. + * + * This field may not be supplied if + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * is supplied. + * @param array $optionalArgs { + * Optional. + * + * @type Int64Value $digestCrc32c + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) + * is equal to + * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type string $data + * Optional. The data to sign. + * It can't be supplied if + * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] + * is supplied. + * @type Int64Value $dataCrc32c + * Optional. An optional CRC32C checksum of the + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) + * is equal to + * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\AsymmetricSignResponse + * + * @throws ApiException if the remote call fails + */ + public function asymmetricSign($name, $digest, array $optionalArgs = []) + { + $request = new AsymmetricSignRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setDigest($digest); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['digestCrc32c'])) { + $request->setDigestCrc32c($optionalArgs['digestCrc32c']); + } + + if (isset($optionalArgs['data'])) { + $request->setData($optionalArgs['data']); + } + + if (isset($optionalArgs['dataCrc32c'])) { + $request->setDataCrc32c($optionalArgs['dataCrc32c']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('AsymmetricSign', AsymmetricSignResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a + * [KeyRing][google.cloud.kms.v1.KeyRing]. + * + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and + * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] + * are required. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedParent = $keyManagementServiceClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + * $cryptoKeyId = 'crypto_key_id'; + * $cryptoKey = new CryptoKey(); + * $response = $keyManagementServiceClient->createCryptoKey($formattedParent, $cryptoKeyId, $cryptoKey); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing + * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * @param string $cryptoKeyId Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param CryptoKey $cryptoKey Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field + * values. + * @param array $optionalArgs { + * Optional. + * + * @type bool $skipInitialVersionCreation + * If set to true, the request will create a + * [CryptoKey][google.cloud.kms.v1.CryptoKey] without any + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must + * manually call + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] + * or + * [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion] + * before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * @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\Kms\V1\CryptoKey + * + * @throws ApiException if the remote call fails + */ + public function createCryptoKey($parent, $cryptoKeyId, $cryptoKey, array $optionalArgs = []) + { + $request = new CreateCryptoKeyRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setCryptoKeyId($cryptoKeyId); + $request->setCryptoKey($cryptoKey); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['skipInitialVersionCreation'])) { + $request->setSkipInitialVersionCreation($optionalArgs['skipInitialVersionCreation']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateCryptoKey', CryptoKey::class, $optionalArgs, $request)->wait(); + } + + /** + * Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a + * [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * The server will assign the next sequential id. If unset, + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedParent = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + * $cryptoKeyVersion = new CryptoKeyVersion(); + * $response = $keyManagementServiceClient->createCryptoKeyVersion($formattedParent, $cryptoKeyVersion); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the + * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * @param CryptoKeyVersion $cryptoKeyVersion Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * initial field values. + * @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\Kms\V1\CryptoKeyVersion + * + * @throws ApiException if the remote call fails + */ + public function createCryptoKeyVersion($parent, $cryptoKeyVersion, array $optionalArgs = []) + { + $request = new CreateCryptoKeyVersionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setCryptoKeyVersion($cryptoKeyVersion); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); + } + + /** + * Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a + * [KeyRing][google.cloud.kms.v1.KeyRing]. + * + * [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is + * required. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedParent = $keyManagementServiceClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + * $importJobId = 'import_job_id'; + * $importJob = new ImportJob(); + * $response = $keyManagementServiceClient->createImportJob($formattedParent, $importJobId, $importJob); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The [name][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the + * [ImportJobs][google.cloud.kms.v1.ImportJob]. + * @param string $importJobId Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param ImportJob $importJob Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field + * values. + * @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\Kms\V1\ImportJob + * + * @throws ApiException if the remote call fails + */ + public function createImportJob($parent, $importJobId, $importJob, array $optionalArgs = []) + { + $request = new CreateImportJobRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setImportJobId($importJobId); + $request->setImportJob($importJob); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateImportJob', ImportJob::class, $optionalArgs, $request)->wait(); + } + + /** + * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and + * Location. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedParent = $keyManagementServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $keyRingId = 'key_ring_id'; + * $keyRing = new KeyRing(); + * $response = $keyManagementServiceClient->createKeyRing($formattedParent, $keyRingId, $keyRing); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. + * @param string $keyRingId Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param KeyRing $keyRing Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field + * values. + * @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\Kms\V1\KeyRing + * + * @throws ApiException if the remote call fails + */ + public function createKeyRing($parent, $keyRingId, $keyRing, array $optionalArgs = []) + { + $request = new CreateKeyRingRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setKeyRingId($keyRingId); + $request->setKeyRing($keyRing); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateKeyRing', KeyRing::class, $optionalArgs, $request)->wait(); + } + + /** + * Decrypts data that was protected by + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + * $ciphertext = '...'; + * $response = $keyManagementServiceClient->decrypt($formattedName, $ciphertext); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The + * server will choose the appropriate version. + * @param string $ciphertext Required. The encrypted data originally returned in + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + * @param array $optionalArgs { + * Optional. + * + * @type string $additionalAuthenticatedData + * Optional. Optional data that must match the data originally supplied in + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * @type Int64Value $ciphertextCrc32c + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) + * is equal to + * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type Int64Value $additionalAuthenticatedDataCrc32c + * Optional. An optional CRC32C checksum of the + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) + * is equal to + * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\DecryptResponse + * + * @throws ApiException if the remote call fails + */ + public function decrypt($name, $ciphertext, array $optionalArgs = []) + { + $request = new DecryptRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setCiphertext($ciphertext); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['additionalAuthenticatedData'])) { + $request->setAdditionalAuthenticatedData($optionalArgs['additionalAuthenticatedData']); + } + + if (isset($optionalArgs['ciphertextCrc32c'])) { + $request->setCiphertextCrc32c($optionalArgs['ciphertextCrc32c']); + } + + if (isset($optionalArgs['additionalAuthenticatedDataCrc32c'])) { + $request->setAdditionalAuthenticatedDataCrc32c($optionalArgs['additionalAuthenticatedDataCrc32c']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Decrypt', DecryptResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for + * destruction. + * + * Upon calling this method, + * [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will + * be set to + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will + * be set to the time + * [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] + * in the future. At that time, the + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically + * change to + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], + * and the key material will be irrevocably destroyed. + * + * Before the + * [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is + * reached, + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + * may be called to reverse the process. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + * $response = $keyManagementServiceClient->destroyCryptoKeyVersion($formattedName); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. + * @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\Kms\V1\CryptoKeyVersion + * + * @throws ApiException if the remote call fails + */ + public function destroyCryptoKeyVersion($name, array $optionalArgs = []) + { + $request = new DestroyCryptoKeyVersionRequest(); + $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('DestroyCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); + } + + /** + * Encrypts data, so that it can only be recovered by a call to + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $name = 'name'; + * $plaintext = '...'; + * $response = $keyManagementServiceClient->encrypt($name, $plaintext); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] or + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * encryption. + * + * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server + * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. + * @param string $plaintext Required. The data to encrypt. Must be no larger than 64KiB. + * + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and + * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * @param array $optionalArgs { + * Optional. + * + * @type string $additionalAuthenticatedData + * Optional. Optional data that, if specified, must also be provided during + * decryption through + * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + * + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], + * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and + * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the + * AAD must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * @type Int64Value $plaintextCrc32c + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) + * is equal to + * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type Int64Value $additionalAuthenticatedDataCrc32c + * Optional. An optional CRC32C checksum of the + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] + * using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) + * is equal to + * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\EncryptResponse + * + * @throws ApiException if the remote call fails + */ + public function encrypt($name, $plaintext, array $optionalArgs = []) + { + $request = new EncryptRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setPlaintext($plaintext); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['additionalAuthenticatedData'])) { + $request->setAdditionalAuthenticatedData($optionalArgs['additionalAuthenticatedData']); + } + + if (isset($optionalArgs['plaintextCrc32c'])) { + $request->setPlaintextCrc32c($optionalArgs['plaintextCrc32c']); + } + + if (isset($optionalArgs['additionalAuthenticatedDataCrc32c'])) { + $request->setAdditionalAuthenticatedDataCrc32c($optionalArgs['additionalAuthenticatedDataCrc32c']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Encrypt', EncryptResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Generate random bytes using the Cloud KMS randomness source in the provided + * location. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $response = $keyManagementServiceClient->generateRandomBytes(); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $location + * The project-specific location in which to generate random bytes. + * For example, "projects/my-project/locations/us-central1". + * @type int $lengthBytes + * The length in bytes of the amount of randomness to retrieve. Minimum 8 + * bytes, maximum 1024 bytes. + * @type int $protectionLevel + * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when + * generating the random data. Currently, only + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is + * supported. + * For allowed values, use constants defined on {@see \Google\Cloud\Kms\V1\ProtectionLevel} + * @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\Kms\V1\GenerateRandomBytesResponse + * + * @throws ApiException if the remote call fails + */ + public function generateRandomBytes(array $optionalArgs = []) + { + $request = new GenerateRandomBytesRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['location'])) { + $request->setLocation($optionalArgs['location']); + $requestParamHeaders['location'] = $optionalArgs['location']; + } + + if (isset($optionalArgs['lengthBytes'])) { + $request->setLengthBytes($optionalArgs['lengthBytes']); + } + + if (isset($optionalArgs['protectionLevel'])) { + $request->setProtectionLevel($optionalArgs['protectionLevel']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GenerateRandomBytes', GenerateRandomBytesResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as + * well as its [primary][google.cloud.kms.v1.CryptoKey.primary] + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + * $response = $keyManagementServiceClient->getCryptoKey($formattedName); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. + * @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\Kms\V1\CryptoKey + * + * @throws ApiException if the remote call fails + */ + public function getCryptoKey($name, array $optionalArgs = []) + { + $request = new GetCryptoKeyRequest(); + $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('GetCryptoKey', CryptoKey::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns metadata for a given + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + * $response = $keyManagementServiceClient->getCryptoKeyVersion($formattedName); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. + * @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\Kms\V1\CryptoKeyVersion + * + * @throws ApiException if the remote call fails + */ + public function getCryptoKeyVersion($name, array $optionalArgs = []) + { + $request = new GetCryptoKeyVersionRequest(); + $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('GetCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->importJobName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[IMPORT_JOB]'); + * $response = $keyManagementServiceClient->getImportJob($formattedName); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [name][google.cloud.kms.v1.ImportJob.name] of the + * [ImportJob][google.cloud.kms.v1.ImportJob] to get. + * @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\Kms\V1\ImportJob + * + * @throws ApiException if the remote call fails + */ + public function getImportJob($name, array $optionalArgs = []) + { + $request = new GetImportJobRequest(); + $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('GetImportJob', ImportJob::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + * $response = $keyManagementServiceClient->getKeyRing($formattedName); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [name][google.cloud.kms.v1.KeyRing.name] of the + * [KeyRing][google.cloud.kms.v1.KeyRing] to get. + * @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\Kms\V1\KeyRing + * + * @throws ApiException if the remote call fails + */ + public function getKeyRing($name, array $optionalArgs = []) + { + $request = new GetKeyRingRequest(); + $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('GetKeyRing', KeyRing::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the public key for the given + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] + * or + * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + * $response = $keyManagementServiceClient->getPublicKey($formattedName); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. + * @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\Kms\V1\PublicKey + * + * @throws ApiException if the remote call fails + */ + public function getPublicKey($name, array $optionalArgs = []) + { + $request = new GetPublicKeyRequest(); + $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('GetPublicKey', PublicKey::class, $optionalArgs, $request)->wait(); + } + + /** + * Import wrapped key material into a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * + * All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If + * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] is additionally + * specified in the request, key material will be reimported into that + * version. Otherwise, a new version will be created, and will be assigned the + * next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedParent = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + * $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; + * $importJob = 'import_job'; + * $response = $keyManagementServiceClient->importCryptoKeyVersion($formattedParent, $algorithm, $importJob); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to be imported into. + * + * The create permission is only required on this key when creating a new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * @param int $algorithm Required. The + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + * of the key being imported. This does not need to match the + * [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] this version imports into. + * For allowed values, use constants defined on {@see \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionAlgorithm} + * @param string $importJob Required. The [name][google.cloud.kms.v1.ImportJob.name] of the + * [ImportJob][google.cloud.kms.v1.ImportJob] that was used to wrap this key + * material. + * @param array $optionalArgs { + * Optional. + * + * @type string $cryptoKeyVersion + * Optional. The optional [name][google.cloud.kms.v1.CryptoKeyVersion.name] of + * an existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to + * target for an import operation. If this field is not present, a new + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] containing the + * supplied key material is created. + * + * If this field is present, the supplied key material is imported into + * the existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. To + * import into an existing + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must be a child of + * [ImportCryptoKeyVersionRequest.parent][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.parent], + * have been previously created via [ImportCryptoKeyVersion][], and be in + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED] + * or + * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED] + * state. The key material and algorithm must match the previous + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] exactly if the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] has ever contained + * key material. + * @type string $wrappedKey + * Optional. The wrapped key material to import. + * + * Before wrapping, key material must be formatted. If importing symmetric key + * material, the expected key material format is plain bytes. If importing + * asymmetric key material, the expected key material format is PKCS#8-encoded + * DER (the PrivateKeyInfo structure from RFC 5208). + * + * When wrapping with import methods + * ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256] + * or + * [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256] + * or + * [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256] + * or + * [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]), + * + * this field must contain the concatenation of: + *
    + *
  1. An ephemeral AES-256 wrapping key wrapped with the + * [public_key][google.cloud.kms.v1.ImportJob.public_key] using + * RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty + * label. + *
  2. + *
  3. The formatted key to be imported, wrapped with the ephemeral AES-256 + * key using AES-KWP (RFC 5649). + *
  4. + *
+ * + * This format is the same as the format produced by PKCS#11 mechanism + * CKM_RSA_AES_KEY_WRAP. + * + * When wrapping with import methods + * ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256] + * or + * [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]), + * + * this field must contain the formatted key to be imported, wrapped with the + * [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP + * with SHA-256, MGF1 with SHA-256, and an empty label. + * @type string $rsaAesWrappedKey + * Optional. This field has the same meaning as + * [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key]. + * Prefer to use that field in new work. Either that field or this field + * (but not both) must be specified. + * @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\Kms\V1\CryptoKeyVersion + * + * @throws ApiException if the remote call fails + */ + public function importCryptoKeyVersion($parent, $algorithm, $importJob, array $optionalArgs = []) + { + $request = new ImportCryptoKeyVersionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setAlgorithm($algorithm); + $request->setImportJob($importJob); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['cryptoKeyVersion'])) { + $request->setCryptoKeyVersion($optionalArgs['cryptoKeyVersion']); + } + + if (isset($optionalArgs['wrappedKey'])) { + $request->setWrappedKey($optionalArgs['wrappedKey']); + } + + if (isset($optionalArgs['rsaAesWrappedKey'])) { + $request->setRsaAesWrappedKey($optionalArgs['rsaAesWrappedKey']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ImportCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedParent = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + * // Iterate over pages of elements + * $pagedResponse = $keyManagementServiceClient->listCryptoKeyVersions($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $keyManagementServiceClient->listCryptoKeyVersions($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * @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 int $view + * The fields to include in the response. + * For allowed values, use constants defined on {@see \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionView} + * @type string $filter + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type string $orderBy + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listCryptoKeyVersions($parent, array $optionalArgs = []) + { + $request = new ListCryptoKeyVersionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListCryptoKeyVersions', $optionalArgs, ListCryptoKeyVersionsResponse::class, $request); + } + + /** + * Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedParent = $keyManagementServiceClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + * // Iterate over pages of elements + * $pagedResponse = $keyManagementServiceClient->listCryptoKeys($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $keyManagementServiceClient->listCryptoKeys($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. + * @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 int $versionView + * The fields of the primary version to include in the response. + * For allowed values, use constants defined on {@see \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionView} + * @type string $filter + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type string $orderBy + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listCryptoKeys($parent, array $optionalArgs = []) + { + $request = new ListCryptoKeysRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['versionView'])) { + $request->setVersionView($optionalArgs['versionView']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListCryptoKeys', $optionalArgs, ListCryptoKeysResponse::class, $request); + } + + /** + * Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedParent = $keyManagementServiceClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + * // Iterate over pages of elements + * $pagedResponse = $keyManagementServiceClient->listImportJobs($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $keyManagementServiceClient->listImportJobs($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] + * to list, in the format `projects/*/locations/*/keyRings/*`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type string $orderBy + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listImportJobs($parent, array $optionalArgs = []) + { + $request = new ListImportJobsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListImportJobs', $optionalArgs, ListImportJobsResponse::class, $request); + } + + /** + * Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedParent = $keyManagementServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $keyManagementServiceClient->listKeyRings($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $keyManagementServiceClient->listKeyRings($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format + * `projects/*/locations/*`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Only include resources that match the filter in the response. For + * more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type string $orderBy + * Optional. Specify how the results should be sorted. If not specified, the + * results will be sorted in the default order. For more information, see + * [Sorting and filtering list + * results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listKeyRings($parent, array $optionalArgs = []) + { + $request = new ListKeyRingsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListKeyRings', $optionalArgs, ListKeyRingsResponse::class, $request); + } + + /** + * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, + * producing a tag that can be verified by another source with the same key. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + * $data = '...'; + * $response = $keyManagementServiceClient->macSign($formattedName, $data); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * signing. + * @param string $data Required. The data to sign. The MAC tag is computed over this data field + * based on the specific algorithm. + * @param array $optionalArgs { + * Optional. + * + * @type Int64Value $dataCrc32c + * Optional. An optional CRC32C checksum of the + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is + * equal to + * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\MacSignResponse + * + * @throws ApiException if the remote call fails + */ + public function macSign($name, $data, array $optionalArgs = []) + { + $request = new MacSignRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setData($data); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['dataCrc32c'])) { + $request->setDataCrc32c($optionalArgs['dataCrc32c']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('MacSign', MacSignResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Verifies MAC tag using a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns + * a response that indicates whether or not the verification was successful. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + * $data = '...'; + * $mac = '...'; + * $response = $keyManagementServiceClient->macVerify($formattedName, $data, $mac); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * verification. + * @param string $data Required. The data used previously as a + * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate + * the MAC tag. + * @param string $mac Required. The signature to verify. + * @param array $optionalArgs { + * Optional. + * + * @type Int64Value $dataCrc32c + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) + * is equal to + * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type Int64Value $macCrc32c + * Optional. An optional CRC32C checksum of the + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If + * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will verify the integrity of the received + * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C([MacVerifyRequest.tag][]) is equal to + * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], + * and if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. Note: This + * field is defined as int64 for reasons of compatibility across different + * languages. However, it is a non-negative integer, which will never exceed + * 2^32-1, and can be safely downconverted to uint32 in languages that support + * this type. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\MacVerifyResponse + * + * @throws ApiException if the remote call fails + */ + public function macVerify($name, $data, $mac, array $optionalArgs = []) + { + $request = new MacVerifyRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setData($data); + $request->setMac($mac); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['dataCrc32c'])) { + $request->setDataCrc32c($optionalArgs['dataCrc32c']); + } + + if (isset($optionalArgs['macCrc32c'])) { + $request->setMacCrc32c($optionalArgs['macCrc32c']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('MacVerify', MacVerifyResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Decrypts data that was originally encrypted using a raw cryptographic + * mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + * must be + * [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $name = 'name'; + * $ciphertext = '...'; + * $initializationVector = '...'; + * $response = $keyManagementServiceClient->rawDecrypt($name, $ciphertext, $initializationVector); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * decryption. + * @param string $ciphertext Required. The encrypted data originally returned in + * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. + * @param string $initializationVector Required. The initialization vector (IV) used during encryption, which must + * match the data originally provided in + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * @param array $optionalArgs { + * Optional. + * + * @type string $additionalAuthenticatedData + * Optional. Optional data that must match the data originally supplied in + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * @type int $tagLength + * The length of the authentication tag that is appended to the end of + * the ciphertext. If unspecified (0), the default value for the key's + * algorithm will be used (for AES-GCM, the default value is 16). + * @type Int64Value $ciphertextCrc32c + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received ciphertext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(ciphertext) is equal + * to ciphertext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * @type Int64Value $additionalAuthenticatedDataCrc32c + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * @type Int64Value $initializationVectorCrc32c + * Optional. An optional CRC32C checksum of the + * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and + * if so, perform a limited number of retries. A persistent mismatch may + * indicate an issue in your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\RawDecryptResponse + * + * @throws ApiException if the remote call fails + */ + public function rawDecrypt($name, $ciphertext, $initializationVector, array $optionalArgs = []) + { + $request = new RawDecryptRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setCiphertext($ciphertext); + $request->setInitializationVector($initializationVector); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['additionalAuthenticatedData'])) { + $request->setAdditionalAuthenticatedData($optionalArgs['additionalAuthenticatedData']); + } + + if (isset($optionalArgs['tagLength'])) { + $request->setTagLength($optionalArgs['tagLength']); + } + + if (isset($optionalArgs['ciphertextCrc32c'])) { + $request->setCiphertextCrc32c($optionalArgs['ciphertextCrc32c']); + } + + if (isset($optionalArgs['additionalAuthenticatedDataCrc32c'])) { + $request->setAdditionalAuthenticatedDataCrc32c($optionalArgs['additionalAuthenticatedDataCrc32c']); + } + + if (isset($optionalArgs['initializationVectorCrc32c'])) { + $request->setInitializationVectorCrc32c($optionalArgs['initializationVectorCrc32c']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RawDecrypt', RawDecryptResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Encrypts data using portable cryptographic primitives. Most users should + * choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than + * their raw counterparts. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $name = 'name'; + * $plaintext = '...'; + * $response = $keyManagementServiceClient->rawEncrypt($name, $plaintext); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + * encryption. + * @param string $plaintext Required. The data to encrypt. Must be no larger than 64KiB. + * + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * @param array $optionalArgs { + * Optional. + * + * @type string $additionalAuthenticatedData + * Optional. Optional data that, if specified, must also be provided during + * decryption through + * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. + * + * This field may only be used in conjunction with an + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm] that accepts + * additional authenticated data (for example, AES-GCM). + * + * The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. + * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the + * plaintext must be no larger than 64KiB. For + * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of + * the plaintext and additional_authenticated_data fields must be no larger + * than 8KiB. + * @type Int64Value $plaintextCrc32c + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received plaintext using this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that CRC32C(plaintext) is equal + * to plaintext_crc32c, and if so, perform a limited number of retries. A + * persistent mismatch may indicate an issue in your computation of the CRC32C + * checksum. Note: This field is defined as int64 for reasons of compatibility + * across different languages. However, it is a non-negative integer, which + * will never exceed 2^32-1, and can be safely downconverted to uint32 in + * languages that support this type. + * @type Int64Value $additionalAuthenticatedDataCrc32c + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received additional_authenticated_data using + * this checksum. + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(additional_authenticated_data) is equal to + * additional_authenticated_data_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * @type string $initializationVector + * Optional. A customer-supplied initialization vector that will be used for + * encryption. If it is not provided for AES-CBC and AES-CTR, one will be + * generated. It will be returned in + * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. + * @type Int64Value $initializationVectorCrc32c + * Optional. An optional CRC32C checksum of the + * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. + * If specified, + * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + * verify the integrity of the received initialization_vector using this + * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] + * will report an error if the checksum verification fails. If you receive a + * checksum error, your client should verify that + * CRC32C(initialization_vector) is equal to + * initialization_vector_crc32c, and if so, perform + * a limited number of retries. A persistent mismatch may indicate an issue in + * your computation of the CRC32C checksum. + * Note: This field is defined as int64 for reasons of compatibility across + * different languages. However, it is a non-negative integer, which will + * never exceed 2^32-1, and can be safely downconverted to uint32 in languages + * that support this type. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Kms\V1\RawEncryptResponse + * + * @throws ApiException if the remote call fails + */ + public function rawEncrypt($name, $plaintext, array $optionalArgs = []) + { + $request = new RawEncryptRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setPlaintext($plaintext); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['additionalAuthenticatedData'])) { + $request->setAdditionalAuthenticatedData($optionalArgs['additionalAuthenticatedData']); + } + + if (isset($optionalArgs['plaintextCrc32c'])) { + $request->setPlaintextCrc32c($optionalArgs['plaintextCrc32c']); + } + + if (isset($optionalArgs['additionalAuthenticatedDataCrc32c'])) { + $request->setAdditionalAuthenticatedDataCrc32c($optionalArgs['additionalAuthenticatedDataCrc32c']); + } + + if (isset($optionalArgs['initializationVector'])) { + $request->setInitializationVector($optionalArgs['initializationVector']); + } + + if (isset($optionalArgs['initializationVectorCrc32c'])) { + $request->setInitializationVectorCrc32c($optionalArgs['initializationVectorCrc32c']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RawEncrypt', RawEncryptResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * state. + * + * Upon restoration of the CryptoKeyVersion, + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will + * be cleared. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + * $response = $keyManagementServiceClient->restoreCryptoKeyVersion($formattedName); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. + * @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\Kms\V1\CryptoKeyVersion + * + * @throws ApiException if the remote call fails + */ + public function restoreCryptoKeyVersion($name, array $optionalArgs = []) + { + $request = new RestoreCryptoKeyVersionRequest(); + $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('RestoreCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); + } + + /** + * Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $cryptoKey = new CryptoKey(); + * $updateMask = new FieldMask(); + * $response = $keyManagementServiceClient->updateCryptoKey($cryptoKey, $updateMask); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param CryptoKey $cryptoKey Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. + * @param FieldMask $updateMask Required. List of fields to be updated in this request. + * @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\Kms\V1\CryptoKey + * + * @throws ApiException if the remote call fails + */ + public function updateCryptoKey($cryptoKey, $updateMask, array $optionalArgs = []) + { + $request = new UpdateCryptoKeyRequest(); + $requestParamHeaders = []; + $request->setCryptoKey($cryptoKey); + $request->setUpdateMask($updateMask); + $requestParamHeaders['crypto_key.name'] = $cryptoKey->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateCryptoKey', CryptoKey::class, $optionalArgs, $request)->wait(); + } + + /** + * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that + * will be used in + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * + * Returns an error if called on a key whose purpose is not + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $formattedName = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + * $cryptoKeyVersionId = 'crypto_key_version_id'; + * $response = $keyManagementServiceClient->updateCryptoKeyPrimaryVersion($formattedName, $cryptoKeyVersionId); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. + * @param string $cryptoKeyVersionId Required. The id of the child + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. + * @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\Kms\V1\CryptoKey + * + * @throws ApiException if the remote call fails + */ + public function updateCryptoKeyPrimaryVersion($name, $cryptoKeyVersionId, array $optionalArgs = []) + { + $request = new UpdateCryptoKeyPrimaryVersionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setCryptoKeyVersionId($cryptoKeyVersionId); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateCryptoKeyPrimaryVersion', CryptoKey::class, $optionalArgs, $request)->wait(); + } + + /** + * Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s + * metadata. + * + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] + * and + * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] + * using this method. See + * [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] + * and + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + * to move between other states. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $cryptoKeyVersion = new CryptoKeyVersion(); + * $updateMask = new FieldMask(); + * $response = $keyManagementServiceClient->updateCryptoKeyVersion($cryptoKeyVersion, $updateMask); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param CryptoKeyVersion $cryptoKeyVersion Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * updated values. + * @param FieldMask $updateMask Required. List of fields to be updated in this request. + * @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\Kms\V1\CryptoKeyVersion + * + * @throws ApiException if the remote call fails + */ + public function updateCryptoKeyVersion($cryptoKeyVersion, $updateMask, array $optionalArgs = []) + { + $request = new UpdateCryptoKeyVersionRequest(); + $requestParamHeaders = []; + $request->setCryptoKeyVersion($cryptoKeyVersion); + $request->setUpdateMask($updateMask); + $requestParamHeaders['crypto_key_version.name'] = $cryptoKeyVersion->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $response = $keyManagementServiceClient->getLocation(); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $keyManagementServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $keyManagementServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $resource = 'resource'; + * $response = $keyManagementServiceClient->getIamPolicy($resource); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $keyManagementServiceClient->setIamPolicy($resource, $policy); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * Sample code: + * ``` + * $keyManagementServiceClient = new KeyManagementServiceClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $keyManagementServiceClient->testIamPermissions($resource, $permissions); + * } finally { + * $keyManagementServiceClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); + } +} diff --git a/owl-bot-staging/Kms/v1/src/V1/KeyManagementServiceClient.php b/owl-bot-staging/Kms/v1/src/V1/KeyManagementServiceClient.php new file mode 100644 index 000000000000..4f107eec48d7 --- /dev/null +++ b/owl-bot-staging/Kms/v1/src/V1/KeyManagementServiceClient.php @@ -0,0 +1,34 @@ + [ + 'google.cloud.kms.v1.EkmService' => [ + 'CreateEkmConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\EkmConnection', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetEkmConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\EkmConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEkmConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\EkmConnection', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListEkmConnections' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEkmConnections', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\ListEkmConnectionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEkmConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\EkmConfig', + 'headerParams' => [ + [ + 'keyName' => 'ekm_config.name', + 'fieldAccessors' => [ + 'getEkmConfig', + 'getName', + ], + ], + ], + ], + 'UpdateEkmConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\EkmConnection', + 'headerParams' => [ + [ + 'keyName' => 'ekm_connection.name', + 'fieldAccessors' => [ + 'getEkmConnection', + 'getName', + ], + ], + ], + ], + 'VerifyConnectivity' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\VerifyConnectivityResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'ekmConfig' => 'projects/{project}/locations/{location}/ekmConfig', + 'ekmConnection' => 'projects/{project}/locations/{location}/ekmConnections/{ekm_connection}', + 'location' => 'projects/{project}/locations/{location}', + 'service' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_rest_client_config.php b/owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_rest_client_config.php new file mode 100644 index 000000000000..d727cf9dbad7 --- /dev/null +++ b/owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_rest_client_config.php @@ -0,0 +1,243 @@ + [ + 'google.cloud.kms.v1.EkmService' => [ + 'CreateEkmConnection' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/ekmConnections', + 'body' => 'ekm_connection', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'ekm_connection_id', + ], + ], + 'GetEkmConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/ekmConfig}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEkmConnection' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/ekmConnections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEkmConnections' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/ekmConnections', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEkmConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{ekm_config.name=projects/*/locations/*/ekmConfig}', + 'body' => 'ekm_config', + 'placeholders' => [ + 'ekm_config.name' => [ + 'getters' => [ + 'getEkmConfig', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateEkmConnection' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{ekm_connection.name=projects/*/locations/*/ekmConnections/*}', + 'body' => 'ekm_connection', + 'placeholders' => [ + 'ekm_connection.name' => [ + 'getters' => [ + 'getEkmConnection', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'VerifyConnectivity' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/ekmConnections/*}:verifyConnectivity', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_client_config.json b/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_client_config.json new file mode 100644 index 000000000000..e29002f9aa07 --- /dev/null +++ b/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_client_config.json @@ -0,0 +1,191 @@ +{ + "interfaces": { + "google.cloud.kms.v1.KeyManagementService": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "AsymmetricDecrypt": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AsymmetricSign": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCryptoKey": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCryptoKeyVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateImportJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateKeyRing": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Decrypt": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DestroyCryptoKeyVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Encrypt": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateRandomBytes": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCryptoKey": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetCryptoKeyVersion": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetImportJob": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetKeyRing": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetPublicKey": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ImportCryptoKeyVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCryptoKeyVersions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListCryptoKeys": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListImportJobs": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListKeyRings": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "MacSign": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MacVerify": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RawDecrypt": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RawEncrypt": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreCryptoKeyVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCryptoKey": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCryptoKeyPrimaryVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCryptoKeyVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_descriptor_config.php b/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_descriptor_config.php new file mode 100644 index 000000000000..841c9a29088a --- /dev/null +++ b/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_descriptor_config.php @@ -0,0 +1,478 @@ + [ + 'google.cloud.kms.v1.KeyManagementService' => [ + 'AsymmetricDecrypt' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\AsymmetricDecryptResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'AsymmetricSign' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\AsymmetricSignResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateCryptoKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\CryptoKey', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateCryptoKeyVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateImportJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\ImportJob', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateKeyRing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\KeyRing', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'Decrypt' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\DecryptResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DestroyCryptoKeyVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'Encrypt' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\EncryptResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GenerateRandomBytes' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\GenerateRandomBytesResponse', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getLocation', + ], + ], + ], + ], + 'GetCryptoKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\CryptoKey', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetCryptoKeyVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetImportJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\ImportJob', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetKeyRing' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\KeyRing', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetPublicKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\PublicKey', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportCryptoKeyVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListCryptoKeyVersions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCryptoKeyVersions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\ListCryptoKeyVersionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListCryptoKeys' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCryptoKeys', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\ListCryptoKeysResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListImportJobs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getImportJobs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\ListImportJobsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListKeyRings' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getKeyRings', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\ListKeyRingsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'MacSign' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\MacSignResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'MacVerify' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\MacVerifyResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RawDecrypt' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\RawDecryptResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RawEncrypt' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\RawEncryptResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RestoreCryptoKeyVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateCryptoKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\CryptoKey', + 'headerParams' => [ + [ + 'keyName' => 'crypto_key.name', + 'fieldAccessors' => [ + 'getCryptoKey', + 'getName', + ], + ], + ], + ], + 'UpdateCryptoKeyPrimaryVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\CryptoKey', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateCryptoKeyVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', + 'headerParams' => [ + [ + 'keyName' => 'crypto_key_version.name', + 'fieldAccessors' => [ + 'getCryptoKeyVersion', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', + 'cryptoKeyVersion' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}', + 'importJob' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}', + 'keyRing' => 'projects/{project}/locations/{location}/keyRings/{key_ring}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_rest_client_config.php b/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_rest_client_config.php new file mode 100644 index 000000000000..fb7c434b4e71 --- /dev/null +++ b/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_rest_client_config.php @@ -0,0 +1,496 @@ + [ + 'google.cloud.kms.v1.KeyManagementService' => [ + 'AsymmetricDecrypt' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricDecrypt', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'AsymmetricSign' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricSign', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateCryptoKey' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys', + 'body' => 'crypto_key', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'crypto_key_id', + ], + ], + 'CreateCryptoKeyVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions', + 'body' => 'crypto_key_version', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateImportJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs', + 'body' => 'import_job', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'import_job_id', + ], + ], + 'CreateKeyRing' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/keyRings', + 'body' => 'key_ring', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'key_ring_id', + ], + ], + 'Decrypt' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:decrypt', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DestroyCryptoKeyVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:destroy', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'Encrypt' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/**}:encrypt', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GenerateRandomBytes' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{location=projects/*/locations/*}:generateRandomBytes', + 'body' => '*', + 'placeholders' => [ + 'location' => [ + 'getters' => [ + 'getLocation', + ], + ], + ], + ], + 'GetCryptoKey' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCryptoKeyVersion' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetImportJob' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/importJobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetKeyRing' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetPublicKey' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}/publicKey', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportCryptoKeyVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:import', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListCryptoKeyVersions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListCryptoKeys' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListImportJobs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListKeyRings' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/keyRings', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'MacSign' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macSign', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'MacVerify' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macVerify', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RawDecrypt' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawDecrypt', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RawEncrypt' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawEncrypt', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RestoreCryptoKeyVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:restore', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateCryptoKey' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{crypto_key.name=projects/*/locations/*/keyRings/*/cryptoKeys/*}', + 'body' => 'crypto_key', + 'placeholders' => [ + 'crypto_key.name' => [ + 'getters' => [ + 'getCryptoKey', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateCryptoKeyPrimaryVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:updatePrimaryVersion', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateCryptoKeyVersion' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{crypto_key_version.name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}', + 'body' => 'crypto_key_version', + 'placeholders' => [ + 'crypto_key_version.name' => [ + 'getters' => [ + 'getCryptoKeyVersion', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/EkmServiceClientTest.php b/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/EkmServiceClientTest.php new file mode 100644 index 000000000000..49e7f80489b6 --- /dev/null +++ b/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/EkmServiceClientTest.php @@ -0,0 +1,948 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return EkmServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new EkmServiceClient($options); + } + + /** @test */ + public function createEkmConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $cryptoSpacePath = 'cryptoSpacePath-1229393412'; + $expectedResponse = new EkmConnection(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setCryptoSpacePath($cryptoSpacePath); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $ekmConnectionId = 'ekmConnectionId270499940'; + $ekmConnection = new EkmConnection(); + $request = (new CreateEkmConnectionRequest()) + ->setParent($formattedParent) + ->setEkmConnectionId($ekmConnectionId) + ->setEkmConnection($ekmConnection); + $response = $gapicClient->createEkmConnection($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.kms.v1.EkmService/CreateEkmConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getEkmConnectionId(); + $this->assertProtobufEquals($ekmConnectionId, $actualValue); + $actualValue = $actualRequestObject->getEkmConnection(); + $this->assertProtobufEquals($ekmConnection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createEkmConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $ekmConnectionId = 'ekmConnectionId270499940'; + $ekmConnection = new EkmConnection(); + $request = (new CreateEkmConnectionRequest()) + ->setParent($formattedParent) + ->setEkmConnectionId($ekmConnectionId) + ->setEkmConnection($ekmConnection); + try { + $gapicClient->createEkmConnection($request); + // 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 getEkmConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $defaultEkmConnection = 'defaultEkmConnection1342549844'; + $expectedResponse = new EkmConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setDefaultEkmConnection($defaultEkmConnection); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->ekmConfigName('[PROJECT]', '[LOCATION]'); + $request = (new GetEkmConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getEkmConfig($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.kms.v1.EkmService/GetEkmConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEkmConfigExceptionTest() + { + $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->ekmConfigName('[PROJECT]', '[LOCATION]'); + $request = (new GetEkmConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->getEkmConfig($request); + // 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 getEkmConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $cryptoSpacePath = 'cryptoSpacePath-1229393412'; + $expectedResponse = new EkmConnection(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $expectedResponse->setCryptoSpacePath($cryptoSpacePath); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + $request = (new GetEkmConnectionRequest()) + ->setName($formattedName); + $response = $gapicClient->getEkmConnection($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.kms.v1.EkmService/GetEkmConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEkmConnectionExceptionTest() + { + $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->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + $request = (new GetEkmConnectionRequest()) + ->setName($formattedName); + try { + $gapicClient->getEkmConnection($request); + // 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 listEkmConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $ekmConnectionsElement = new EkmConnection(); + $ekmConnections = [ + $ekmConnectionsElement, + ]; + $expectedResponse = new ListEkmConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setEkmConnections($ekmConnections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListEkmConnectionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listEkmConnections($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEkmConnections()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.EkmService/ListEkmConnections', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEkmConnectionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListEkmConnectionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listEkmConnections($request); + // 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 updateEkmConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $defaultEkmConnection = 'defaultEkmConnection1342549844'; + $expectedResponse = new EkmConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDefaultEkmConnection($defaultEkmConnection); + $transport->addResponse($expectedResponse); + // Mock request + $ekmConfig = new EkmConfig(); + $updateMask = new FieldMask(); + $request = (new UpdateEkmConfigRequest()) + ->setEkmConfig($ekmConfig) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateEkmConfig($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.kms.v1.EkmService/UpdateEkmConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getEkmConfig(); + $this->assertProtobufEquals($ekmConfig, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEkmConfigExceptionTest() + { + $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 + $ekmConfig = new EkmConfig(); + $updateMask = new FieldMask(); + $request = (new UpdateEkmConfigRequest()) + ->setEkmConfig($ekmConfig) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateEkmConfig($request); + // 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 updateEkmConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $cryptoSpacePath = 'cryptoSpacePath-1229393412'; + $expectedResponse = new EkmConnection(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setCryptoSpacePath($cryptoSpacePath); + $transport->addResponse($expectedResponse); + // Mock request + $ekmConnection = new EkmConnection(); + $updateMask = new FieldMask(); + $request = (new UpdateEkmConnectionRequest()) + ->setEkmConnection($ekmConnection) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateEkmConnection($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.kms.v1.EkmService/UpdateEkmConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getEkmConnection(); + $this->assertProtobufEquals($ekmConnection, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEkmConnectionExceptionTest() + { + $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 + $ekmConnection = new EkmConnection(); + $updateMask = new FieldMask(); + $request = (new UpdateEkmConnectionRequest()) + ->setEkmConnection($ekmConnection) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateEkmConnection($request); + // 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 verifyConnectivityTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new VerifyConnectivityResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + $request = (new VerifyConnectivityRequest()) + ->setName($formattedName); + $response = $gapicClient->verifyConnectivity($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.kms.v1.EkmService/VerifyConnectivity', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function verifyConnectivityExceptionTest() + { + $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->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + $request = (new VerifyConnectivityRequest()) + ->setName($formattedName); + try { + $gapicClient->verifyConnectivity($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($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.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 createEkmConnectionAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $cryptoSpacePath = 'cryptoSpacePath-1229393412'; + $expectedResponse = new EkmConnection(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setCryptoSpacePath($cryptoSpacePath); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $ekmConnectionId = 'ekmConnectionId270499940'; + $ekmConnection = new EkmConnection(); + $request = (new CreateEkmConnectionRequest()) + ->setParent($formattedParent) + ->setEkmConnectionId($ekmConnectionId) + ->setEkmConnection($ekmConnection); + $response = $gapicClient->createEkmConnectionAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.EkmService/CreateEkmConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getEkmConnectionId(); + $this->assertProtobufEquals($ekmConnectionId, $actualValue); + $actualValue = $actualRequestObject->getEkmConnection(); + $this->assertProtobufEquals($ekmConnection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/KeyManagementServiceClientTest.php b/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/KeyManagementServiceClientTest.php new file mode 100644 index 000000000000..a908438108e1 --- /dev/null +++ b/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/KeyManagementServiceClientTest.php @@ -0,0 +1,2573 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return KeyManagementServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new KeyManagementServiceClient($options); + } + + /** @test */ + public function asymmetricDecryptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $plaintext = '-9'; + $verifiedCiphertextCrc32c = true; + $expectedResponse = new AsymmetricDecryptResponse(); + $expectedResponse->setPlaintext($plaintext); + $expectedResponse->setVerifiedCiphertextCrc32c($verifiedCiphertextCrc32c); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $ciphertext = '-72'; + $request = (new AsymmetricDecryptRequest()) + ->setName($formattedName) + ->setCiphertext($ciphertext); + $response = $gapicClient->asymmetricDecrypt($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.kms.v1.KeyManagementService/AsymmetricDecrypt', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getCiphertext(); + $this->assertProtobufEquals($ciphertext, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function asymmetricDecryptExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $ciphertext = '-72'; + $request = (new AsymmetricDecryptRequest()) + ->setName($formattedName) + ->setCiphertext($ciphertext); + try { + $gapicClient->asymmetricDecrypt($request); + // 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 asymmetricSignTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $signature = '-72'; + $verifiedDigestCrc32c = true; + $name2 = 'name2-1052831874'; + $verifiedDataCrc32c = true; + $expectedResponse = new AsymmetricSignResponse(); + $expectedResponse->setSignature($signature); + $expectedResponse->setVerifiedDigestCrc32c($verifiedDigestCrc32c); + $expectedResponse->setName($name2); + $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $digest = new Digest(); + $request = (new AsymmetricSignRequest()) + ->setName($formattedName) + ->setDigest($digest); + $response = $gapicClient->asymmetricSign($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.kms.v1.KeyManagementService/AsymmetricSign', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getDigest(); + $this->assertProtobufEquals($digest, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function asymmetricSignExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $digest = new Digest(); + $request = (new AsymmetricSignRequest()) + ->setName($formattedName) + ->setDigest($digest); + try { + $gapicClient->asymmetricSign($request); + // 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 createCryptoKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $importOnly = true; + $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; + $expectedResponse = new CryptoKey(); + $expectedResponse->setName($name); + $expectedResponse->setImportOnly($importOnly); + $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $cryptoKeyId = 'cryptoKeyId-2123094983'; + $cryptoKey = new CryptoKey(); + $request = (new CreateCryptoKeyRequest()) + ->setParent($formattedParent) + ->setCryptoKeyId($cryptoKeyId) + ->setCryptoKey($cryptoKey); + $response = $gapicClient->createCryptoKey($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.kms.v1.KeyManagementService/CreateCryptoKey', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getCryptoKeyId(); + $this->assertProtobufEquals($cryptoKeyId, $actualValue); + $actualValue = $actualRequestObject->getCryptoKey(); + $this->assertProtobufEquals($cryptoKey, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createCryptoKeyExceptionTest() + { + $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $cryptoKeyId = 'cryptoKeyId-2123094983'; + $cryptoKey = new CryptoKey(); + $request = (new CreateCryptoKeyRequest()) + ->setParent($formattedParent) + ->setCryptoKeyId($cryptoKeyId) + ->setCryptoKey($cryptoKey); + try { + $gapicClient->createCryptoKey($request); + // 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 createCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $importJob = 'importJob2125587491'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name); + $expectedResponse->setImportJob($importJob); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $cryptoKeyVersion = new CryptoKeyVersion(); + $request = (new CreateCryptoKeyVersionRequest()) + ->setParent($formattedParent) + ->setCryptoKeyVersion($cryptoKeyVersion); + $response = $gapicClient->createCryptoKeyVersion($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.kms.v1.KeyManagementService/CreateCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getCryptoKeyVersion(); + $this->assertProtobufEquals($cryptoKeyVersion, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createCryptoKeyVersionExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $cryptoKeyVersion = new CryptoKeyVersion(); + $request = (new CreateCryptoKeyVersionRequest()) + ->setParent($formattedParent) + ->setCryptoKeyVersion($cryptoKeyVersion); + try { + $gapicClient->createCryptoKeyVersion($request); + // 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 createImportJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new ImportJob(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $importJobId = 'importJobId-1620773193'; + $importJob = new ImportJob(); + $importJobImportMethod = ImportMethod::IMPORT_METHOD_UNSPECIFIED; + $importJob->setImportMethod($importJobImportMethod); + $importJobProtectionLevel = ProtectionLevel::PROTECTION_LEVEL_UNSPECIFIED; + $importJob->setProtectionLevel($importJobProtectionLevel); + $request = (new CreateImportJobRequest()) + ->setParent($formattedParent) + ->setImportJobId($importJobId) + ->setImportJob($importJob); + $response = $gapicClient->createImportJob($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.kms.v1.KeyManagementService/CreateImportJob', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getImportJobId(); + $this->assertProtobufEquals($importJobId, $actualValue); + $actualValue = $actualRequestObject->getImportJob(); + $this->assertProtobufEquals($importJob, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createImportJobExceptionTest() + { + $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $importJobId = 'importJobId-1620773193'; + $importJob = new ImportJob(); + $importJobImportMethod = ImportMethod::IMPORT_METHOD_UNSPECIFIED; + $importJob->setImportMethod($importJobImportMethod); + $importJobProtectionLevel = ProtectionLevel::PROTECTION_LEVEL_UNSPECIFIED; + $importJob->setProtectionLevel($importJobProtectionLevel); + $request = (new CreateImportJobRequest()) + ->setParent($formattedParent) + ->setImportJobId($importJobId) + ->setImportJob($importJob); + try { + $gapicClient->createImportJob($request); + // 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 createKeyRingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new KeyRing(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $keyRingId = 'keyRingId-2056646742'; + $keyRing = new KeyRing(); + $request = (new CreateKeyRingRequest()) + ->setParent($formattedParent) + ->setKeyRingId($keyRingId) + ->setKeyRing($keyRing); + $response = $gapicClient->createKeyRing($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.kms.v1.KeyManagementService/CreateKeyRing', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getKeyRingId(); + $this->assertProtobufEquals($keyRingId, $actualValue); + $actualValue = $actualRequestObject->getKeyRing(); + $this->assertProtobufEquals($keyRing, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createKeyRingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $keyRingId = 'keyRingId-2056646742'; + $keyRing = new KeyRing(); + $request = (new CreateKeyRingRequest()) + ->setParent($formattedParent) + ->setKeyRingId($keyRingId) + ->setKeyRing($keyRing); + try { + $gapicClient->createKeyRing($request); + // 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 decryptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $plaintext = '-9'; + $usedPrimary = true; + $expectedResponse = new DecryptResponse(); + $expectedResponse->setPlaintext($plaintext); + $expectedResponse->setUsedPrimary($usedPrimary); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $ciphertext = '-72'; + $request = (new DecryptRequest()) + ->setName($formattedName) + ->setCiphertext($ciphertext); + $response = $gapicClient->decrypt($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.kms.v1.KeyManagementService/Decrypt', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getCiphertext(); + $this->assertProtobufEquals($ciphertext, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function decryptExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $ciphertext = '-72'; + $request = (new DecryptRequest()) + ->setName($formattedName) + ->setCiphertext($ciphertext); + try { + $gapicClient->decrypt($request); + // 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 destroyCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $importJob = 'importJob2125587491'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name2); + $expectedResponse->setImportJob($importJob); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $request = (new DestroyCryptoKeyVersionRequest()) + ->setName($formattedName); + $response = $gapicClient->destroyCryptoKeyVersion($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.kms.v1.KeyManagementService/DestroyCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function destroyCryptoKeyVersionExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $request = (new DestroyCryptoKeyVersionRequest()) + ->setName($formattedName); + try { + $gapicClient->destroyCryptoKeyVersion($request); + // 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 encryptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $ciphertext = '-72'; + $verifiedPlaintextCrc32c = false; + $verifiedAdditionalAuthenticatedDataCrc32c = true; + $expectedResponse = new EncryptResponse(); + $expectedResponse->setName($name2); + $expectedResponse->setCiphertext($ciphertext); + $expectedResponse->setVerifiedPlaintextCrc32c($verifiedPlaintextCrc32c); + $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $plaintext = '-9'; + $request = (new EncryptRequest()) + ->setName($name) + ->setPlaintext($plaintext); + $response = $gapicClient->encrypt($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.kms.v1.KeyManagementService/Encrypt', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getPlaintext(); + $this->assertProtobufEquals($plaintext, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function encryptExceptionTest() + { + $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 + $name = 'name3373707'; + $plaintext = '-9'; + $request = (new EncryptRequest()) + ->setName($name) + ->setPlaintext($plaintext); + try { + $gapicClient->encrypt($request); + // 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 generateRandomBytesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $data = '-86'; + $expectedResponse = new GenerateRandomBytesResponse(); + $expectedResponse->setData($data); + $transport->addResponse($expectedResponse); + $request = new GenerateRandomBytesRequest(); + $response = $gapicClient->generateRandomBytes($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.kms.v1.KeyManagementService/GenerateRandomBytes', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateRandomBytesExceptionTest() + { + $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); + $request = new GenerateRandomBytesRequest(); + try { + $gapicClient->generateRandomBytes($request); + // 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 getCryptoKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $importOnly = true; + $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; + $expectedResponse = new CryptoKey(); + $expectedResponse->setName($name2); + $expectedResponse->setImportOnly($importOnly); + $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $request = (new GetCryptoKeyRequest()) + ->setName($formattedName); + $response = $gapicClient->getCryptoKey($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.kms.v1.KeyManagementService/GetCryptoKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCryptoKeyExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $request = (new GetCryptoKeyRequest()) + ->setName($formattedName); + try { + $gapicClient->getCryptoKey($request); + // 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 getCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $importJob = 'importJob2125587491'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name2); + $expectedResponse->setImportJob($importJob); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $request = (new GetCryptoKeyVersionRequest()) + ->setName($formattedName); + $response = $gapicClient->getCryptoKeyVersion($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.kms.v1.KeyManagementService/GetCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCryptoKeyVersionExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $request = (new GetCryptoKeyVersionRequest()) + ->setName($formattedName); + try { + $gapicClient->getCryptoKeyVersion($request); + // 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 getImportJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new ImportJob(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->importJobName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[IMPORT_JOB]'); + $request = (new GetImportJobRequest()) + ->setName($formattedName); + $response = $gapicClient->getImportJob($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.kms.v1.KeyManagementService/GetImportJob', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getImportJobExceptionTest() + { + $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->importJobName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[IMPORT_JOB]'); + $request = (new GetImportJobRequest()) + ->setName($formattedName); + try { + $gapicClient->getImportJob($request); + // 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 getKeyRingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new KeyRing(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $request = (new GetKeyRingRequest()) + ->setName($formattedName); + $response = $gapicClient->getKeyRing($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.kms.v1.KeyManagementService/GetKeyRing', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getKeyRingExceptionTest() + { + $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $request = (new GetKeyRingRequest()) + ->setName($formattedName); + try { + $gapicClient->getKeyRing($request); + // 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 getPublicKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $pem = 'pem110872'; + $name2 = 'name2-1052831874'; + $expectedResponse = new PublicKey(); + $expectedResponse->setPem($pem); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $request = (new GetPublicKeyRequest()) + ->setName($formattedName); + $response = $gapicClient->getPublicKey($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.kms.v1.KeyManagementService/GetPublicKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getPublicKeyExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $request = (new GetPublicKeyRequest()) + ->setName($formattedName); + try { + $gapicClient->getPublicKey($request); + // 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 importCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $importJob2 = 'importJob2-1714851050'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name); + $expectedResponse->setImportJob($importJob2); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; + $importJob = 'importJob2125587491'; + $request = (new ImportCryptoKeyVersionRequest()) + ->setParent($formattedParent) + ->setAlgorithm($algorithm) + ->setImportJob($importJob); + $response = $gapicClient->importCryptoKeyVersion($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.kms.v1.KeyManagementService/ImportCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getAlgorithm(); + $this->assertProtobufEquals($algorithm, $actualValue); + $actualValue = $actualRequestObject->getImportJob(); + $this->assertProtobufEquals($importJob, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function importCryptoKeyVersionExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; + $importJob = 'importJob2125587491'; + $request = (new ImportCryptoKeyVersionRequest()) + ->setParent($formattedParent) + ->setAlgorithm($algorithm) + ->setImportJob($importJob); + try { + $gapicClient->importCryptoKeyVersion($request); + // 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 listCryptoKeyVersionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $cryptoKeyVersionsElement = new CryptoKeyVersion(); + $cryptoKeyVersions = [ + $cryptoKeyVersionsElement, + ]; + $expectedResponse = new ListCryptoKeyVersionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setCryptoKeyVersions($cryptoKeyVersions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $request = (new ListCryptoKeyVersionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listCryptoKeyVersions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCryptoKeyVersions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListCryptoKeyVersions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCryptoKeyVersionsExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $request = (new ListCryptoKeyVersionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listCryptoKeyVersions($request); + // 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 listCryptoKeysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $cryptoKeysElement = new CryptoKey(); + $cryptoKeys = [ + $cryptoKeysElement, + ]; + $expectedResponse = new ListCryptoKeysResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setCryptoKeys($cryptoKeys); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $request = (new ListCryptoKeysRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listCryptoKeys($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCryptoKeys()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListCryptoKeys', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCryptoKeysExceptionTest() + { + $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $request = (new ListCryptoKeysRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listCryptoKeys($request); + // 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 listImportJobsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $importJobsElement = new ImportJob(); + $importJobs = [ + $importJobsElement, + ]; + $expectedResponse = new ListImportJobsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setImportJobs($importJobs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $request = (new ListImportJobsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listImportJobs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getImportJobs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListImportJobs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listImportJobsExceptionTest() + { + $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $request = (new ListImportJobsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listImportJobs($request); + // 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 listKeyRingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $keyRingsElement = new KeyRing(); + $keyRings = [ + $keyRingsElement, + ]; + $expectedResponse = new ListKeyRingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setKeyRings($keyRings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListKeyRingsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listKeyRings($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getKeyRings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListKeyRings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listKeyRingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListKeyRingsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listKeyRings($request); + // 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 macSignTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $mac = '79'; + $verifiedDataCrc32c = true; + $expectedResponse = new MacSignResponse(); + $expectedResponse->setName($name2); + $expectedResponse->setMac($mac); + $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $data = '-86'; + $request = (new MacSignRequest()) + ->setName($formattedName) + ->setData($data); + $response = $gapicClient->macSign($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.kms.v1.KeyManagementService/MacSign', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getData(); + $this->assertProtobufEquals($data, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function macSignExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $data = '-86'; + $request = (new MacSignRequest()) + ->setName($formattedName) + ->setData($data); + try { + $gapicClient->macSign($request); + // 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 macVerifyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $success = false; + $verifiedDataCrc32c = true; + $verifiedMacCrc32c = false; + $verifiedSuccessIntegrity = true; + $expectedResponse = new MacVerifyResponse(); + $expectedResponse->setName($name2); + $expectedResponse->setSuccess($success); + $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); + $expectedResponse->setVerifiedMacCrc32c($verifiedMacCrc32c); + $expectedResponse->setVerifiedSuccessIntegrity($verifiedSuccessIntegrity); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $data = '-86'; + $mac = '79'; + $request = (new MacVerifyRequest()) + ->setName($formattedName) + ->setData($data) + ->setMac($mac); + $response = $gapicClient->macVerify($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.kms.v1.KeyManagementService/MacVerify', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getData(); + $this->assertProtobufEquals($data, $actualValue); + $actualValue = $actualRequestObject->getMac(); + $this->assertProtobufEquals($mac, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function macVerifyExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $data = '-86'; + $mac = '79'; + $request = (new MacVerifyRequest()) + ->setName($formattedName) + ->setData($data) + ->setMac($mac); + try { + $gapicClient->macVerify($request); + // 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 rawDecryptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $plaintext = '-9'; + $verifiedCiphertextCrc32c = true; + $verifiedAdditionalAuthenticatedDataCrc32c = true; + $verifiedInitializationVectorCrc32c = true; + $expectedResponse = new RawDecryptResponse(); + $expectedResponse->setPlaintext($plaintext); + $expectedResponse->setVerifiedCiphertextCrc32c($verifiedCiphertextCrc32c); + $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); + $expectedResponse->setVerifiedInitializationVectorCrc32c($verifiedInitializationVectorCrc32c); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $ciphertext = '-72'; + $initializationVector = '-62'; + $request = (new RawDecryptRequest()) + ->setName($name) + ->setCiphertext($ciphertext) + ->setInitializationVector($initializationVector); + $response = $gapicClient->rawDecrypt($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.kms.v1.KeyManagementService/RawDecrypt', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getCiphertext(); + $this->assertProtobufEquals($ciphertext, $actualValue); + $actualValue = $actualRequestObject->getInitializationVector(); + $this->assertProtobufEquals($initializationVector, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rawDecryptExceptionTest() + { + $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 + $name = 'name3373707'; + $ciphertext = '-72'; + $initializationVector = '-62'; + $request = (new RawDecryptRequest()) + ->setName($name) + ->setCiphertext($ciphertext) + ->setInitializationVector($initializationVector); + try { + $gapicClient->rawDecrypt($request); + // 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 rawEncryptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $ciphertext = '-72'; + $initializationVector2 = '-11'; + $tagLength = 172791595; + $verifiedPlaintextCrc32c = false; + $verifiedAdditionalAuthenticatedDataCrc32c = true; + $verifiedInitializationVectorCrc32c = true; + $name2 = 'name2-1052831874'; + $expectedResponse = new RawEncryptResponse(); + $expectedResponse->setCiphertext($ciphertext); + $expectedResponse->setInitializationVector($initializationVector2); + $expectedResponse->setTagLength($tagLength); + $expectedResponse->setVerifiedPlaintextCrc32c($verifiedPlaintextCrc32c); + $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); + $expectedResponse->setVerifiedInitializationVectorCrc32c($verifiedInitializationVectorCrc32c); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $plaintext = '-9'; + $request = (new RawEncryptRequest()) + ->setName($name) + ->setPlaintext($plaintext); + $response = $gapicClient->rawEncrypt($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.kms.v1.KeyManagementService/RawEncrypt', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getPlaintext(); + $this->assertProtobufEquals($plaintext, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rawEncryptExceptionTest() + { + $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 + $name = 'name3373707'; + $plaintext = '-9'; + $request = (new RawEncryptRequest()) + ->setName($name) + ->setPlaintext($plaintext); + try { + $gapicClient->rawEncrypt($request); + // 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 restoreCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $importJob = 'importJob2125587491'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name2); + $expectedResponse->setImportJob($importJob); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $request = (new RestoreCryptoKeyVersionRequest()) + ->setName($formattedName); + $response = $gapicClient->restoreCryptoKeyVersion($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.kms.v1.KeyManagementService/RestoreCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function restoreCryptoKeyVersionExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $request = (new RestoreCryptoKeyVersionRequest()) + ->setName($formattedName); + try { + $gapicClient->restoreCryptoKeyVersion($request); + // 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 updateCryptoKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $importOnly = true; + $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; + $expectedResponse = new CryptoKey(); + $expectedResponse->setName($name); + $expectedResponse->setImportOnly($importOnly); + $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); + $transport->addResponse($expectedResponse); + // Mock request + $cryptoKey = new CryptoKey(); + $updateMask = new FieldMask(); + $request = (new UpdateCryptoKeyRequest()) + ->setCryptoKey($cryptoKey) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateCryptoKey($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.kms.v1.KeyManagementService/UpdateCryptoKey', $actualFuncCall); + $actualValue = $actualRequestObject->getCryptoKey(); + $this->assertProtobufEquals($cryptoKey, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateCryptoKeyExceptionTest() + { + $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 + $cryptoKey = new CryptoKey(); + $updateMask = new FieldMask(); + $request = (new UpdateCryptoKeyRequest()) + ->setCryptoKey($cryptoKey) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateCryptoKey($request); + // 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 updateCryptoKeyPrimaryVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $importOnly = true; + $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; + $expectedResponse = new CryptoKey(); + $expectedResponse->setName($name2); + $expectedResponse->setImportOnly($importOnly); + $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $cryptoKeyVersionId = 'cryptoKeyVersionId729489152'; + $request = (new UpdateCryptoKeyPrimaryVersionRequest()) + ->setName($formattedName) + ->setCryptoKeyVersionId($cryptoKeyVersionId); + $response = $gapicClient->updateCryptoKeyPrimaryVersion($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.kms.v1.KeyManagementService/UpdateCryptoKeyPrimaryVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getCryptoKeyVersionId(); + $this->assertProtobufEquals($cryptoKeyVersionId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateCryptoKeyPrimaryVersionExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $cryptoKeyVersionId = 'cryptoKeyVersionId729489152'; + $request = (new UpdateCryptoKeyPrimaryVersionRequest()) + ->setName($formattedName) + ->setCryptoKeyVersionId($cryptoKeyVersionId); + try { + $gapicClient->updateCryptoKeyPrimaryVersion($request); + // 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 updateCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $importJob = 'importJob2125587491'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name); + $expectedResponse->setImportJob($importJob); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $cryptoKeyVersion = new CryptoKeyVersion(); + $updateMask = new FieldMask(); + $request = (new UpdateCryptoKeyVersionRequest()) + ->setCryptoKeyVersion($cryptoKeyVersion) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateCryptoKeyVersion($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.kms.v1.KeyManagementService/UpdateCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getCryptoKeyVersion(); + $this->assertProtobufEquals($cryptoKeyVersion, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateCryptoKeyVersionExceptionTest() + { + $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 + $cryptoKeyVersion = new CryptoKeyVersion(); + $updateMask = new FieldMask(); + $request = (new UpdateCryptoKeyVersionRequest()) + ->setCryptoKeyVersion($cryptoKeyVersion) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateCryptoKeyVersion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($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.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // 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 asymmetricDecryptAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $plaintext = '-9'; + $verifiedCiphertextCrc32c = true; + $expectedResponse = new AsymmetricDecryptResponse(); + $expectedResponse->setPlaintext($plaintext); + $expectedResponse->setVerifiedCiphertextCrc32c($verifiedCiphertextCrc32c); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $ciphertext = '-72'; + $request = (new AsymmetricDecryptRequest()) + ->setName($formattedName) + ->setCiphertext($ciphertext); + $response = $gapicClient->asymmetricDecryptAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/AsymmetricDecrypt', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getCiphertext(); + $this->assertProtobufEquals($ciphertext, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Kms/v1/tests/Unit/V1/EkmServiceClientTest.php b/owl-bot-staging/Kms/v1/tests/Unit/V1/EkmServiceClientTest.php new file mode 100644 index 000000000000..5b8208c26ee5 --- /dev/null +++ b/owl-bot-staging/Kms/v1/tests/Unit/V1/EkmServiceClientTest.php @@ -0,0 +1,839 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return EkmServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new EkmServiceClient($options); + } + + /** @test */ + public function createEkmConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $cryptoSpacePath = 'cryptoSpacePath-1229393412'; + $expectedResponse = new EkmConnection(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setCryptoSpacePath($cryptoSpacePath); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $ekmConnectionId = 'ekmConnectionId270499940'; + $ekmConnection = new EkmConnection(); + $response = $gapicClient->createEkmConnection($formattedParent, $ekmConnectionId, $ekmConnection); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.EkmService/CreateEkmConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getEkmConnectionId(); + $this->assertProtobufEquals($ekmConnectionId, $actualValue); + $actualValue = $actualRequestObject->getEkmConnection(); + $this->assertProtobufEquals($ekmConnection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createEkmConnectionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $ekmConnectionId = 'ekmConnectionId270499940'; + $ekmConnection = new EkmConnection(); + try { + $gapicClient->createEkmConnection($formattedParent, $ekmConnectionId, $ekmConnection); + // 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 getEkmConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $defaultEkmConnection = 'defaultEkmConnection1342549844'; + $expectedResponse = new EkmConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setDefaultEkmConnection($defaultEkmConnection); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->ekmConfigName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->getEkmConfig($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.kms.v1.EkmService/GetEkmConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEkmConfigExceptionTest() + { + $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->ekmConfigName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->getEkmConfig($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 getEkmConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $cryptoSpacePath = 'cryptoSpacePath-1229393412'; + $expectedResponse = new EkmConnection(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $expectedResponse->setCryptoSpacePath($cryptoSpacePath); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + $response = $gapicClient->getEkmConnection($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.kms.v1.EkmService/GetEkmConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEkmConnectionExceptionTest() + { + $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->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + try { + $gapicClient->getEkmConnection($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 listEkmConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $ekmConnectionsElement = new EkmConnection(); + $ekmConnections = [ + $ekmConnectionsElement, + ]; + $expectedResponse = new ListEkmConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setEkmConnections($ekmConnections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listEkmConnections($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEkmConnections()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.EkmService/ListEkmConnections', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEkmConnectionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listEkmConnections($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 updateEkmConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $defaultEkmConnection = 'defaultEkmConnection1342549844'; + $expectedResponse = new EkmConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDefaultEkmConnection($defaultEkmConnection); + $transport->addResponse($expectedResponse); + // Mock request + $ekmConfig = new EkmConfig(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateEkmConfig($ekmConfig, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.EkmService/UpdateEkmConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getEkmConfig(); + $this->assertProtobufEquals($ekmConfig, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEkmConfigExceptionTest() + { + $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 + $ekmConfig = new EkmConfig(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateEkmConfig($ekmConfig, $updateMask); + // 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 updateEkmConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $etag = 'etag3123477'; + $cryptoSpacePath = 'cryptoSpacePath-1229393412'; + $expectedResponse = new EkmConnection(); + $expectedResponse->setName($name); + $expectedResponse->setEtag($etag); + $expectedResponse->setCryptoSpacePath($cryptoSpacePath); + $transport->addResponse($expectedResponse); + // Mock request + $ekmConnection = new EkmConnection(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateEkmConnection($ekmConnection, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.EkmService/UpdateEkmConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getEkmConnection(); + $this->assertProtobufEquals($ekmConnection, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEkmConnectionExceptionTest() + { + $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 + $ekmConnection = new EkmConnection(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateEkmConnection($ekmConnection, $updateMask); + // 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 verifyConnectivityTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new VerifyConnectivityResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + $response = $gapicClient->verifyConnectivity($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.kms.v1.EkmService/VerifyConnectivity', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function verifyConnectivityExceptionTest() + { + $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->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); + try { + $gapicClient->verifyConnectivity($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 getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Kms/v1/tests/Unit/V1/KeyManagementServiceClientTest.php b/owl-bot-staging/Kms/v1/tests/Unit/V1/KeyManagementServiceClientTest.php new file mode 100644 index 000000000000..4422a7b80bcd --- /dev/null +++ b/owl-bot-staging/Kms/v1/tests/Unit/V1/KeyManagementServiceClientTest.php @@ -0,0 +1,2331 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return KeyManagementServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new KeyManagementServiceClient($options); + } + + /** @test */ + public function asymmetricDecryptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $plaintext = '-9'; + $verifiedCiphertextCrc32c = true; + $expectedResponse = new AsymmetricDecryptResponse(); + $expectedResponse->setPlaintext($plaintext); + $expectedResponse->setVerifiedCiphertextCrc32c($verifiedCiphertextCrc32c); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $ciphertext = '-72'; + $response = $gapicClient->asymmetricDecrypt($formattedName, $ciphertext); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/AsymmetricDecrypt', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getCiphertext(); + $this->assertProtobufEquals($ciphertext, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function asymmetricDecryptExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $ciphertext = '-72'; + try { + $gapicClient->asymmetricDecrypt($formattedName, $ciphertext); + // 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 asymmetricSignTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $signature = '-72'; + $verifiedDigestCrc32c = true; + $name2 = 'name2-1052831874'; + $verifiedDataCrc32c = true; + $expectedResponse = new AsymmetricSignResponse(); + $expectedResponse->setSignature($signature); + $expectedResponse->setVerifiedDigestCrc32c($verifiedDigestCrc32c); + $expectedResponse->setName($name2); + $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $digest = new Digest(); + $response = $gapicClient->asymmetricSign($formattedName, $digest); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/AsymmetricSign', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getDigest(); + $this->assertProtobufEquals($digest, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function asymmetricSignExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $digest = new Digest(); + try { + $gapicClient->asymmetricSign($formattedName, $digest); + // 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 createCryptoKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $importOnly = true; + $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; + $expectedResponse = new CryptoKey(); + $expectedResponse->setName($name); + $expectedResponse->setImportOnly($importOnly); + $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $cryptoKeyId = 'cryptoKeyId-2123094983'; + $cryptoKey = new CryptoKey(); + $response = $gapicClient->createCryptoKey($formattedParent, $cryptoKeyId, $cryptoKey); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/CreateCryptoKey', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getCryptoKeyId(); + $this->assertProtobufEquals($cryptoKeyId, $actualValue); + $actualValue = $actualRequestObject->getCryptoKey(); + $this->assertProtobufEquals($cryptoKey, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createCryptoKeyExceptionTest() + { + $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $cryptoKeyId = 'cryptoKeyId-2123094983'; + $cryptoKey = new CryptoKey(); + try { + $gapicClient->createCryptoKey($formattedParent, $cryptoKeyId, $cryptoKey); + // 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 createCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $importJob = 'importJob2125587491'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name); + $expectedResponse->setImportJob($importJob); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $cryptoKeyVersion = new CryptoKeyVersion(); + $response = $gapicClient->createCryptoKeyVersion($formattedParent, $cryptoKeyVersion); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/CreateCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getCryptoKeyVersion(); + $this->assertProtobufEquals($cryptoKeyVersion, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createCryptoKeyVersionExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $cryptoKeyVersion = new CryptoKeyVersion(); + try { + $gapicClient->createCryptoKeyVersion($formattedParent, $cryptoKeyVersion); + // 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 createImportJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new ImportJob(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $importJobId = 'importJobId-1620773193'; + $importJob = new ImportJob(); + $importJobImportMethod = ImportMethod::IMPORT_METHOD_UNSPECIFIED; + $importJob->setImportMethod($importJobImportMethod); + $importJobProtectionLevel = ProtectionLevel::PROTECTION_LEVEL_UNSPECIFIED; + $importJob->setProtectionLevel($importJobProtectionLevel); + $response = $gapicClient->createImportJob($formattedParent, $importJobId, $importJob); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/CreateImportJob', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getImportJobId(); + $this->assertProtobufEquals($importJobId, $actualValue); + $actualValue = $actualRequestObject->getImportJob(); + $this->assertProtobufEquals($importJob, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createImportJobExceptionTest() + { + $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $importJobId = 'importJobId-1620773193'; + $importJob = new ImportJob(); + $importJobImportMethod = ImportMethod::IMPORT_METHOD_UNSPECIFIED; + $importJob->setImportMethod($importJobImportMethod); + $importJobProtectionLevel = ProtectionLevel::PROTECTION_LEVEL_UNSPECIFIED; + $importJob->setProtectionLevel($importJobProtectionLevel); + try { + $gapicClient->createImportJob($formattedParent, $importJobId, $importJob); + // 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 createKeyRingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new KeyRing(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $keyRingId = 'keyRingId-2056646742'; + $keyRing = new KeyRing(); + $response = $gapicClient->createKeyRing($formattedParent, $keyRingId, $keyRing); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/CreateKeyRing', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getKeyRingId(); + $this->assertProtobufEquals($keyRingId, $actualValue); + $actualValue = $actualRequestObject->getKeyRing(); + $this->assertProtobufEquals($keyRing, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createKeyRingExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $keyRingId = 'keyRingId-2056646742'; + $keyRing = new KeyRing(); + try { + $gapicClient->createKeyRing($formattedParent, $keyRingId, $keyRing); + // 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 decryptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $plaintext = '-9'; + $usedPrimary = true; + $expectedResponse = new DecryptResponse(); + $expectedResponse->setPlaintext($plaintext); + $expectedResponse->setUsedPrimary($usedPrimary); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $ciphertext = '-72'; + $response = $gapicClient->decrypt($formattedName, $ciphertext); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/Decrypt', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getCiphertext(); + $this->assertProtobufEquals($ciphertext, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function decryptExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $ciphertext = '-72'; + try { + $gapicClient->decrypt($formattedName, $ciphertext); + // 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 destroyCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $importJob = 'importJob2125587491'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name2); + $expectedResponse->setImportJob($importJob); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $response = $gapicClient->destroyCryptoKeyVersion($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.kms.v1.KeyManagementService/DestroyCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function destroyCryptoKeyVersionExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + try { + $gapicClient->destroyCryptoKeyVersion($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 encryptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $ciphertext = '-72'; + $verifiedPlaintextCrc32c = false; + $verifiedAdditionalAuthenticatedDataCrc32c = true; + $expectedResponse = new EncryptResponse(); + $expectedResponse->setName($name2); + $expectedResponse->setCiphertext($ciphertext); + $expectedResponse->setVerifiedPlaintextCrc32c($verifiedPlaintextCrc32c); + $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $plaintext = '-9'; + $response = $gapicClient->encrypt($name, $plaintext); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/Encrypt', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getPlaintext(); + $this->assertProtobufEquals($plaintext, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function encryptExceptionTest() + { + $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 + $name = 'name3373707'; + $plaintext = '-9'; + try { + $gapicClient->encrypt($name, $plaintext); + // 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 generateRandomBytesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $data = '-86'; + $expectedResponse = new GenerateRandomBytesResponse(); + $expectedResponse->setData($data); + $transport->addResponse($expectedResponse); + $response = $gapicClient->generateRandomBytes(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/GenerateRandomBytes', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateRandomBytesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->generateRandomBytes(); + // 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 getCryptoKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $importOnly = true; + $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; + $expectedResponse = new CryptoKey(); + $expectedResponse->setName($name2); + $expectedResponse->setImportOnly($importOnly); + $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $response = $gapicClient->getCryptoKey($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.kms.v1.KeyManagementService/GetCryptoKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCryptoKeyExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + try { + $gapicClient->getCryptoKey($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 getCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $importJob = 'importJob2125587491'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name2); + $expectedResponse->setImportJob($importJob); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $response = $gapicClient->getCryptoKeyVersion($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.kms.v1.KeyManagementService/GetCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCryptoKeyVersionExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + try { + $gapicClient->getCryptoKeyVersion($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 getImportJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new ImportJob(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->importJobName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[IMPORT_JOB]'); + $response = $gapicClient->getImportJob($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.kms.v1.KeyManagementService/GetImportJob', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getImportJobExceptionTest() + { + $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->importJobName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[IMPORT_JOB]'); + try { + $gapicClient->getImportJob($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 getKeyRingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new KeyRing(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $response = $gapicClient->getKeyRing($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.kms.v1.KeyManagementService/GetKeyRing', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getKeyRingExceptionTest() + { + $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + try { + $gapicClient->getKeyRing($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 getPublicKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $pem = 'pem110872'; + $name2 = 'name2-1052831874'; + $expectedResponse = new PublicKey(); + $expectedResponse->setPem($pem); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $response = $gapicClient->getPublicKey($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.kms.v1.KeyManagementService/GetPublicKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getPublicKeyExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + try { + $gapicClient->getPublicKey($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 importCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $importJob2 = 'importJob2-1714851050'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name); + $expectedResponse->setImportJob($importJob2); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; + $importJob = 'importJob2125587491'; + $response = $gapicClient->importCryptoKeyVersion($formattedParent, $algorithm, $importJob); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ImportCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getAlgorithm(); + $this->assertProtobufEquals($algorithm, $actualValue); + $actualValue = $actualRequestObject->getImportJob(); + $this->assertProtobufEquals($importJob, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function importCryptoKeyVersionExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; + $importJob = 'importJob2125587491'; + try { + $gapicClient->importCryptoKeyVersion($formattedParent, $algorithm, $importJob); + // 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 listCryptoKeyVersionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $cryptoKeyVersionsElement = new CryptoKeyVersion(); + $cryptoKeyVersions = [ + $cryptoKeyVersionsElement, + ]; + $expectedResponse = new ListCryptoKeyVersionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setCryptoKeyVersions($cryptoKeyVersions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $response = $gapicClient->listCryptoKeyVersions($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCryptoKeyVersions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListCryptoKeyVersions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCryptoKeyVersionsExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + try { + $gapicClient->listCryptoKeyVersions($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 listCryptoKeysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $cryptoKeysElement = new CryptoKey(); + $cryptoKeys = [ + $cryptoKeysElement, + ]; + $expectedResponse = new ListCryptoKeysResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setCryptoKeys($cryptoKeys); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $response = $gapicClient->listCryptoKeys($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCryptoKeys()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListCryptoKeys', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCryptoKeysExceptionTest() + { + $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + try { + $gapicClient->listCryptoKeys($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 listImportJobsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $importJobsElement = new ImportJob(); + $importJobs = [ + $importJobsElement, + ]; + $expectedResponse = new ListImportJobsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setImportJobs($importJobs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + $response = $gapicClient->listImportJobs($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getImportJobs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListImportJobs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listImportJobsExceptionTest() + { + $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); + try { + $gapicClient->listImportJobs($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 listKeyRingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $keyRingsElement = new KeyRing(); + $keyRings = [ + $keyRingsElement, + ]; + $expectedResponse = new ListKeyRingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setKeyRings($keyRings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listKeyRings($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getKeyRings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListKeyRings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listKeyRingsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listKeyRings($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 macSignTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $mac = '79'; + $verifiedDataCrc32c = true; + $expectedResponse = new MacSignResponse(); + $expectedResponse->setName($name2); + $expectedResponse->setMac($mac); + $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $data = '-86'; + $response = $gapicClient->macSign($formattedName, $data); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/MacSign', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getData(); + $this->assertProtobufEquals($data, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function macSignExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $data = '-86'; + try { + $gapicClient->macSign($formattedName, $data); + // 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 macVerifyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $success = false; + $verifiedDataCrc32c = true; + $verifiedMacCrc32c = false; + $verifiedSuccessIntegrity = true; + $expectedResponse = new MacVerifyResponse(); + $expectedResponse->setName($name2); + $expectedResponse->setSuccess($success); + $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); + $expectedResponse->setVerifiedMacCrc32c($verifiedMacCrc32c); + $expectedResponse->setVerifiedSuccessIntegrity($verifiedSuccessIntegrity); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $data = '-86'; + $mac = '79'; + $response = $gapicClient->macVerify($formattedName, $data, $mac); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/MacVerify', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getData(); + $this->assertProtobufEquals($data, $actualValue); + $actualValue = $actualRequestObject->getMac(); + $this->assertProtobufEquals($mac, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function macVerifyExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $data = '-86'; + $mac = '79'; + try { + $gapicClient->macVerify($formattedName, $data, $mac); + // 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 rawDecryptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $plaintext = '-9'; + $verifiedCiphertextCrc32c = true; + $verifiedAdditionalAuthenticatedDataCrc32c = true; + $verifiedInitializationVectorCrc32c = true; + $expectedResponse = new RawDecryptResponse(); + $expectedResponse->setPlaintext($plaintext); + $expectedResponse->setVerifiedCiphertextCrc32c($verifiedCiphertextCrc32c); + $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); + $expectedResponse->setVerifiedInitializationVectorCrc32c($verifiedInitializationVectorCrc32c); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $ciphertext = '-72'; + $initializationVector = '-62'; + $response = $gapicClient->rawDecrypt($name, $ciphertext, $initializationVector); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/RawDecrypt', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getCiphertext(); + $this->assertProtobufEquals($ciphertext, $actualValue); + $actualValue = $actualRequestObject->getInitializationVector(); + $this->assertProtobufEquals($initializationVector, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rawDecryptExceptionTest() + { + $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 + $name = 'name3373707'; + $ciphertext = '-72'; + $initializationVector = '-62'; + try { + $gapicClient->rawDecrypt($name, $ciphertext, $initializationVector); + // 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 rawEncryptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $ciphertext = '-72'; + $initializationVector2 = '-11'; + $tagLength = 172791595; + $verifiedPlaintextCrc32c = false; + $verifiedAdditionalAuthenticatedDataCrc32c = true; + $verifiedInitializationVectorCrc32c = true; + $name2 = 'name2-1052831874'; + $expectedResponse = new RawEncryptResponse(); + $expectedResponse->setCiphertext($ciphertext); + $expectedResponse->setInitializationVector($initializationVector2); + $expectedResponse->setTagLength($tagLength); + $expectedResponse->setVerifiedPlaintextCrc32c($verifiedPlaintextCrc32c); + $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); + $expectedResponse->setVerifiedInitializationVectorCrc32c($verifiedInitializationVectorCrc32c); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $plaintext = '-9'; + $response = $gapicClient->rawEncrypt($name, $plaintext); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/RawEncrypt', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getPlaintext(); + $this->assertProtobufEquals($plaintext, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rawEncryptExceptionTest() + { + $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 + $name = 'name3373707'; + $plaintext = '-9'; + try { + $gapicClient->rawEncrypt($name, $plaintext); + // 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 restoreCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $importJob = 'importJob2125587491'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name2); + $expectedResponse->setImportJob($importJob); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + $response = $gapicClient->restoreCryptoKeyVersion($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.kms.v1.KeyManagementService/RestoreCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function restoreCryptoKeyVersionExceptionTest() + { + $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); + try { + $gapicClient->restoreCryptoKeyVersion($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 updateCryptoKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $importOnly = true; + $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; + $expectedResponse = new CryptoKey(); + $expectedResponse->setName($name); + $expectedResponse->setImportOnly($importOnly); + $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); + $transport->addResponse($expectedResponse); + // Mock request + $cryptoKey = new CryptoKey(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateCryptoKey($cryptoKey, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKey', $actualFuncCall); + $actualValue = $actualRequestObject->getCryptoKey(); + $this->assertProtobufEquals($cryptoKey, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateCryptoKeyExceptionTest() + { + $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 + $cryptoKey = new CryptoKey(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateCryptoKey($cryptoKey, $updateMask); + // 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 updateCryptoKeyPrimaryVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $importOnly = true; + $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; + $expectedResponse = new CryptoKey(); + $expectedResponse->setName($name2); + $expectedResponse->setImportOnly($importOnly); + $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $cryptoKeyVersionId = 'cryptoKeyVersionId729489152'; + $response = $gapicClient->updateCryptoKeyPrimaryVersion($formattedName, $cryptoKeyVersionId); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKeyPrimaryVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getCryptoKeyVersionId(); + $this->assertProtobufEquals($cryptoKeyVersionId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateCryptoKeyPrimaryVersionExceptionTest() + { + $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); + $cryptoKeyVersionId = 'cryptoKeyVersionId729489152'; + try { + $gapicClient->updateCryptoKeyPrimaryVersion($formattedName, $cryptoKeyVersionId); + // 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 updateCryptoKeyVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $importJob = 'importJob2125587491'; + $importFailureReason = 'importFailureReason-494073229'; + $generationFailureReason = 'generationFailureReason1749803168'; + $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; + $reimportEligible = true; + $expectedResponse = new CryptoKeyVersion(); + $expectedResponse->setName($name); + $expectedResponse->setImportJob($importJob); + $expectedResponse->setImportFailureReason($importFailureReason); + $expectedResponse->setGenerationFailureReason($generationFailureReason); + $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); + $expectedResponse->setReimportEligible($reimportEligible); + $transport->addResponse($expectedResponse); + // Mock request + $cryptoKeyVersion = new CryptoKeyVersion(); + $updateMask = new FieldMask(); + $response = $gapicClient->updateCryptoKeyVersion($cryptoKeyVersion, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKeyVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getCryptoKeyVersion(); + $this->assertProtobufEquals($cryptoKeyVersion, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateCryptoKeyVersionExceptionTest() + { + $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 + $cryptoKeyVersion = new CryptoKeyVersion(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateCryptoKeyVersion($cryptoKeyVersion, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} From 1a091f590498c2649ec979246e1371bb5886398f Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 16 Apr 2024 21:05:20 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- Kms/src/V1/PublicKey.php | 76 +- .../Google/Cloud/Kms/V1/EkmService.php | Bin 5222 -> 0 bytes .../Google/Cloud/Kms/V1/Resources.php | Bin 7052 -> 0 bytes .../Google/Cloud/Kms/V1/Service.php | Bin 15249 -> 0 bytes .../Cloud/Kms/V1/AsymmetricDecryptRequest.php | 317 -- .../Kms/V1/AsymmetricDecryptResponse.php | 339 -- .../Cloud/Kms/V1/AsymmetricSignRequest.php | 568 ---- .../Cloud/Kms/V1/AsymmetricSignResponse.php | 463 --- .../src/Google/Cloud/Kms/V1/Certificate.php | 388 --- .../Cloud/Kms/V1/CreateCryptoKeyRequest.php | 241 -- .../Kms/V1/CreateCryptoKeyVersionRequest.php | 143 - .../Kms/V1/CreateEkmConnectionRequest.php | 184 -- .../Cloud/Kms/V1/CreateImportJobRequest.php | 184 -- .../Cloud/Kms/V1/CreateKeyRingRequest.php | 184 -- .../src/Google/Cloud/Kms/V1/CryptoKey.php | 676 ---- .../Kms/V1/CryptoKey/CryptoKeyPurpose.php | 104 - .../Google/Cloud/Kms/V1/CryptoKeyVersion.php | 819 ----- .../CryptoKeyVersionAlgorithm.php | 328 -- .../CryptoKeyVersionState.php | 154 - .../CryptoKeyVersion/CryptoKeyVersionView.php | 67 - .../Cloud/Kms/V1/CryptoKeyVersionTemplate.php | 150 - .../Google/Cloud/Kms/V1/DecryptRequest.php | 529 --- .../Google/Cloud/Kms/V1/DecryptResponse.php | 315 -- .../Kms/V1/DestroyCryptoKeyVersionRequest.php | 87 - .../proto/src/Google/Cloud/Kms/V1/Digest.php | 141 - .../src/Google/Cloud/Kms/V1/EkmConfig.php | 123 - .../src/Google/Cloud/Kms/V1/EkmConnection.php | 314 -- .../V1/EkmConnection/KeyManagementMode.php | 90 - .../Kms/V1/EkmConnection/ServiceResolver.php | 206 -- .../Google/Cloud/Kms/V1/EncryptRequest.php | 625 ---- .../Google/Cloud/Kms/V1/EncryptResponse.php | 471 --- .../Kms/V1/ExternalProtectionLevelOptions.php | 122 - .../Kms/V1/GenerateRandomBytesRequest.php | 179 -- .../Kms/V1/GenerateRandomBytesResponse.php | 211 -- .../Cloud/Kms/V1/GetCryptoKeyRequest.php | 87 - .../Kms/V1/GetCryptoKeyVersionRequest.php | 87 - .../Cloud/Kms/V1/GetEkmConfigRequest.php | 87 - .../Cloud/Kms/V1/GetEkmConnectionRequest.php | 87 - .../Cloud/Kms/V1/GetImportJobRequest.php | 87 - .../Google/Cloud/Kms/V1/GetKeyRingRequest.php | 87 - .../Cloud/Kms/V1/GetPublicKeyRequest.php | 87 - .../Kms/V1/ImportCryptoKeyVersionRequest.php | 491 --- .../src/Google/Cloud/Kms/V1/ImportJob.php | 549 ---- .../Cloud/Kms/V1/ImportJob/ImportJobState.php | 79 - .../Cloud/Kms/V1/ImportJob/ImportMethod.php | 120 - .../Kms/V1/ImportJob/WrappingPublicKey.php | 88 - .../Cloud/Kms/V1/KeyOperationAttestation.php | 151 - .../AttestationFormat.php | 68 - .../CertificateChains.php | 140 - .../proto/src/Google/Cloud/Kms/V1/KeyRing.php | 124 - .../Kms/V1/ListCryptoKeyVersionsRequest.php | 314 -- .../Kms/V1/ListCryptoKeyVersionsResponse.php | 152 - .../Cloud/Kms/V1/ListCryptoKeysRequest.php | 309 -- .../Cloud/Kms/V1/ListCryptoKeysResponse.php | 148 - .../Kms/V1/ListEkmConnectionsRequest.php | 280 -- .../Kms/V1/ListEkmConnectionsResponse.php | 148 - .../Cloud/Kms/V1/ListImportJobsRequest.php | 275 -- .../Cloud/Kms/V1/ListImportJobsResponse.php | 148 - .../Cloud/Kms/V1/ListKeyRingsRequest.php | 280 -- .../Cloud/Kms/V1/ListKeyRingsResponse.php | 148 - .../Google/Cloud/Kms/V1/LocationMetadata.php | 126 - .../Google/Cloud/Kms/V1/MacSignRequest.php | 300 -- .../Google/Cloud/Kms/V1/MacSignResponse.php | 377 --- .../Google/Cloud/Kms/V1/MacVerifyRequest.php | 508 --- .../Google/Cloud/Kms/V1/MacVerifyResponse.php | 386 --- .../Google/Cloud/Kms/V1/ProtectionLevel.php | 77 - .../src/Google/Cloud/Kms/V1/PublicKey.php | 354 -- .../Google/Cloud/Kms/V1/RawDecryptRequest.php | 707 ---- .../Cloud/Kms/V1/RawDecryptResponse.php | 511 --- .../Google/Cloud/Kms/V1/RawEncryptRequest.php | 743 ----- .../Cloud/Kms/V1/RawEncryptResponse.php | 744 ----- .../Kms/V1/RestoreCryptoKeyVersionRequest.php | 87 - .../UpdateCryptoKeyPrimaryVersionRequest.php | 128 - .../Cloud/Kms/V1/UpdateCryptoKeyRequest.php | 137 - .../Kms/V1/UpdateCryptoKeyVersionRequest.php | 142 - .../Cloud/Kms/V1/UpdateEkmConfigRequest.php | 137 - .../Kms/V1/UpdateEkmConnectionRequest.php | 142 - .../Kms/V1/VerifyConnectivityRequest.php | 87 - .../Kms/V1/VerifyConnectivityResponse.php | 34 - .../create_ekm_connection.php | 80 - .../V1/EkmServiceClient/get_ekm_config.php | 73 - .../EkmServiceClient/get_ekm_connection.php | 73 - .../V1/EkmServiceClient/get_iam_policy.php | 72 - .../V1/EkmServiceClient/get_location.php | 57 - .../EkmServiceClient/list_ekm_connections.php | 78 - .../V1/EkmServiceClient/list_locations.php | 62 - .../V1/EkmServiceClient/set_iam_policy.php | 77 - .../EkmServiceClient/test_iam_permissions.php | 84 - .../V1/EkmServiceClient/update_ekm_config.php | 63 - .../update_ekm_connection.php | 62 - .../EkmServiceClient/verify_connectivity.php | 76 - .../asymmetric_decrypt.php | 88 - .../asymmetric_sign.php | 86 - .../create_crypto_key.php | 83 - .../create_crypto_key_version.php | 85 - .../create_import_job.php | 106 - .../create_key_ring.php | 80 - .../V1/KeyManagementServiceClient/decrypt.php | 85 - .../destroy_crypto_key_version.php | 98 - .../V1/KeyManagementServiceClient/encrypt.php | 92 - .../generate_random_bytes.php | 58 - .../get_crypto_key.php | 79 - .../get_crypto_key_version.php | 79 - .../get_iam_policy.php | 72 - .../get_import_job.php | 77 - .../get_key_ring.php | 72 - .../get_location.php | 57 - .../get_public_key.php | 83 - .../import_crypto_key_version.php | 103 - .../list_crypto_key_versions.php | 83 - .../list_crypto_keys.php | 77 - .../list_import_jobs.php | 77 - .../list_key_rings.php | 78 - .../list_locations.php | 62 - .../KeyManagementServiceClient/mac_sign.php | 85 - .../KeyManagementServiceClient/mac_verify.php | 90 - .../raw_decrypt.php | 84 - .../raw_encrypt.php | 88 - .../restore_crypto_key_version.php | 86 - .../set_iam_policy.php | 77 - .../test_iam_permissions.php | 84 - .../update_crypto_key.php | 62 - .../update_crypto_key_primary_version.php | 88 - .../update_crypto_key_version.php | 73 - .../Kms/v1/src/V1/Client/EkmServiceClient.php | 635 ---- .../V1/Client/KeyManagementServiceClient.php | 1374 -------- .../Kms/v1/src/V1/EkmServiceClient.php | 34 - .../v1/src/V1/Gapic/EkmServiceGapicClient.php | 1003 ------ .../Gapic/KeyManagementServiceGapicClient.php | 2841 ----------------- .../v1/src/V1/KeyManagementServiceClient.php | 34 - .../Kms/v1/src/V1/gapic_metadata.json | 252 -- .../resources/ekm_service_client_config.json | 86 - .../ekm_service_descriptor_config.php | 201 -- .../ekm_service_rest_client_config.php | 243 -- .../key_management_service_client_config.json | 191 -- ...y_management_service_descriptor_config.php | 478 --- ..._management_service_rest_client_config.php | 496 --- .../Unit/V1/Client/EkmServiceClientTest.php | 948 ------ .../Client/KeyManagementServiceClientTest.php | 2573 --------------- .../v1/tests/Unit/V1/EkmServiceClientTest.php | 839 ----- .../V1/KeyManagementServiceClientTest.php | 2331 -------------- 141 files changed, 28 insertions(+), 37211 deletions(-) delete mode 100644 owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/EkmService.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Resources.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Service.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Certificate.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyVersionRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateEkmConnectionRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateImportJobRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateKeyRingRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey/CryptoKeyPurpose.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionState.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionView.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersionTemplate.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DestroyCryptoKeyVersionRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Digest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConfig.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/KeyManagementMode.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/ServiceResolver.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ExternalProtectionLevelOptions.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyVersionRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConfigRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConnectionRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetImportJobRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetKeyRingRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetPublicKeyRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportCryptoKeyVersionRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportJobState.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportMethod.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/WrappingPublicKey.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/AttestationFormat.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/CertificateChains.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyRing.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/LocationMetadata.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ProtectionLevel.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/PublicKey.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptResponse.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RestoreCryptoKeyVersionRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyPrimaryVersionRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyVersionRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConfigRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConnectionRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityRequest.php delete mode 100644 owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityResponse.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/create_ekm_connection.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_config.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_connection.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_iam_policy.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_location.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_ekm_connections.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_locations.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/set_iam_policy.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_config.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_connection.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/verify_connectivity.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_decrypt.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_sign.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key_version.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_import_job.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_key_ring.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/decrypt.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/destroy_crypto_key_version.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/encrypt.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/generate_random_bytes.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key_version.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_iam_policy.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_import_job.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_key_ring.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_location.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_public_key.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/import_crypto_key_version.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_key_versions.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_keys.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_import_jobs.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_key_rings.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_locations.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_sign.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_verify.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_decrypt.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_encrypt.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/restore_crypto_key_version.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/set_iam_policy.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_primary_version.php delete mode 100644 owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_version.php delete mode 100644 owl-bot-staging/Kms/v1/src/V1/Client/EkmServiceClient.php delete mode 100644 owl-bot-staging/Kms/v1/src/V1/Client/KeyManagementServiceClient.php delete mode 100644 owl-bot-staging/Kms/v1/src/V1/EkmServiceClient.php delete mode 100644 owl-bot-staging/Kms/v1/src/V1/Gapic/EkmServiceGapicClient.php delete mode 100644 owl-bot-staging/Kms/v1/src/V1/Gapic/KeyManagementServiceGapicClient.php delete mode 100644 owl-bot-staging/Kms/v1/src/V1/KeyManagementServiceClient.php delete mode 100644 owl-bot-staging/Kms/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_client_config.json delete mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_descriptor_config.php delete mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_rest_client_config.php delete mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_client_config.json delete mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_descriptor_config.php delete mode 100644 owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_rest_client_config.php delete mode 100644 owl-bot-staging/Kms/v1/tests/Unit/V1/Client/EkmServiceClientTest.php delete mode 100644 owl-bot-staging/Kms/v1/tests/Unit/V1/Client/KeyManagementServiceClientTest.php delete mode 100644 owl-bot-staging/Kms/v1/tests/Unit/V1/EkmServiceClientTest.php delete mode 100644 owl-bot-staging/Kms/v1/tests/Unit/V1/KeyManagementServiceClientTest.php diff --git a/Kms/src/V1/PublicKey.php b/Kms/src/V1/PublicKey.php index b02369ca8c8f..89ac65e6a3b6 100644 --- a/Kms/src/V1/PublicKey.php +++ b/Kms/src/V1/PublicKey.php @@ -18,12 +18,10 @@ class PublicKey extends \Google\Protobuf\Internal\Message { /** - * A public key encoded in PEM format, populated only when - * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * returns one key. For more information, see the [RFC - * 7468](https://tools.ietf.org/html/rfc7468) sections for [General - * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and [Textual - * Encoding of Subject Public Key Info] + * The public key, encoded in PEM format. For more information, see the + * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for + * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] * (https://tools.ietf.org/html/rfc7468#section-13). * * Generated from protobuf field string pem = 1; @@ -38,10 +36,8 @@ class PublicKey extends \Google\Protobuf\Internal\Message */ private $algorithm = 0; /** - * Integrity verification field: A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. It is only populated - * when [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * returns one key. An integrity check of + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by * computing the CRC32C checksum of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your @@ -81,22 +77,18 @@ class PublicKey extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $pem - * A public key encoded in PEM format, populated only when - * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * returns one key. For more information, see the [RFC - * 7468](https://tools.ietf.org/html/rfc7468) sections for [General - * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and [Textual - * Encoding of Subject Public Key Info] + * The public key, encoded in PEM format. For more information, see the + * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for + * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] * (https://tools.ietf.org/html/rfc7468#section-13). * @type int $algorithm * The * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] * associated with this key. * @type \Google\Protobuf\Int64Value $pem_crc32c - * Integrity verification field: A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. It is only populated - * when [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * returns one key. An integrity check of + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by * computing the CRC32C checksum of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your @@ -124,12 +116,10 @@ public function __construct($data = NULL) { } /** - * A public key encoded in PEM format, populated only when - * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * returns one key. For more information, see the [RFC - * 7468](https://tools.ietf.org/html/rfc7468) sections for [General - * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and [Textual - * Encoding of Subject Public Key Info] + * The public key, encoded in PEM format. For more information, see the + * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for + * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] * (https://tools.ietf.org/html/rfc7468#section-13). * * Generated from protobuf field string pem = 1; @@ -141,12 +131,10 @@ public function getPem() } /** - * A public key encoded in PEM format, populated only when - * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * returns one key. For more information, see the [RFC - * 7468](https://tools.ietf.org/html/rfc7468) sections for [General - * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and [Textual - * Encoding of Subject Public Key Info] + * The public key, encoded in PEM format. For more information, see the + * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for + * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + * [Textual Encoding of Subject Public Key Info] * (https://tools.ietf.org/html/rfc7468#section-13). * * Generated from protobuf field string pem = 1; @@ -192,10 +180,8 @@ public function setAlgorithm($var) } /** - * Integrity verification field: A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. It is only populated - * when [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * returns one key. An integrity check of + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by * computing the CRC32C checksum of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your @@ -229,10 +215,8 @@ public function clearPemCrc32C() /** * Returns the unboxed value from getPemCrc32C() - * Integrity verification field: A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. It is only populated - * when [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * returns one key. An integrity check of + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by * computing the CRC32C checksum of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your @@ -254,10 +238,8 @@ public function getPemCrc32CValue() } /** - * Integrity verification field: A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. It is only populated - * when [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * returns one key. An integrity check of + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by * computing the CRC32C checksum of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your @@ -285,10 +267,8 @@ public function setPemCrc32C($var) /** * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - * Integrity verification field: A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. It is only populated - * when [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * returns one key. An integrity check of + * Integrity verification field. A CRC32C checksum of the returned + * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by * computing the CRC32C checksum of * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your diff --git a/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/EkmService.php b/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/EkmService.php deleted file mode 100644 index 1a0843690b3abf4357ce248ef991af89881cd466..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5222 zcmbtY&u<$=6lR?^Z6^JZOrS}u(r(>WP14j>OliTPR2#>Qs?UIB-Gb2Db=Mg*fFeKt1thc6PICZ(67AAzh8%y#3zy-uve5 zym#B#bkIe4fmp=VD5=TSZJBNo*>P=Z>$WLZoAo+zW!-K#hDqG4EYB~?OUr9=Y5wlo z1=#A@O;;xcdBe6hOp?=0yIIR^HN0GFCP%g!sz=)cK8mqn!w1Z^$=QOLPq01iCDExQH@KnPxsG*t0 z=McaxxvrTWf$iP4^`@m$!?t9$VcF8j#H8%|WVV+a8v?#12WVCp2M~Ydu0@G!X=Y`f zc)Dvi)OJ_Ev{2X}G-QsgOiYT`GIvH@p71di3SA&?$<%F<=-Xx4CA8^Uvm7^b&<>v} z30x_TQBf?*W-Qp2S19bqwD01ejYZQS7CqdaI|eapb7WI%8Mb@4t@nwjlAb|^-1E1V zHE*l;H->xH45&4#HJs$VJm1&eH$--oS}jcG9jNt*kbahoD`@Wmy4+Kd;}PF1%X=XU zy^w9qq({YG%`u=!82x@rq|Zlws56e$svubyj7JPy!KC;p=sMn9P^vlKK?C^e@E%&w zfE3>#^Mi!O?-?G2HY?heMRK z8#}VU_y#&|yEWpf)$OsP;d16{38j-zdk*vh!L#Tz(;j_4Ai&=@F__N?xUt-1W3dCk z(-!%Rsu7e7{s6`ZQRp|*4~Zc^npsDq3nWfnz}+l5!qiSMca1Ywxq>e9vS3xw!CVYQ z=0}LI=n@d+*m~gn6%um}4adn*jT%qT083B`-$tk6zw;#Z#2t5#c?{4WI3VoF(7XM! z+UnguzK#Z)+`Y;QokJhYr-RG}m7Wcy!$-A*M#4^m1f*cU6Z`NKdQ+^b8tYOE`oBfgn&qkdP>1&H z1BKvj-+>mgDF|8Jc8SU)XRM#+xI0UsNc%f)qEl?AR);tE8;|w2F^x{br~y-eYBd{G z2}_iKw{NI*!`dLOjBwJjPlPZ2_eK;G5W9*lx=0WU})NiXdzxlBU@w}dcgv@ZGcv* z4ZG$Oeky;xhj%QJ?Q*!e40~BBBn&#CyW24BsC-}pJ*1msEE}9vDgC#EPItn)kH&*& zYlaIIWV_qJ2q=Uw$AxebRjvrj&`>}Pj}qY=p9M9yYK{#_g9P#uf(x<_6HbUt+oN1+ z!y-=MIW)rjLlx=!t>HmIGv?()Rw6ybT&FUtXt;|Td=Z^rEIm}q%965BDwmel)bjFt zNqw-ix>73My>quTKlB=$6#ZcEK)E+0;ge{fcyIZ^yt-Ik9ZD6vJ;mwq5Wou{W~>jr z+>Ur^=faaWw-Y?J*`ysgy>mNp0dHr1mC%4+;Gi{0#a%{cYNW0;O{&KCijx73FX@@m z^YK-9xTmb63olerJaf1R0e$8pG`kNbkCx6l52me$p1Nr5Re#@ zR911&1YVM{X)lph5vyVqq9VikmMK>EDsZ7Ygb9fW1EhQQ#`8GyuxcL zZk9b%;<|$TRzfGjT4FLZ@%(ZFlOU`Y3{ROtw9KyIs~r4`(ZUa*Gzx;yRuRZ09LkvhCgrfg~F@d!NALd}72%p@PKWG# diff --git a/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Resources.php b/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Resources.php deleted file mode 100644 index fdbabdcdf43d792b9ef2a0ad3195e5a15d6daf5b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7052 zcmc&3U31gebsZ;heDb9zuyFzeVPFX?*w_S0ox+anD2^eCJ+@<@&8$X|l|&$08cEKQ zW%AaC{)V>Cec)kdb~^nNJJYxRfWGvF=@01ispnql%8sKDFYHWtAo4x;eBSeQ&;89e z)`11rg`(EhY{k`@!tRma9%zDPo35#vhOpb&+tX}8HCvW$Xm&~vR?EUxxh_bnrTR5Q zbfYB^!wH1`cHtr}*hnSRr9(ubL}t$9!l1Ka*otLowiAv@ z5AWVn-9IX^*$hr*4ZU_LuqCnVE%@m^Tpz$)`B`sMiu!a4eL8iRS(x`R6-y8N+jH-Q zMIS_+9epR=^o`}iulB=TW|6Z9eCMm}!IOWBK?2?5n@s9n z+ou8=4Ri%`LQic8kvq0!I$9!%Do4*>tFCi;0`_2Wmjui2A*|doTA-hXdg9L-ACec zFls2fn&Bish@zL=`8axNgKn1Eu6@KOU|ermrtQjR+c-*0BL6YZgn3wKVu;)3k?g1k zTC-zlO_>EjV(J|IJQ_EFSE;MW#D8`b^^MkUCZ-WLo{!@>{a1`aTzC5wa-OUTtnl^=hdg*Gk1LZiN35_?|_!d6b`n*{b+L?xzyt zV-VdG3tT++?t}OiuALQuf!KWQGh#6985QFXBeQGZkK7-jKUl$SjKpwu_(GODL6z-z6PUvrrlE9#4x(jRQ72o$1|`~J(Sic6~ZveUx1iu zV$o^436d@*yw#VOhBb^1^+3_vPGXe0{m2V1p$RjmASlFyiakK5 zB@?a=9z}F1&d)r>ZVxliH_NLs($c6G|r7G2G7)4P`8382Q3mH!So9_us|5(E+#4{Kn zN6AwBO6c*O>o7G!f-i(PFv-{hI4nU>Jm&!XLiF0) zrRAmD2>Adi3n?B0sGfw2KGvS18y#Ddv6*trc7j8EpYm5Q@0*9@zP^34-F?_$Vpl*f z4l-4+<7LY}j0;_iZ{b>i(Vt#r(;`voBxa~44?>+m^7-|p+p>qsFJhk8eEl>--`95y zEx{u_TDzmkzsF#{KYoJz%HM^ho>JM6sx^`Y#EoLPTB@&a_9cR=aH&`>7dIriTP6Ma zhiF(pr(s-_YH}v~SS}Vex!Y_Z`|uH6m}LuOM2gDiZ_7U+(8mAlIp=nh=C z$6tm-wIqp26V ze4iI;nG>8xLg2l;M?>Jf++!bs6aE~33FZR+r1hu-GH{pA01^SXD`x-+cW#jv;4&fW zcQ$falqx3_8w=ght6DsCN3U}5(H%s+8K!=y92xFrD4a==;l2umGZ`}6&MnfhNnTqg zSBN+HE;Dfg@Zj+>0pK5QlK2C|s7VEa^gP4Rt`f&w$4-we2-u*;*+Pc9)(a=(lD!K= zq?dK6x+QLe#~7dd(-2(j4`{FcEy0bDU?!!#zx&0WwjynmkNzl%yAZNp1{=*S0q{xJd4OO3h@dZqG9)d2N|`rmVa-m_BQ5ZdN7s!+?Iw<10Vxgwbch% zm3I5%*-NZ`kvd0)Y$+VFJz8#%I~#hFH`gHjN}Lb7YmnArz*a5y10K!$$k~^xt|fjS z`TreC+M88{( zmdMCsEu;~S4{qInPG74@rZ5BaTc=vh0b5k$roFXv?9YBqrKD2oEC?`jio=P7 zko;E!CVCx*zXJ1qipJT;dU>@kCHjpI?F@p7E0a!-v|JHZc_}=oxB+~K)&3LsqyRGt z(Gxouh29;*uxZG$`g{k25yb_7Mj<4vma$X+1G)8!UQ4y<9L&6r5 zl*yNsQk7J~bEZ52|IeH9=qz<$_V>PJyc-=Se+P@_+z%4K1@{khQMqI5ep$E*bJ`nB z;byz-&wL2nQrrWYd*XLq!*t)JgPc>PTCPj99?Kh2L)z%`73>;n<+b_?u_~cw;4Eyt zwuvUgWmdRxZot6=`z1Fj1#US1hX~B!Tskar@-z5$#GW=BB9U2%{Pwn&5d9%I8ENmE z^nD6P-1tO=BX4VWh5rAaNaX#{Y>_@jr3&ORDuo17jm%GMb;p0BqK{PgO0_#mE7*fu d!2`ox?`fy!CCDKIC^h62i0<^>YL4L;;D05li1Gjc diff --git a/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Service.php b/owl-bot-staging/Kms/v1/proto/src/GPBMetadata/Google/Cloud/Kms/V1/Service.php deleted file mode 100644 index edd8f8bcd703e721811fef1e0e61e4b432476348..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15249 zcmd5@U5p!774A6A#=g7xyPIS;n?GlgG@G!o6DMg}hopFu=CAo#rTL+ii#u!I^-kCJ zxHIETw`B#QRJtMzU!9x1MO>p|xJL0RTUfkA7ZzWrJH-d5&LdQ=8IF^Fk#B(BLTUJ~ z*_yAJ<+S4(F8uGX>6FZd>6%8(d=rpgNG}*QhrrrS*@af4?3z|1O&8p0l*#n5G~biT z9&TEo>4mg}GDnpM#f#S)F0mU%t$3L@W!r4JmOTfe`FxeQ%4GD)^f7T;x}CX@p5_?y z`3{g5(yrYi{=28sHgQ{a<2=JnH&|7FD~1@V&@_vMM#G|3uo_N2@9E@i5w-AA%_I%C zzcp7(Qmf38MPu2t?EaSCC4wHYLHcP>l*{{2Qu&UdzGXN|@e!-F4{f8_BzDAY8C_0X zGzB>dm5SoR6^M~(`cqEL*f7d_I z(D+T$abF-Scg;rCxl3Me5y!>PqLHRygDR6+TANPI9{Z?}_^faU9jsYp&gcx^8I*Q1 zaPDMpiXZSUlxiAPQgR^PClj!GFw^`>RJH>`Q3`+t!Ip3i#I)u(G+S(v*xFugC(GW{vjF1b-rpCjLM%PCDO|&aO6tI%G?`bqzW)W0^ z+sixe552QTj=t{wu7>snZtk&EV3?89cx6k;d;y zKYRsY54=Rcd@!1ecfN3|f097^I8Bt2!vlFU6eLgg5Ng_Ig+4+JKSU{`R<&%?U92-r zx8$CSb&__JB?Y++_a_u@raB?LIxT^L;k=}*&{Q&+gv2vOmuOf=_-uGm)W5HYuHsWhS< zznMTg3(iWtPF&k8zi3t)@&H`tsf|yfk&0P`b6X^TbrP{UQ?&XrmzfAZ+0LQOe1+ss zTS=2774PKb`%8LLYWm)dHvgvyKWgnb)B>) zZG;GjZT6(#W1LF*#~RuO;2>R_3&VO&#Y2OKx1kMnqs*#rq30Qd;EJS8%)?Uux<;S( z`7G(K(WqGU*%gk0!q|u}LRkPa7&vF4h=9XqnbcVD zY{?y#WkDc#=9KVFDyzSfKwDL&5}lYaf2yKQEibq7G=-lI%eTGRhYzCN%hazX6gVpN z`7M{kXVD2I602yT5u6OQ1C8LgcKES|wyM|_cG&LE&$L1x19Y8L7^Qr7VpHF>9I7*~ zwV8*)F;gSP#r(krg#CqvfE{!g$GtBqHM4kSjY}_gvBu@VJ}&e~Gra?(J59L1`=$vc zLlU1rM-;od)**F@uUukH!r|{#WNOu==y~A|r=Un`PK`JU^g#1^^&n{m^EX*#)Cdd zFOwzzWy+>x?%fR90keZ!Mg!*Gb?B#v7h^EAxyStTKRg{;Ao)eabIsJT7?RwS`h~TE zm;rq4j~~C6$lw|JcF$XUj(-74wb!6jbF#;?vbux6uV$fZ%O?N$r%;&(CUy=!9(i-s zJd;)9)aPQ!3aB@NP|xFMdqY)7DQeaLV)K9em-bfzAbjX--odAOLz1%6+_`?12xYz$ zROSx8)t53pT>_d(Xv#6F^W4obo{&^2+A)6FVL8TBBYFHS4IyvniJuBJttTMyb{&B0 z=hq5sXd0k6ouWn%+|L>ohyFolL>&4>B&r^bd;OXpm*jIiTtNchU&AXoeguLCI2&a@ z6^lYrLXOwchv}~$x@7MF&^KF=F;R7n-^{>4N{?w*1&GYgctSOgC_6QJf~F<8x2@^Fqnv#_2bi_>PARQMPr^sRexFX zvVMP1&BEPV;cqWU1tVTHh)^&>`u|Eno4-6k75s^YHi-!VJ{0OPH9ugltxtsy9+Z&x zz_x`EQq2LxxjH+jtB$Yc34b9&!WM0`2-vF0)(y52@?dY}aim^aV7Ra7g+Xzz<}3VN z3JUv|@Vw^r^dp|vJON3X;?Ypg_yvUmWd`>Z{fmRb4UY(0z3|}ELfSw4sT05{>v9)F zYoP=myB6Y3REv+G8RPY2X*)Bb850zeJ_#?M+hv79t+m1^;}vg2Gbb7FSU6lS8G*4q z)$tSPc6yMc!%l>PErAvB08dg*cL>vJoF*e21QjyM@q^Sax~poD}{ zwY5Tudk}^L%zr~qJJ36(ETn$>t%g#704gPzlH>5CsD77z3Xemdm{7%DD{NM(%)nil zI>n+s+^73I?93IQ8vTv6Tsj8gku8@FNvY+@P&Rhyf9v(N!c(#zJL4a+&$Q3hnISHU zM^w2aqU*H^-#&JL1Wl*h4+|3!Z%+TA@Nm&}n@&EPee~#&P(*#+Mc)wQpN*b?tm!UT zc6}z6IDB|D`xP_+pNNIoW;O}mlF}CgtU2xFWBhdi{+Sm0sH|$Sk5mB#bh2Tm=KOi~ z=ck(X!^HSi_DyQ$68$DM1N&qiocd5+Es9T7*|)0jvFiK?wWoFZsQT`2hJWMf`y@2- Pb5JJ9KigbIs|fuEMCcR{ diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptRequest.php deleted file mode 100644 index d091cf22284b..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptRequest.php +++ /dev/null @@ -1,317 +0,0 @@ -google.cloud.kms.v1.AsymmetricDecryptRequest - */ -class AsymmetricDecryptRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * decryption. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The data encrypted with the named - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using - * OAEP. - * - * Generated from protobuf field bytes ciphertext = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $ciphertext = ''; - /** - * Optional. An optional CRC32C checksum of the - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) - * is equal to - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ciphertext_crc32c = null; - - /** - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * decryption. Please see - * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. - * @param string $ciphertext Required. The data encrypted with the named - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using - * OAEP. - * - * @return \Google\Cloud\Kms\V1\AsymmetricDecryptRequest - * - * @experimental - */ - public static function build(string $name, string $ciphertext): self - { - return (new self()) - ->setName($name) - ->setCiphertext($ciphertext); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * decryption. - * @type string $ciphertext - * Required. The data encrypted with the named - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using - * OAEP. - * @type \Google\Protobuf\Int64Value $ciphertext_crc32c - * Optional. An optional CRC32C checksum of the - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) - * is equal to - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * decryption. - * - * 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 - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * decryption. - * - * 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; - } - - /** - * Required. The data encrypted with the named - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using - * OAEP. - * - * Generated from protobuf field bytes ciphertext = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCiphertext() - { - return $this->ciphertext; - } - - /** - * Required. The data encrypted with the named - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using - * OAEP. - * - * Generated from protobuf field bytes ciphertext = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCiphertext($var) - { - GPBUtil::checkString($var, False); - $this->ciphertext = $var; - - return $this; - } - - /** - * Optional. An optional CRC32C checksum of the - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) - * is equal to - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getCiphertextCrc32C() - { - return $this->ciphertext_crc32c; - } - - public function hasCiphertextCrc32C() - { - return isset($this->ciphertext_crc32c); - } - - public function clearCiphertextCrc32C() - { - unset($this->ciphertext_crc32c); - } - - /** - * Returns the unboxed value from getCiphertextCrc32C() - - * Optional. An optional CRC32C checksum of the - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) - * is equal to - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getCiphertextCrc32CUnwrapped() - { - return $this->readWrapperValue("ciphertext_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) - * is equal to - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setCiphertextCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->ciphertext_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) - * is equal to - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setCiphertextCrc32CUnwrapped($var) - { - $this->writeWrapperValue("ciphertext_crc32c", $var); - return $this;} - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptResponse.php deleted file mode 100644 index a50201e6aac9..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricDecryptResponse.php +++ /dev/null @@ -1,339 +0,0 @@ -google.cloud.kms.v1.AsymmetricDecryptResponse - */ -class AsymmetricDecryptResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The decrypted data originally encrypted with the matching public key. - * - * Generated from protobuf field bytes plaintext = 1; - */ - protected $plaintext = ''; - /** - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. - * An integrity check of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - */ - protected $plaintext_crc32c = null; - /** - * Integrity verification field. A flag indicating whether - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. A - * false value of this field indicates either that - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_ciphertext_crc32c = 3; - */ - protected $verified_ciphertext_crc32c = false; - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; - */ - protected $protection_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $plaintext - * The decrypted data originally encrypted with the matching public key. - * @type \Google\Protobuf\Int64Value $plaintext_crc32c - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. - * An integrity check of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * @type bool $verified_ciphertext_crc32c - * Integrity verification field. A flag indicating whether - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. A - * false value of this field indicates either that - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type int $protection_level - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The decrypted data originally encrypted with the matching public key. - * - * Generated from protobuf field bytes plaintext = 1; - * @return string - */ - public function getPlaintext() - { - return $this->plaintext; - } - - /** - * The decrypted data originally encrypted with the matching public key. - * - * Generated from protobuf field bytes plaintext = 1; - * @param string $var - * @return $this - */ - public function setPlaintext($var) - { - GPBUtil::checkString($var, False); - $this->plaintext = $var; - - return $this; - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. - * An integrity check of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @return \Google\Protobuf\Int64Value|null - */ - public function getPlaintextCrc32C() - { - return $this->plaintext_crc32c; - } - - public function hasPlaintextCrc32C() - { - return isset($this->plaintext_crc32c); - } - - public function clearPlaintextCrc32C() - { - unset($this->plaintext_crc32c); - } - - /** - * Returns the unboxed value from getPlaintextCrc32C() - - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. - * An integrity check of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @return int|string|null - */ - public function getPlaintextCrc32CUnwrapped() - { - return $this->readWrapperValue("plaintext_crc32c"); - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. - * An integrity check of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setPlaintextCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->plaintext_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]. - * An integrity check of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @param int|string|null $var - * @return $this - */ - public function setPlaintextCrc32CUnwrapped($var) - { - $this->writeWrapperValue("plaintext_crc32c", $var); - return $this;} - - /** - * Integrity verification field. A flag indicating whether - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. A - * false value of this field indicates either that - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_ciphertext_crc32c = 3; - * @return bool - */ - public function getVerifiedCiphertextCrc32C() - { - return $this->verified_ciphertext_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. A - * false value of this field indicates either that - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_ciphertext_crc32c = 3; - * @param bool $var - * @return $this - */ - public function setVerifiedCiphertextCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_ciphertext_crc32c = $var; - - return $this; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignRequest.php deleted file mode 100644 index 2dae2bd9fd19..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignRequest.php +++ /dev/null @@ -1,568 +0,0 @@ -google.cloud.kms.v1.AsymmetricSignRequest - */ -class AsymmetricSignRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. The digest of the data to sign. The digest must be produced with - * the same digest algorithm as specified by the key version's - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. - * This field may not be supplied if - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * is supplied. - * - * Generated from protobuf field .google.cloud.kms.v1.Digest digest = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $digest = null; - /** - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) - * is equal to - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value digest_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $digest_crc32c = null; - /** - * Optional. The data to sign. - * It can't be supplied if - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * is supplied. - * - * Generated from protobuf field bytes data = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $data = ''; - /** - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) - * is equal to - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $data_crc32c = null; - - /** - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. Please see - * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. - * @param \Google\Cloud\Kms\V1\Digest $digest Optional. The digest of the data to sign. The digest must be produced with - * the same digest algorithm as specified by the key version's - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. - * - * This field may not be supplied if - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * is supplied. - * - * @return \Google\Cloud\Kms\V1\AsymmetricSignRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\Kms\V1\Digest $digest): self - { - return (new self()) - ->setName($name) - ->setDigest($digest); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. - * @type \Google\Cloud\Kms\V1\Digest $digest - * Optional. The digest of the data to sign. The digest must be produced with - * the same digest algorithm as specified by the key version's - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. - * This field may not be supplied if - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * is supplied. - * @type \Google\Protobuf\Int64Value $digest_crc32c - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) - * is equal to - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type string $data - * Optional. The data to sign. - * It can't be supplied if - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * is supplied. - * @type \Google\Protobuf\Int64Value $data_crc32c - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) - * is equal to - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. - * - * 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 - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The digest of the data to sign. The digest must be produced with - * the same digest algorithm as specified by the key version's - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. - * This field may not be supplied if - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * is supplied. - * - * Generated from protobuf field .google.cloud.kms.v1.Digest digest = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Kms\V1\Digest|null - */ - public function getDigest() - { - return $this->digest; - } - - public function hasDigest() - { - return isset($this->digest); - } - - public function clearDigest() - { - unset($this->digest); - } - - /** - * Optional. The digest of the data to sign. The digest must be produced with - * the same digest algorithm as specified by the key version's - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. - * This field may not be supplied if - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * is supplied. - * - * Generated from protobuf field .google.cloud.kms.v1.Digest digest = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Kms\V1\Digest $var - * @return $this - */ - public function setDigest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\Digest::class); - $this->digest = $var; - - return $this; - } - - /** - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) - * is equal to - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value digest_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getDigestCrc32C() - { - return $this->digest_crc32c; - } - - public function hasDigestCrc32C() - { - return isset($this->digest_crc32c); - } - - public function clearDigestCrc32C() - { - unset($this->digest_crc32c); - } - - /** - * Returns the unboxed value from getDigestCrc32C() - - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) - * is equal to - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value digest_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getDigestCrc32CUnwrapped() - { - return $this->readWrapperValue("digest_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) - * is equal to - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value digest_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setDigestCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->digest_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) - * is equal to - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value digest_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setDigestCrc32CUnwrapped($var) - { - $this->writeWrapperValue("digest_crc32c", $var); - return $this;} - - /** - * Optional. The data to sign. - * It can't be supplied if - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * is supplied. - * - * Generated from protobuf field bytes data = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getData() - { - return $this->data; - } - - /** - * Optional. The data to sign. - * It can't be supplied if - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * is supplied. - * - * Generated from protobuf field bytes data = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setData($var) - { - GPBUtil::checkString($var, False); - $this->data = $var; - - return $this; - } - - /** - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) - * is equal to - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getDataCrc32C() - { - return $this->data_crc32c; - } - - public function hasDataCrc32C() - { - return isset($this->data_crc32c); - } - - public function clearDataCrc32C() - { - unset($this->data_crc32c); - } - - /** - * Returns the unboxed value from getDataCrc32C() - - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) - * is equal to - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getDataCrc32CUnwrapped() - { - return $this->readWrapperValue("data_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) - * is equal to - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setDataCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->data_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) - * is equal to - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setDataCrc32CUnwrapped($var) - { - $this->writeWrapperValue("data_crc32c", $var); - return $this;} - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignResponse.php deleted file mode 100644 index efec99a14768..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/AsymmetricSignResponse.php +++ /dev/null @@ -1,463 +0,0 @@ -google.cloud.kms.v1.AsymmetricSignResponse - */ -class AsymmetricSignResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The created signature. - * - * Generated from protobuf field bytes signature = 1; - */ - protected $signature = ''; - /** - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. - * An integrity check of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * can be performed by computing the CRC32C checksum of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value signature_crc32c = 2; - */ - protected $signature_crc32c = null; - /** - * Integrity verification field. A flag indicating whether - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. A false value - * of this field indicates either that - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_digest_crc32c = 3; - */ - protected $verified_digest_crc32c = false; - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * Check this field to verify that the intended resource was used for signing. - * - * Generated from protobuf field string name = 4; - */ - protected $name = ''; - /** - * Integrity verification field. A flag indicating whether - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.AsymmetricSignRequest.data]. A false value of - * this field indicates either that - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_data_crc32c = 5; - */ - protected $verified_data_crc32c = false; - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; - */ - protected $protection_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $signature - * The created signature. - * @type \Google\Protobuf\Int64Value $signature_crc32c - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. - * An integrity check of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * can be performed by computing the CRC32C checksum of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * @type bool $verified_digest_crc32c - * Integrity verification field. A flag indicating whether - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. A false value - * of this field indicates either that - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type string $name - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * Check this field to verify that the intended resource was used for signing. - * @type bool $verified_data_crc32c - * Integrity verification field. A flag indicating whether - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.AsymmetricSignRequest.data]. A false value of - * this field indicates either that - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type int $protection_level - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The created signature. - * - * Generated from protobuf field bytes signature = 1; - * @return string - */ - public function getSignature() - { - return $this->signature; - } - - /** - * The created signature. - * - * Generated from protobuf field bytes signature = 1; - * @param string $var - * @return $this - */ - public function setSignature($var) - { - GPBUtil::checkString($var, False); - $this->signature = $var; - - return $this; - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. - * An integrity check of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * can be performed by computing the CRC32C checksum of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value signature_crc32c = 2; - * @return \Google\Protobuf\Int64Value|null - */ - public function getSignatureCrc32C() - { - return $this->signature_crc32c; - } - - public function hasSignatureCrc32C() - { - return isset($this->signature_crc32c); - } - - public function clearSignatureCrc32C() - { - unset($this->signature_crc32c); - } - - /** - * Returns the unboxed value from getSignatureCrc32C() - - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. - * An integrity check of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * can be performed by computing the CRC32C checksum of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value signature_crc32c = 2; - * @return int|string|null - */ - public function getSignatureCrc32CUnwrapped() - { - return $this->readWrapperValue("signature_crc32c"); - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. - * An integrity check of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * can be performed by computing the CRC32C checksum of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value signature_crc32c = 2; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setSignatureCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->signature_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Integrity verification field. A CRC32C checksum of the returned - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]. - * An integrity check of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * can be performed by computing the CRC32C checksum of - * [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value signature_crc32c = 2; - * @param int|string|null $var - * @return $this - */ - public function setSignatureCrc32CUnwrapped($var) - { - $this->writeWrapperValue("signature_crc32c", $var); - return $this;} - - /** - * Integrity verification field. A flag indicating whether - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. A false value - * of this field indicates either that - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_digest_crc32c = 3; - * @return bool - */ - public function getVerifiedDigestCrc32C() - { - return $this->verified_digest_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. A false value - * of this field indicates either that - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_digest_crc32c = 3; - * @param bool $var - * @return $this - */ - public function setVerifiedDigestCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_digest_crc32c = $var; - - return $this; - } - - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * Check this field to verify that the intended resource was used for signing. - * - * Generated from protobuf field string name = 4; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * Check this field to verify that the intended resource was used for signing. - * - * Generated from protobuf field string name = 4; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Integrity verification field. A flag indicating whether - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.AsymmetricSignRequest.data]. A false value of - * this field indicates either that - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_data_crc32c = 5; - * @return bool - */ - public function getVerifiedDataCrc32C() - { - return $this->verified_data_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.AsymmetricSignRequest.data]. A false value of - * this field indicates either that - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_data_crc32c = 5; - * @param bool $var - * @return $this - */ - public function setVerifiedDataCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_data_crc32c = $var; - - return $this; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Certificate.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Certificate.php deleted file mode 100644 index db653c93c4a9..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Certificate.php +++ /dev/null @@ -1,388 +0,0 @@ -google.cloud.kms.v1.Certificate - */ -class Certificate extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The raw certificate bytes in DER format. - * - * Generated from protobuf field bytes raw_der = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $raw_der = ''; - /** - * Output only. True if the certificate was parsed successfully. - * - * Generated from protobuf field bool parsed = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $parsed = false; - /** - * Output only. The issuer distinguished name in RFC 2253 format. Only present - * if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string issuer = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $issuer = ''; - /** - * Output only. The subject distinguished name in RFC 2253 format. Only - * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string subject = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $subject = ''; - /** - * Output only. The subject Alternative DNS names. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field repeated string subject_alternative_dns_names = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $subject_alternative_dns_names; - /** - * Output only. The certificate is not valid before this time. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field .google.protobuf.Timestamp not_before_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $not_before_time = null; - /** - * Output only. The certificate is not valid after this time. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field .google.protobuf.Timestamp not_after_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $not_after_time = null; - /** - * Output only. The certificate serial number as a hex string. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string serial_number = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $serial_number = ''; - /** - * Output only. The SHA-256 certificate fingerprint as a hex string. Only - * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string sha256_fingerprint = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $sha256_fingerprint = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $raw_der - * Required. The raw certificate bytes in DER format. - * @type bool $parsed - * Output only. True if the certificate was parsed successfully. - * @type string $issuer - * Output only. The issuer distinguished name in RFC 2253 format. Only present - * if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * @type string $subject - * Output only. The subject distinguished name in RFC 2253 format. Only - * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * @type array|\Google\Protobuf\Internal\RepeatedField $subject_alternative_dns_names - * Output only. The subject Alternative DNS names. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * @type \Google\Protobuf\Timestamp $not_before_time - * Output only. The certificate is not valid before this time. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * @type \Google\Protobuf\Timestamp $not_after_time - * Output only. The certificate is not valid after this time. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * @type string $serial_number - * Output only. The certificate serial number as a hex string. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * @type string $sha256_fingerprint - * Output only. The SHA-256 certificate fingerprint as a hex string. Only - * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The raw certificate bytes in DER format. - * - * Generated from protobuf field bytes raw_der = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getRawDer() - { - return $this->raw_der; - } - - /** - * Required. The raw certificate bytes in DER format. - * - * Generated from protobuf field bytes raw_der = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setRawDer($var) - { - GPBUtil::checkString($var, False); - $this->raw_der = $var; - - return $this; - } - - /** - * Output only. True if the certificate was parsed successfully. - * - * Generated from protobuf field bool parsed = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getParsed() - { - return $this->parsed; - } - - /** - * Output only. True if the certificate was parsed successfully. - * - * Generated from protobuf field bool parsed = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setParsed($var) - { - GPBUtil::checkBool($var); - $this->parsed = $var; - - return $this; - } - - /** - * Output only. The issuer distinguished name in RFC 2253 format. Only present - * if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string issuer = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getIssuer() - { - return $this->issuer; - } - - /** - * Output only. The issuer distinguished name in RFC 2253 format. Only present - * if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string issuer = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setIssuer($var) - { - GPBUtil::checkString($var, True); - $this->issuer = $var; - - return $this; - } - - /** - * Output only. The subject distinguished name in RFC 2253 format. Only - * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string subject = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getSubject() - { - return $this->subject; - } - - /** - * Output only. The subject distinguished name in RFC 2253 format. Only - * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string subject = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setSubject($var) - { - GPBUtil::checkString($var, True); - $this->subject = $var; - - return $this; - } - - /** - * Output only. The subject Alternative DNS names. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field repeated string subject_alternative_dns_names = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSubjectAlternativeDnsNames() - { - return $this->subject_alternative_dns_names; - } - - /** - * Output only. The subject Alternative DNS names. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field repeated string subject_alternative_dns_names = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSubjectAlternativeDnsNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->subject_alternative_dns_names = $arr; - - return $this; - } - - /** - * Output only. The certificate is not valid before this time. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field .google.protobuf.Timestamp not_before_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getNotBeforeTime() - { - return $this->not_before_time; - } - - public function hasNotBeforeTime() - { - return isset($this->not_before_time); - } - - public function clearNotBeforeTime() - { - unset($this->not_before_time); - } - - /** - * Output only. The certificate is not valid before this time. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field .google.protobuf.Timestamp not_before_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setNotBeforeTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->not_before_time = $var; - - return $this; - } - - /** - * Output only. The certificate is not valid after this time. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field .google.protobuf.Timestamp not_after_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getNotAfterTime() - { - return $this->not_after_time; - } - - public function hasNotAfterTime() - { - return isset($this->not_after_time); - } - - public function clearNotAfterTime() - { - unset($this->not_after_time); - } - - /** - * Output only. The certificate is not valid after this time. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field .google.protobuf.Timestamp not_after_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setNotAfterTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->not_after_time = $var; - - return $this; - } - - /** - * Output only. The certificate serial number as a hex string. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string serial_number = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getSerialNumber() - { - return $this->serial_number; - } - - /** - * Output only. The certificate serial number as a hex string. Only present if - * [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string serial_number = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setSerialNumber($var) - { - GPBUtil::checkString($var, True); - $this->serial_number = $var; - - return $this; - } - - /** - * Output only. The SHA-256 certificate fingerprint as a hex string. Only - * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string sha256_fingerprint = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getSha256Fingerprint() - { - return $this->sha256_fingerprint; - } - - /** - * Output only. The SHA-256 certificate fingerprint as a hex string. Only - * present if [parsed][google.cloud.kms.v1.Certificate.parsed] is true. - * - * Generated from protobuf field string sha256_fingerprint = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setSha256Fingerprint($var) - { - GPBUtil::checkString($var, True); - $this->sha256_fingerprint = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyRequest.php deleted file mode 100644 index 2eefa5ea5baa..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyRequest.php +++ /dev/null @@ -1,241 +0,0 @@ -google.cloud.kms.v1.CreateCryptoKeyRequest - */ -class CreateCryptoKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing - * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * Generated from protobuf field string crypto_key_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $crypto_key_id = ''; - /** - * Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $crypto_key = null; - /** - * If set to true, the request will create a - * [CryptoKey][google.cloud.kms.v1.CryptoKey] without any - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must - * manually call - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * or - * [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion] - * before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * Generated from protobuf field bool skip_initial_version_creation = 5; - */ - protected $skip_initial_version_creation = false; - - /** - * @param string $parent Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing - * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. Please see - * {@see KeyManagementServiceClient::keyRingName()} for help formatting this field. - * @param string $cryptoKeyId Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param \Google\Cloud\Kms\V1\CryptoKey $cryptoKey Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field - * values. - * - * @return \Google\Cloud\Kms\V1\CreateCryptoKeyRequest - * - * @experimental - */ - public static function build(string $parent, string $cryptoKeyId, \Google\Cloud\Kms\V1\CryptoKey $cryptoKey): self - { - return (new self()) - ->setParent($parent) - ->setCryptoKeyId($cryptoKeyId) - ->setCryptoKey($cryptoKey); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing - * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - * @type string $crypto_key_id - * Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @type \Google\Cloud\Kms\V1\CryptoKey $crypto_key - * Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field - * values. - * @type bool $skip_initial_version_creation - * If set to true, the request will create a - * [CryptoKey][google.cloud.kms.v1.CryptoKey] without any - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must - * manually call - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * or - * [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion] - * before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing - * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing - * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - * - * 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. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * Generated from protobuf field string crypto_key_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCryptoKeyId() - { - return $this->crypto_key_id; - } - - /** - * Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * Generated from protobuf field string crypto_key_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCryptoKeyId($var) - { - GPBUtil::checkString($var, True); - $this->crypto_key_id = $var; - - return $this; - } - - /** - * Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Kms\V1\CryptoKey|null - */ - public function getCryptoKey() - { - return $this->crypto_key; - } - - public function hasCryptoKey() - { - return isset($this->crypto_key); - } - - public function clearCryptoKey() - { - unset($this->crypto_key); - } - - /** - * Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Kms\V1\CryptoKey $var - * @return $this - */ - public function setCryptoKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKey::class); - $this->crypto_key = $var; - - return $this; - } - - /** - * If set to true, the request will create a - * [CryptoKey][google.cloud.kms.v1.CryptoKey] without any - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must - * manually call - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * or - * [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion] - * before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * Generated from protobuf field bool skip_initial_version_creation = 5; - * @return bool - */ - public function getSkipInitialVersionCreation() - { - return $this->skip_initial_version_creation; - } - - /** - * If set to true, the request will create a - * [CryptoKey][google.cloud.kms.v1.CryptoKey] without any - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must - * manually call - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * or - * [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion] - * before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * Generated from protobuf field bool skip_initial_version_creation = 5; - * @param bool $var - * @return $this - */ - public function setSkipInitialVersionCreation($var) - { - GPBUtil::checkBool($var); - $this->skip_initial_version_creation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyVersionRequest.php deleted file mode 100644 index ed1c2af7bf26..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateCryptoKeyVersionRequest.php +++ /dev/null @@ -1,143 +0,0 @@ -google.cloud.kms.v1.CreateCryptoKeyVersionRequest - */ -class CreateCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * initial field values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $crypto_key_version = null; - - /** - * @param string $parent Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. Please see - * {@see KeyManagementServiceClient::cryptoKeyName()} for help formatting this field. - * @param \Google\Cloud\Kms\V1\CryptoKeyVersion $cryptoKeyVersion Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * initial field values. - * - * @return \Google\Cloud\Kms\V1\CreateCryptoKeyVersionRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Kms\V1\CryptoKeyVersion $cryptoKeyVersion): self - { - return (new self()) - ->setParent($parent) - ->setCryptoKeyVersion($cryptoKeyVersion); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - * @type \Google\Cloud\Kms\V1\CryptoKeyVersion $crypto_key_version - * Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * initial field values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - * - * 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. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * initial field values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Kms\V1\CryptoKeyVersion|null - */ - public function getCryptoKeyVersion() - { - return $this->crypto_key_version; - } - - public function hasCryptoKeyVersion() - { - return isset($this->crypto_key_version); - } - - public function clearCryptoKeyVersion() - { - unset($this->crypto_key_version); - } - - /** - * Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * initial field values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Kms\V1\CryptoKeyVersion $var - * @return $this - */ - public function setCryptoKeyVersion($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKeyVersion::class); - $this->crypto_key_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateEkmConnectionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateEkmConnectionRequest.php deleted file mode 100644 index 0b087b989419..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateEkmConnectionRequest.php +++ /dev/null @@ -1,184 +0,0 @@ -google.cloud.kms.v1.CreateEkmConnectionRequest - */ -class CreateEkmConnectionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the location associated with the - * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format - * `projects/*/locations/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}`. - * - * Generated from protobuf field string ekm_connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $ekm_connection_id = ''; - /** - * Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with - * initial field values. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $ekm_connection = null; - - /** - * @param string $parent Required. The resource name of the location associated with the - * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format - * `projects/*/locations/*`. Please see - * {@see EkmServiceClient::locationName()} for help formatting this field. - * @param string $ekmConnectionId Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}`. - * @param \Google\Cloud\Kms\V1\EkmConnection $ekmConnection Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with - * initial field values. - * - * @return \Google\Cloud\Kms\V1\CreateEkmConnectionRequest - * - * @experimental - */ - public static function build(string $parent, string $ekmConnectionId, \Google\Cloud\Kms\V1\EkmConnection $ekmConnection): self - { - return (new self()) - ->setParent($parent) - ->setEkmConnectionId($ekmConnectionId) - ->setEkmConnection($ekmConnection); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the location associated with the - * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format - * `projects/*/locations/*`. - * @type string $ekm_connection_id - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}`. - * @type \Google\Cloud\Kms\V1\EkmConnection $ekm_connection - * Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with - * initial field values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the location associated with the - * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format - * `projects/*/locations/*`. - * - * 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 location associated with the - * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format - * `projects/*/locations/*`. - * - * 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. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}`. - * - * Generated from protobuf field string ekm_connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEkmConnectionId() - { - return $this->ekm_connection_id; - } - - /** - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}`. - * - * Generated from protobuf field string ekm_connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEkmConnectionId($var) - { - GPBUtil::checkString($var, True); - $this->ekm_connection_id = $var; - - return $this; - } - - /** - * Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with - * initial field values. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Kms\V1\EkmConnection|null - */ - public function getEkmConnection() - { - return $this->ekm_connection; - } - - public function hasEkmConnection() - { - return isset($this->ekm_connection); - } - - public function clearEkmConnection() - { - unset($this->ekm_connection); - } - - /** - * Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with - * initial field values. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Kms\V1\EkmConnection $var - * @return $this - */ - public function setEkmConnection($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\EkmConnection::class); - $this->ekm_connection = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateImportJobRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateImportJobRequest.php deleted file mode 100644 index cf82ffb0e04a..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateImportJobRequest.php +++ /dev/null @@ -1,184 +0,0 @@ -google.cloud.kms.v1.CreateImportJobRequest - */ -class CreateImportJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the - * [ImportJobs][google.cloud.kms.v1.ImportJob]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * Generated from protobuf field string import_job_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $import_job_id = ''; - /** - * Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob import_job = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $import_job = null; - - /** - * @param string $parent Required. The [name][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the - * [ImportJobs][google.cloud.kms.v1.ImportJob]. Please see - * {@see KeyManagementServiceClient::keyRingName()} for help formatting this field. - * @param string $importJobId Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param \Google\Cloud\Kms\V1\ImportJob $importJob Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field - * values. - * - * @return \Google\Cloud\Kms\V1\CreateImportJobRequest - * - * @experimental - */ - public static function build(string $parent, string $importJobId, \Google\Cloud\Kms\V1\ImportJob $importJob): self - { - return (new self()) - ->setParent($parent) - ->setImportJobId($importJobId) - ->setImportJob($importJob); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the - * [ImportJobs][google.cloud.kms.v1.ImportJob]. - * @type string $import_job_id - * Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @type \Google\Cloud\Kms\V1\ImportJob $import_job - * Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field - * values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the - * [ImportJobs][google.cloud.kms.v1.ImportJob]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the - * [ImportJobs][google.cloud.kms.v1.ImportJob]. - * - * 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. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * Generated from protobuf field string import_job_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getImportJobId() - { - return $this->import_job_id; - } - - /** - * Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * Generated from protobuf field string import_job_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setImportJobId($var) - { - GPBUtil::checkString($var, True); - $this->import_job_id = $var; - - return $this; - } - - /** - * Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob import_job = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Kms\V1\ImportJob|null - */ - public function getImportJob() - { - return $this->import_job; - } - - public function hasImportJob() - { - return isset($this->import_job); - } - - public function clearImportJob() - { - unset($this->import_job); - } - - /** - * Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob import_job = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Kms\V1\ImportJob $var - * @return $this - */ - public function setImportJob($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\ImportJob::class); - $this->import_job = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateKeyRingRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateKeyRingRequest.php deleted file mode 100644 index 22c6f3b3054f..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CreateKeyRingRequest.php +++ /dev/null @@ -1,184 +0,0 @@ -google.cloud.kms.v1.CreateKeyRingRequest - */ -class CreateKeyRingRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * Generated from protobuf field string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $key_ring_id = ''; - /** - * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $key_ring = null; - - /** - * @param string $parent Required. The resource name of the location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. Please see - * {@see KeyManagementServiceClient::locationName()} for help formatting this field. - * @param string $keyRingId Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param \Google\Cloud\Kms\V1\KeyRing $keyRing Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field - * values. - * - * @return \Google\Cloud\Kms\V1\CreateKeyRingRequest - * - * @experimental - */ - public static function build(string $parent, string $keyRingId, \Google\Cloud\Kms\V1\KeyRing $keyRing): self - { - return (new self()) - ->setParent($parent) - ->setKeyRingId($keyRingId) - ->setKeyRing($keyRing); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. - * @type string $key_ring_id - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @type \Google\Cloud\Kms\V1\KeyRing $key_ring - * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field - * values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. - * - * 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 location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. - * - * 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. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * Generated from protobuf field string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKeyRingId() - { - return $this->key_ring_id; - } - - /** - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * - * Generated from protobuf field string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKeyRingId($var) - { - GPBUtil::checkString($var, True); - $this->key_ring_id = $var; - - return $this; - } - - /** - * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Kms\V1\KeyRing|null - */ - public function getKeyRing() - { - return $this->key_ring; - } - - public function hasKeyRing() - { - return isset($this->key_ring); - } - - public function clearKeyRing() - { - unset($this->key_ring); - } - - /** - * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Kms\V1\KeyRing $var - * @return $this - */ - public function setKeyRing($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\KeyRing::class); - $this->key_ring = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey.php deleted file mode 100644 index 9af72cbcf36d..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey.php +++ /dev/null @@ -1,676 +0,0 @@ -google.cloud.kms.v1.CryptoKey - */ -class CryptoKey extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name for this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. A copy of the "primary" - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used - * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] is given in - * [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. - * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be - * updated via - * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. - * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] - * may have a primary. For other keys, this field will be omitted. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion primary = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $primary = null; - /** - * Immutable. The immutable purpose of this - * [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $purpose = 0; - /** - * Output only. The time at which this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], - * the Key Management Service will automatically: - * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * 2. Mark the new version as primary. - * Key rotations performed manually via - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * and - * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] - * do not affect - * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. - * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] - * support automatic rotation. For other keys, this field must be omitted. - * - * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 7; - */ - protected $next_rotation_time = null; - /** - * A template describing settings for new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances. The - * properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * instances created by either - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * or auto-rotation are controlled by this template. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; - */ - protected $version_template = null; - /** - * Labels with user-defined metadata. For more information, see - * [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys). - * - * Generated from protobuf field map labels = 10; - */ - private $labels; - /** - * Immutable. Whether this key may contain imported versions only. - * - * Generated from protobuf field bool import_only = 13 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $import_only = false; - /** - * Immutable. The period of time that versions of this key spend in the - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] - * state before transitioning to - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. - * If not specified at creation time, the default duration is 24 hours. - * - * Generated from protobuf field .google.protobuf.Duration destroy_scheduled_duration = 14 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $destroy_scheduled_duration = null; - /** - * Immutable. The resource name of the backend environment where the key - * material for all [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] - * associated with this [CryptoKey][google.cloud.kms.v1.CryptoKey] reside and - * where all related cryptographic operations are performed. Only applicable - * if [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] have a - * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of - * [EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC], with the - * resource name in the format `projects/*/locations/*/ekmConnections/*`. - * Note, this list is non-exhaustive and may apply to additional - * [ProtectionLevels][google.cloud.kms.v1.ProtectionLevel] in the future. - * - * Generated from protobuf field string crypto_key_backend = 15 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - */ - protected $crypto_key_backend = ''; - protected $rotation_schedule; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name for this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * @type \Google\Cloud\Kms\V1\CryptoKeyVersion $primary - * Output only. A copy of the "primary" - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used - * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] is given in - * [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. - * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be - * updated via - * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. - * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] - * may have a primary. For other keys, this field will be omitted. - * @type int $purpose - * Immutable. The immutable purpose of this - * [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time at which this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. - * @type \Google\Protobuf\Timestamp $next_rotation_time - * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], - * the Key Management Service will automatically: - * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * 2. Mark the new version as primary. - * Key rotations performed manually via - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * and - * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] - * do not affect - * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. - * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] - * support automatic rotation. For other keys, this field must be omitted. - * @type \Google\Protobuf\Duration $rotation_period - * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] - * will be advanced by this period when the service automatically rotates a - * key. Must be at least 24 hours and at most 876,000 hours. - * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is - * set, - * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] - * must also be set. - * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] - * support automatic rotation. For other keys, this field must be omitted. - * @type \Google\Cloud\Kms\V1\CryptoKeyVersionTemplate $version_template - * A template describing settings for new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances. The - * properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * instances created by either - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * or auto-rotation are controlled by this template. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels with user-defined metadata. For more information, see - * [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys). - * @type bool $import_only - * Immutable. Whether this key may contain imported versions only. - * @type \Google\Protobuf\Duration $destroy_scheduled_duration - * Immutable. The period of time that versions of this key spend in the - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] - * state before transitioning to - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. - * If not specified at creation time, the default duration is 24 hours. - * @type string $crypto_key_backend - * Immutable. The resource name of the backend environment where the key - * material for all [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] - * associated with this [CryptoKey][google.cloud.kms.v1.CryptoKey] reside and - * where all related cryptographic operations are performed. Only applicable - * if [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] have a - * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of - * [EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC], with the - * resource name in the format `projects/*/locations/*/ekmConnections/*`. - * Note, this list is non-exhaustive and may apply to additional - * [ProtectionLevels][google.cloud.kms.v1.ProtectionLevel] in the future. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name for this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * - * 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 for this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. A copy of the "primary" - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used - * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] is given in - * [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. - * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be - * updated via - * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. - * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] - * may have a primary. For other keys, this field will be omitted. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion primary = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Kms\V1\CryptoKeyVersion|null - */ - public function getPrimary() - { - return $this->primary; - } - - public function hasPrimary() - { - return isset($this->primary); - } - - public function clearPrimary() - { - unset($this->primary); - } - - /** - * Output only. A copy of the "primary" - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used - * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] is given in - * [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. - * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be - * updated via - * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. - * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] - * may have a primary. For other keys, this field will be omitted. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion primary = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Kms\V1\CryptoKeyVersion $var - * @return $this - */ - public function setPrimary($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKeyVersion::class); - $this->primary = $var; - - return $this; - } - - /** - * Immutable. The immutable purpose of this - * [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getPurpose() - { - return $this->purpose; - } - - /** - * Immutable. The immutable purpose of this - * [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setPurpose($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKey\CryptoKeyPurpose::class); - $this->purpose = $var; - - return $this; - } - - /** - * Output only. The time at which this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time at which this - * [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], - * the Key Management Service will automatically: - * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * 2. Mark the new version as primary. - * Key rotations performed manually via - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * and - * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] - * do not affect - * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. - * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] - * support automatic rotation. For other keys, this field must be omitted. - * - * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 7; - * @return \Google\Protobuf\Timestamp|null - */ - public function getNextRotationTime() - { - return $this->next_rotation_time; - } - - public function hasNextRotationTime() - { - return isset($this->next_rotation_time); - } - - public function clearNextRotationTime() - { - unset($this->next_rotation_time); - } - - /** - * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], - * the Key Management Service will automatically: - * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * 2. Mark the new version as primary. - * Key rotations performed manually via - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * and - * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] - * do not affect - * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. - * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] - * support automatic rotation. For other keys, this field must be omitted. - * - * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 7; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setNextRotationTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->next_rotation_time = $var; - - return $this; - } - - /** - * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] - * will be advanced by this period when the service automatically rotates a - * key. Must be at least 24 hours and at most 876,000 hours. - * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is - * set, - * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] - * must also be set. - * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] - * support automatic rotation. For other keys, this field must be omitted. - * - * Generated from protobuf field .google.protobuf.Duration rotation_period = 8; - * @return \Google\Protobuf\Duration|null - */ - public function getRotationPeriod() - { - return $this->readOneof(8); - } - - public function hasRotationPeriod() - { - return $this->hasOneof(8); - } - - /** - * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] - * will be advanced by this period when the service automatically rotates a - * key. Must be at least 24 hours and at most 876,000 hours. - * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is - * set, - * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] - * must also be set. - * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] - * support automatic rotation. For other keys, this field must be omitted. - * - * Generated from protobuf field .google.protobuf.Duration rotation_period = 8; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setRotationPeriod($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * A template describing settings for new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances. The - * properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * instances created by either - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * or auto-rotation are controlled by this template. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; - * @return \Google\Cloud\Kms\V1\CryptoKeyVersionTemplate|null - */ - public function getVersionTemplate() - { - return $this->version_template; - } - - public function hasVersionTemplate() - { - return isset($this->version_template); - } - - public function clearVersionTemplate() - { - unset($this->version_template); - } - - /** - * A template describing settings for new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances. The - * properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * instances created by either - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * or auto-rotation are controlled by this template. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; - * @param \Google\Cloud\Kms\V1\CryptoKeyVersionTemplate $var - * @return $this - */ - public function setVersionTemplate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKeyVersionTemplate::class); - $this->version_template = $var; - - return $this; - } - - /** - * Labels with user-defined metadata. For more information, see - * [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys). - * - * Generated from protobuf field map labels = 10; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels with user-defined metadata. For more information, see - * [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys). - * - * Generated from protobuf field map labels = 10; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Immutable. Whether this key may contain imported versions only. - * - * Generated from protobuf field bool import_only = 13 [(.google.api.field_behavior) = IMMUTABLE]; - * @return bool - */ - public function getImportOnly() - { - return $this->import_only; - } - - /** - * Immutable. Whether this key may contain imported versions only. - * - * Generated from protobuf field bool import_only = 13 [(.google.api.field_behavior) = IMMUTABLE]; - * @param bool $var - * @return $this - */ - public function setImportOnly($var) - { - GPBUtil::checkBool($var); - $this->import_only = $var; - - return $this; - } - - /** - * Immutable. The period of time that versions of this key spend in the - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] - * state before transitioning to - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. - * If not specified at creation time, the default duration is 24 hours. - * - * Generated from protobuf field .google.protobuf.Duration destroy_scheduled_duration = 14 [(.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Duration|null - */ - public function getDestroyScheduledDuration() - { - return $this->destroy_scheduled_duration; - } - - public function hasDestroyScheduledDuration() - { - return isset($this->destroy_scheduled_duration); - } - - public function clearDestroyScheduledDuration() - { - unset($this->destroy_scheduled_duration); - } - - /** - * Immutable. The period of time that versions of this key spend in the - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] - * state before transitioning to - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. - * If not specified at creation time, the default duration is 24 hours. - * - * Generated from protobuf field .google.protobuf.Duration destroy_scheduled_duration = 14 [(.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDestroyScheduledDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->destroy_scheduled_duration = $var; - - return $this; - } - - /** - * Immutable. The resource name of the backend environment where the key - * material for all [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] - * associated with this [CryptoKey][google.cloud.kms.v1.CryptoKey] reside and - * where all related cryptographic operations are performed. Only applicable - * if [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] have a - * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of - * [EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC], with the - * resource name in the format `projects/*/locations/*/ekmConnections/*`. - * Note, this list is non-exhaustive and may apply to additional - * [ProtectionLevels][google.cloud.kms.v1.ProtectionLevel] in the future. - * - * Generated from protobuf field string crypto_key_backend = 15 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @return string - */ - public function getCryptoKeyBackend() - { - return $this->crypto_key_backend; - } - - /** - * Immutable. The resource name of the backend environment where the key - * material for all [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] - * associated with this [CryptoKey][google.cloud.kms.v1.CryptoKey] reside and - * where all related cryptographic operations are performed. Only applicable - * if [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] have a - * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of - * [EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC], with the - * resource name in the format `projects/*/locations/*/ekmConnections/*`. - * Note, this list is non-exhaustive and may apply to additional - * [ProtectionLevels][google.cloud.kms.v1.ProtectionLevel] in the future. - * - * Generated from protobuf field string crypto_key_backend = 15 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setCryptoKeyBackend($var) - { - GPBUtil::checkString($var, True); - $this->crypto_key_backend = $var; - - return $this; - } - - /** - * @return string - */ - public function getRotationSchedule() - { - return $this->whichOneof("rotation_schedule"); - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey/CryptoKeyPurpose.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey/CryptoKeyPurpose.php deleted file mode 100644 index a941f6337534..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKey/CryptoKeyPurpose.php +++ /dev/null @@ -1,104 +0,0 @@ -google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose - */ -class CryptoKeyPurpose -{ - /** - * Not specified. - * - * Generated from protobuf enum CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0; - */ - const CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0; - /** - * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used - * with [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and - * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. - * - * Generated from protobuf enum ENCRYPT_DECRYPT = 1; - */ - const ENCRYPT_DECRYPT = 1; - /** - * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used - * with - * [AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign] - * and - * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. - * - * Generated from protobuf enum ASYMMETRIC_SIGN = 5; - */ - const ASYMMETRIC_SIGN = 5; - /** - * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used - * with - * [AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt] - * and - * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. - * - * Generated from protobuf enum ASYMMETRIC_DECRYPT = 6; - */ - const ASYMMETRIC_DECRYPT = 6; - /** - * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used - * with [RawEncrypt][google.cloud.kms.v1.KeyManagementService.RawEncrypt] - * and [RawDecrypt][google.cloud.kms.v1.KeyManagementService.RawDecrypt]. - * This purpose is meant to be used for interoperable symmetric - * encryption and does not support automatic CryptoKey rotation. - * - * Generated from protobuf enum RAW_ENCRYPT_DECRYPT = 7; - */ - const RAW_ENCRYPT_DECRYPT = 7; - /** - * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used - * with [MacSign][google.cloud.kms.v1.KeyManagementService.MacSign]. - * - * Generated from protobuf enum MAC = 9; - */ - const MAC = 9; - - private static $valueToName = [ - self::CRYPTO_KEY_PURPOSE_UNSPECIFIED => 'CRYPTO_KEY_PURPOSE_UNSPECIFIED', - self::ENCRYPT_DECRYPT => 'ENCRYPT_DECRYPT', - self::ASYMMETRIC_SIGN => 'ASYMMETRIC_SIGN', - self::ASYMMETRIC_DECRYPT => 'ASYMMETRIC_DECRYPT', - self::RAW_ENCRYPT_DECRYPT => 'RAW_ENCRYPT_DECRYPT', - self::MAC => 'MAC', - ]; - - 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(CryptoKeyPurpose::class, \Google\Cloud\Kms\V1\CryptoKey_CryptoKeyPurpose::class); - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion.php deleted file mode 100644 index b88345be44c3..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion.php +++ /dev/null @@ -1,819 +0,0 @@ -google.cloud.kms.v1.CryptoKeyVersion - */ -class CryptoKeyVersion extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name for this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * The current state of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; - */ - protected $state = 0; - /** - * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] - * describing how crypto operations are performed with this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $protection_level = 0; - /** - * Output only. The - * [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * that this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * supports. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $algorithm = 0; - /** - * Output only. Statement that was generated and signed by the HSM at key - * creation time. Use this statement to verify attributes of the key as stored - * on the HSM, independently of Google. Only provided for key versions with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $attestation = null; - /** - * Output only. The time at which this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was - * generated. - * - * Generated from protobuf field .google.protobuf.Timestamp generate_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $generate_time = null; - /** - * Output only. The time this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is - * scheduled for destruction. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. - * - * Generated from protobuf field .google.protobuf.Timestamp destroy_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $destroy_time = null; - /** - * Output only. The time this CryptoKeyVersion's key material was - * destroyed. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. - * - * Generated from protobuf field .google.protobuf.Timestamp destroy_event_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $destroy_event_time = null; - /** - * Output only. The name of the [ImportJob][google.cloud.kms.v1.ImportJob] - * used in the most recent import of this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only present if - * the underlying key material was imported. - * - * Generated from protobuf field string import_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $import_job = ''; - /** - * Output only. The time at which this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was - * most recently imported. - * - * Generated from protobuf field .google.protobuf.Timestamp import_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $import_time = null; - /** - * Output only. The root cause of the most recent import failure. Only present - * if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED]. - * - * Generated from protobuf field string import_failure_reason = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $import_failure_reason = ''; - /** - * Output only. The root cause of the most recent generation failure. Only - * present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [GENERATION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.GENERATION_FAILED]. - * - * Generated from protobuf field string generation_failure_reason = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $generation_failure_reason = ''; - /** - * Output only. The root cause of the most recent external destruction - * failure. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [EXTERNAL_DESTRUCTION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.EXTERNAL_DESTRUCTION_FAILED]. - * - * Generated from protobuf field string external_destruction_failure_reason = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $external_destruction_failure_reason = ''; - /** - * ExternalProtectionLevelOptions stores a group of additional fields for - * configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that - * are specific to the - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] protection level - * and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] - * protection levels. - * - * Generated from protobuf field .google.cloud.kms.v1.ExternalProtectionLevelOptions external_protection_level_options = 17; - */ - protected $external_protection_level_options = null; - /** - * Output only. Whether or not this key version is eligible for reimport, by - * being specified as a target in - * [ImportCryptoKeyVersionRequest.crypto_key_version][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.crypto_key_version]. - * - * Generated from protobuf field bool reimport_eligible = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reimport_eligible = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name for this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. - * @type int $state - * The current state of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * @type int $protection_level - * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] - * describing how crypto operations are performed with this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * @type int $algorithm - * Output only. The - * [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * that this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * supports. - * @type \Google\Cloud\Kms\V1\KeyOperationAttestation $attestation - * Output only. Statement that was generated and signed by the HSM at key - * creation time. Use this statement to verify attributes of the key as stored - * on the HSM, independently of Google. Only provided for key versions with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time at which this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. - * @type \Google\Protobuf\Timestamp $generate_time - * Output only. The time this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was - * generated. - * @type \Google\Protobuf\Timestamp $destroy_time - * Output only. The time this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is - * scheduled for destruction. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. - * @type \Google\Protobuf\Timestamp $destroy_event_time - * Output only. The time this CryptoKeyVersion's key material was - * destroyed. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. - * @type string $import_job - * Output only. The name of the [ImportJob][google.cloud.kms.v1.ImportJob] - * used in the most recent import of this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only present if - * the underlying key material was imported. - * @type \Google\Protobuf\Timestamp $import_time - * Output only. The time at which this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was - * most recently imported. - * @type string $import_failure_reason - * Output only. The root cause of the most recent import failure. Only present - * if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED]. - * @type string $generation_failure_reason - * Output only. The root cause of the most recent generation failure. Only - * present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [GENERATION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.GENERATION_FAILED]. - * @type string $external_destruction_failure_reason - * Output only. The root cause of the most recent external destruction - * failure. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [EXTERNAL_DESTRUCTION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.EXTERNAL_DESTRUCTION_FAILED]. - * @type \Google\Cloud\Kms\V1\ExternalProtectionLevelOptions $external_protection_level_options - * ExternalProtectionLevelOptions stores a group of additional fields for - * configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that - * are specific to the - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] protection level - * and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] - * protection levels. - * @type bool $reimport_eligible - * Output only. Whether or not this key version is eligible for reimport, by - * being specified as a target in - * [ImportCryptoKeyVersionRequest.crypto_key_version][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.crypto_key_version]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name for this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. - * - * 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 for this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. - * - * 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; - } - - /** - * The current state of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The current state of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionState::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] - * describing how crypto operations are performed with this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] - * describing how crypto operations are performed with this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - - /** - * Output only. The - * [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * that this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * supports. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getAlgorithm() - { - return $this->algorithm; - } - - /** - * Output only. The - * [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * that this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * supports. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setAlgorithm($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionAlgorithm::class); - $this->algorithm = $var; - - return $this; - } - - /** - * Output only. Statement that was generated and signed by the HSM at key - * creation time. Use this statement to verify attributes of the key as stored - * on the HSM, independently of Google. Only provided for key versions with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Kms\V1\KeyOperationAttestation|null - */ - public function getAttestation() - { - return $this->attestation; - } - - public function hasAttestation() - { - return isset($this->attestation); - } - - public function clearAttestation() - { - unset($this->attestation); - } - - /** - * Output only. Statement that was generated and signed by the HSM at key - * creation time. Use this statement to verify attributes of the key as stored - * on the HSM, independently of Google. Only provided for key versions with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Kms\V1\KeyOperationAttestation $var - * @return $this - */ - public function setAttestation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\KeyOperationAttestation::class); - $this->attestation = $var; - - return $this; - } - - /** - * Output only. The time at which this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time at which this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was - * generated. - * - * Generated from protobuf field .google.protobuf.Timestamp generate_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getGenerateTime() - { - return $this->generate_time; - } - - public function hasGenerateTime() - { - return isset($this->generate_time); - } - - public function clearGenerateTime() - { - unset($this->generate_time); - } - - /** - * Output only. The time this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was - * generated. - * - * Generated from protobuf field .google.protobuf.Timestamp generate_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setGenerateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->generate_time = $var; - - return $this; - } - - /** - * Output only. The time this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is - * scheduled for destruction. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. - * - * Generated from protobuf field .google.protobuf.Timestamp destroy_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDestroyTime() - { - return $this->destroy_time; - } - - public function hasDestroyTime() - { - return isset($this->destroy_time); - } - - public function clearDestroyTime() - { - unset($this->destroy_time); - } - - /** - * Output only. The time this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is - * scheduled for destruction. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. - * - * Generated from protobuf field .google.protobuf.Timestamp destroy_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDestroyTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->destroy_time = $var; - - return $this; - } - - /** - * Output only. The time this CryptoKeyVersion's key material was - * destroyed. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. - * - * Generated from protobuf field .google.protobuf.Timestamp destroy_event_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDestroyEventTime() - { - return $this->destroy_event_time; - } - - public function hasDestroyEventTime() - { - return isset($this->destroy_event_time); - } - - public function clearDestroyEventTime() - { - unset($this->destroy_event_time); - } - - /** - * Output only. The time this CryptoKeyVersion's key material was - * destroyed. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. - * - * Generated from protobuf field .google.protobuf.Timestamp destroy_event_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDestroyEventTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->destroy_event_time = $var; - - return $this; - } - - /** - * Output only. The name of the [ImportJob][google.cloud.kms.v1.ImportJob] - * used in the most recent import of this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only present if - * the underlying key material was imported. - * - * Generated from protobuf field string import_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getImportJob() - { - return $this->import_job; - } - - /** - * Output only. The name of the [ImportJob][google.cloud.kms.v1.ImportJob] - * used in the most recent import of this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only present if - * the underlying key material was imported. - * - * Generated from protobuf field string import_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setImportJob($var) - { - GPBUtil::checkString($var, True); - $this->import_job = $var; - - return $this; - } - - /** - * Output only. The time at which this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was - * most recently imported. - * - * Generated from protobuf field .google.protobuf.Timestamp import_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getImportTime() - { - return $this->import_time; - } - - public function hasImportTime() - { - return isset($this->import_time); - } - - public function clearImportTime() - { - unset($this->import_time); - } - - /** - * Output only. The time at which this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was - * most recently imported. - * - * Generated from protobuf field .google.protobuf.Timestamp import_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setImportTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->import_time = $var; - - return $this; - } - - /** - * Output only. The root cause of the most recent import failure. Only present - * if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED]. - * - * Generated from protobuf field string import_failure_reason = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getImportFailureReason() - { - return $this->import_failure_reason; - } - - /** - * Output only. The root cause of the most recent import failure. Only present - * if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED]. - * - * Generated from protobuf field string import_failure_reason = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setImportFailureReason($var) - { - GPBUtil::checkString($var, True); - $this->import_failure_reason = $var; - - return $this; - } - - /** - * Output only. The root cause of the most recent generation failure. Only - * present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [GENERATION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.GENERATION_FAILED]. - * - * Generated from protobuf field string generation_failure_reason = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getGenerationFailureReason() - { - return $this->generation_failure_reason; - } - - /** - * Output only. The root cause of the most recent generation failure. Only - * present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [GENERATION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.GENERATION_FAILED]. - * - * Generated from protobuf field string generation_failure_reason = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setGenerationFailureReason($var) - { - GPBUtil::checkString($var, True); - $this->generation_failure_reason = $var; - - return $this; - } - - /** - * Output only. The root cause of the most recent external destruction - * failure. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [EXTERNAL_DESTRUCTION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.EXTERNAL_DESTRUCTION_FAILED]. - * - * Generated from protobuf field string external_destruction_failure_reason = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getExternalDestructionFailureReason() - { - return $this->external_destruction_failure_reason; - } - - /** - * Output only. The root cause of the most recent external destruction - * failure. Only present if - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] is - * [EXTERNAL_DESTRUCTION_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.EXTERNAL_DESTRUCTION_FAILED]. - * - * Generated from protobuf field string external_destruction_failure_reason = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setExternalDestructionFailureReason($var) - { - GPBUtil::checkString($var, True); - $this->external_destruction_failure_reason = $var; - - return $this; - } - - /** - * ExternalProtectionLevelOptions stores a group of additional fields for - * configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that - * are specific to the - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] protection level - * and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] - * protection levels. - * - * Generated from protobuf field .google.cloud.kms.v1.ExternalProtectionLevelOptions external_protection_level_options = 17; - * @return \Google\Cloud\Kms\V1\ExternalProtectionLevelOptions|null - */ - public function getExternalProtectionLevelOptions() - { - return $this->external_protection_level_options; - } - - public function hasExternalProtectionLevelOptions() - { - return isset($this->external_protection_level_options); - } - - public function clearExternalProtectionLevelOptions() - { - unset($this->external_protection_level_options); - } - - /** - * ExternalProtectionLevelOptions stores a group of additional fields for - * configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that - * are specific to the - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] protection level - * and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] - * protection levels. - * - * Generated from protobuf field .google.cloud.kms.v1.ExternalProtectionLevelOptions external_protection_level_options = 17; - * @param \Google\Cloud\Kms\V1\ExternalProtectionLevelOptions $var - * @return $this - */ - public function setExternalProtectionLevelOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\ExternalProtectionLevelOptions::class); - $this->external_protection_level_options = $var; - - return $this; - } - - /** - * Output only. Whether or not this key version is eligible for reimport, by - * being specified as a target in - * [ImportCryptoKeyVersionRequest.crypto_key_version][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.crypto_key_version]. - * - * Generated from protobuf field bool reimport_eligible = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getReimportEligible() - { - return $this->reimport_eligible; - } - - /** - * Output only. Whether or not this key version is eligible for reimport, by - * being specified as a target in - * [ImportCryptoKeyVersionRequest.crypto_key_version][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.crypto_key_version]. - * - * Generated from protobuf field bool reimport_eligible = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setReimportEligible($var) - { - GPBUtil::checkBool($var); - $this->reimport_eligible = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php deleted file mode 100644 index 3b16f37eba2e..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionAlgorithm.php +++ /dev/null @@ -1,328 +0,0 @@ -google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm - */ -class CryptoKeyVersionAlgorithm -{ - /** - * Not specified. - * - * Generated from protobuf enum CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0; - */ - const CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0; - /** - * Creates symmetric encryption keys. - * - * Generated from protobuf enum GOOGLE_SYMMETRIC_ENCRYPTION = 1; - */ - const GOOGLE_SYMMETRIC_ENCRYPTION = 1; - /** - * AES-GCM (Galois Counter Mode) using 128-bit keys. - * - * Generated from protobuf enum AES_128_GCM = 41; - */ - const AES_128_GCM = 41; - /** - * AES-GCM (Galois Counter Mode) using 256-bit keys. - * - * Generated from protobuf enum AES_256_GCM = 19; - */ - const AES_256_GCM = 19; - /** - * AES-CBC (Cipher Block Chaining Mode) using 128-bit keys. - * - * Generated from protobuf enum AES_128_CBC = 42; - */ - const AES_128_CBC = 42; - /** - * AES-CBC (Cipher Block Chaining Mode) using 256-bit keys. - * - * Generated from protobuf enum AES_256_CBC = 43; - */ - const AES_256_CBC = 43; - /** - * AES-CTR (Counter Mode) using 128-bit keys. - * - * Generated from protobuf enum AES_128_CTR = 44; - */ - const AES_128_CTR = 44; - /** - * AES-CTR (Counter Mode) using 256-bit keys. - * - * Generated from protobuf enum AES_256_CTR = 45; - */ - const AES_256_CTR = 45; - /** - * RSASSA-PSS 2048 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_SIGN_PSS_2048_SHA256 = 2; - */ - const RSA_SIGN_PSS_2048_SHA256 = 2; - /** - * RSASSA-PSS 3072 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_SIGN_PSS_3072_SHA256 = 3; - */ - const RSA_SIGN_PSS_3072_SHA256 = 3; - /** - * RSASSA-PSS 4096 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_SIGN_PSS_4096_SHA256 = 4; - */ - const RSA_SIGN_PSS_4096_SHA256 = 4; - /** - * RSASSA-PSS 4096 bit key with a SHA512 digest. - * - * Generated from protobuf enum RSA_SIGN_PSS_4096_SHA512 = 15; - */ - const RSA_SIGN_PSS_4096_SHA512 = 15; - /** - * 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 = 16; - */ - const RSA_SIGN_PKCS1_4096_SHA512 = 16; - /** - * RSASSA-PKCS1-v1_5 signing without encoding, with a 2048 bit key. - * - * Generated from protobuf enum RSA_SIGN_RAW_PKCS1_2048 = 28; - */ - const RSA_SIGN_RAW_PKCS1_2048 = 28; - /** - * RSASSA-PKCS1-v1_5 signing without encoding, with a 3072 bit key. - * - * Generated from protobuf enum RSA_SIGN_RAW_PKCS1_3072 = 29; - */ - const RSA_SIGN_RAW_PKCS1_3072 = 29; - /** - * RSASSA-PKCS1-v1_5 signing without encoding, with a 4096 bit key. - * - * Generated from protobuf enum RSA_SIGN_RAW_PKCS1_4096 = 30; - */ - const RSA_SIGN_RAW_PKCS1_4096 = 30; - /** - * RSAES-OAEP 2048 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_DECRYPT_OAEP_2048_SHA256 = 8; - */ - const RSA_DECRYPT_OAEP_2048_SHA256 = 8; - /** - * RSAES-OAEP 3072 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_DECRYPT_OAEP_3072_SHA256 = 9; - */ - const RSA_DECRYPT_OAEP_3072_SHA256 = 9; - /** - * RSAES-OAEP 4096 bit key with a SHA256 digest. - * - * Generated from protobuf enum RSA_DECRYPT_OAEP_4096_SHA256 = 10; - */ - const RSA_DECRYPT_OAEP_4096_SHA256 = 10; - /** - * RSAES-OAEP 4096 bit key with a SHA512 digest. - * - * Generated from protobuf enum RSA_DECRYPT_OAEP_4096_SHA512 = 17; - */ - const RSA_DECRYPT_OAEP_4096_SHA512 = 17; - /** - * RSAES-OAEP 2048 bit key with a SHA1 digest. - * - * Generated from protobuf enum RSA_DECRYPT_OAEP_2048_SHA1 = 37; - */ - const RSA_DECRYPT_OAEP_2048_SHA1 = 37; - /** - * RSAES-OAEP 3072 bit key with a SHA1 digest. - * - * Generated from protobuf enum RSA_DECRYPT_OAEP_3072_SHA1 = 38; - */ - const RSA_DECRYPT_OAEP_3072_SHA1 = 38; - /** - * RSAES-OAEP 4096 bit key with a SHA1 digest. - * - * Generated from protobuf enum RSA_DECRYPT_OAEP_4096_SHA1 = 39; - */ - const RSA_DECRYPT_OAEP_4096_SHA1 = 39; - /** - * ECDSA on the NIST P-256 curve with a SHA256 digest. - * Other hash functions can also be used: - * https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms - * - * Generated from protobuf enum EC_SIGN_P256_SHA256 = 12; - */ - const EC_SIGN_P256_SHA256 = 12; - /** - * ECDSA on the NIST P-384 curve with a SHA384 digest. - * Other hash functions can also be used: - * https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms - * - * Generated from protobuf enum EC_SIGN_P384_SHA384 = 13; - */ - const EC_SIGN_P384_SHA384 = 13; - /** - * ECDSA on the non-NIST secp256k1 curve. This curve is only supported for - * HSM protection level. - * Other hash functions can also be used: - * https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms - * - * Generated from protobuf enum EC_SIGN_SECP256K1_SHA256 = 31; - */ - const EC_SIGN_SECP256K1_SHA256 = 31; - /** - * HMAC-SHA256 signing with a 256 bit key. - * - * Generated from protobuf enum HMAC_SHA256 = 32; - */ - const HMAC_SHA256 = 32; - /** - * HMAC-SHA1 signing with a 160 bit key. - * - * Generated from protobuf enum HMAC_SHA1 = 33; - */ - const HMAC_SHA1 = 33; - /** - * HMAC-SHA384 signing with a 384 bit key. - * - * Generated from protobuf enum HMAC_SHA384 = 34; - */ - const HMAC_SHA384 = 34; - /** - * HMAC-SHA512 signing with a 512 bit key. - * - * Generated from protobuf enum HMAC_SHA512 = 35; - */ - const HMAC_SHA512 = 35; - /** - * HMAC-SHA224 signing with a 224 bit key. - * - * Generated from protobuf enum HMAC_SHA224 = 36; - */ - const HMAC_SHA224 = 36; - /** - * Algorithm representing symmetric encryption by an external key manager. - * - * Generated from protobuf enum EXTERNAL_SYMMETRIC_ENCRYPTION = 18; - */ - const EXTERNAL_SYMMETRIC_ENCRYPTION = 18; - - private static $valueToName = [ - self::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED => 'CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED', - self::GOOGLE_SYMMETRIC_ENCRYPTION => 'GOOGLE_SYMMETRIC_ENCRYPTION', - self::AES_128_GCM => 'AES_128_GCM', - self::AES_256_GCM => 'AES_256_GCM', - self::AES_128_CBC => 'AES_128_CBC', - self::AES_256_CBC => 'AES_256_CBC', - self::AES_128_CTR => 'AES_128_CTR', - self::AES_256_CTR => 'AES_256_CTR', - self::RSA_SIGN_PSS_2048_SHA256 => 'RSA_SIGN_PSS_2048_SHA256', - self::RSA_SIGN_PSS_3072_SHA256 => 'RSA_SIGN_PSS_3072_SHA256', - self::RSA_SIGN_PSS_4096_SHA256 => 'RSA_SIGN_PSS_4096_SHA256', - self::RSA_SIGN_PSS_4096_SHA512 => 'RSA_SIGN_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::RSA_SIGN_RAW_PKCS1_2048 => 'RSA_SIGN_RAW_PKCS1_2048', - self::RSA_SIGN_RAW_PKCS1_3072 => 'RSA_SIGN_RAW_PKCS1_3072', - self::RSA_SIGN_RAW_PKCS1_4096 => 'RSA_SIGN_RAW_PKCS1_4096', - self::RSA_DECRYPT_OAEP_2048_SHA256 => 'RSA_DECRYPT_OAEP_2048_SHA256', - self::RSA_DECRYPT_OAEP_3072_SHA256 => 'RSA_DECRYPT_OAEP_3072_SHA256', - self::RSA_DECRYPT_OAEP_4096_SHA256 => 'RSA_DECRYPT_OAEP_4096_SHA256', - self::RSA_DECRYPT_OAEP_4096_SHA512 => 'RSA_DECRYPT_OAEP_4096_SHA512', - self::RSA_DECRYPT_OAEP_2048_SHA1 => 'RSA_DECRYPT_OAEP_2048_SHA1', - self::RSA_DECRYPT_OAEP_3072_SHA1 => 'RSA_DECRYPT_OAEP_3072_SHA1', - self::RSA_DECRYPT_OAEP_4096_SHA1 => 'RSA_DECRYPT_OAEP_4096_SHA1', - self::EC_SIGN_P256_SHA256 => 'EC_SIGN_P256_SHA256', - self::EC_SIGN_P384_SHA384 => 'EC_SIGN_P384_SHA384', - self::EC_SIGN_SECP256K1_SHA256 => 'EC_SIGN_SECP256K1_SHA256', - self::HMAC_SHA256 => 'HMAC_SHA256', - self::HMAC_SHA1 => 'HMAC_SHA1', - self::HMAC_SHA384 => 'HMAC_SHA384', - self::HMAC_SHA512 => 'HMAC_SHA512', - self::HMAC_SHA224 => 'HMAC_SHA224', - self::EXTERNAL_SYMMETRIC_ENCRYPTION => 'EXTERNAL_SYMMETRIC_ENCRYPTION', - ]; - - 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(CryptoKeyVersionAlgorithm::class, \Google\Cloud\Kms\V1\CryptoKeyVersion_CryptoKeyVersionAlgorithm::class); - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionState.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionState.php deleted file mode 100644 index b4de21be0a7e..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionState.php +++ /dev/null @@ -1,154 +0,0 @@ -google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState - */ -class CryptoKeyVersionState -{ - /** - * Not specified. - * - * Generated from protobuf enum CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0; - */ - const CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0; - /** - * This version is still being generated. It may not be used, enabled, - * disabled, or destroyed yet. Cloud KMS will automatically mark this - * version - * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] - * as soon as the version is ready. - * - * Generated from protobuf enum PENDING_GENERATION = 5; - */ - const PENDING_GENERATION = 5; - /** - * This version may be used for cryptographic operations. - * - * Generated from protobuf enum ENABLED = 1; - */ - const ENABLED = 1; - /** - * This version may not be used, but the key material is still available, - * and the version can be placed back into the - * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] - * state. - * - * Generated from protobuf enum DISABLED = 2; - */ - const DISABLED = 2; - /** - * This version is destroyed, and the key material is no longer stored. - * This version may only become - * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] - * again if this version is - * [reimport_eligible][google.cloud.kms.v1.CryptoKeyVersion.reimport_eligible] - * and the original key material is reimported with a call to - * [KeyManagementService.ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion]. - * - * Generated from protobuf enum DESTROYED = 3; - */ - const DESTROYED = 3; - /** - * This version is scheduled for destruction, and will be destroyed soon. - * Call - * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] - * to put it back into the - * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] - * state. - * - * Generated from protobuf enum DESTROY_SCHEDULED = 4; - */ - const DESTROY_SCHEDULED = 4; - /** - * This version is still being imported. It may not be used, enabled, - * disabled, or destroyed yet. Cloud KMS will automatically mark this - * version - * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] - * as soon as the version is ready. - * - * Generated from protobuf enum PENDING_IMPORT = 6; - */ - const PENDING_IMPORT = 6; - /** - * This version was not imported successfully. It may not be used, enabled, - * disabled, or destroyed. The submitted key material has been discarded. - * Additional details can be found in - * [CryptoKeyVersion.import_failure_reason][google.cloud.kms.v1.CryptoKeyVersion.import_failure_reason]. - * - * Generated from protobuf enum IMPORT_FAILED = 7; - */ - const IMPORT_FAILED = 7; - /** - * This version was not generated successfully. It may not be used, enabled, - * disabled, or destroyed. Additional details can be found in - * [CryptoKeyVersion.generation_failure_reason][google.cloud.kms.v1.CryptoKeyVersion.generation_failure_reason]. - * - * Generated from protobuf enum GENERATION_FAILED = 8; - */ - const GENERATION_FAILED = 8; - /** - * This version was destroyed, and it may not be used or enabled again. - * Cloud KMS is waiting for the corresponding key material residing in an - * external key manager to be destroyed. - * - * Generated from protobuf enum PENDING_EXTERNAL_DESTRUCTION = 9; - */ - const PENDING_EXTERNAL_DESTRUCTION = 9; - /** - * This version was destroyed, and it may not be used or enabled again. - * However, Cloud KMS could not confirm that the corresponding key material - * residing in an external key manager was destroyed. Additional details can - * be found in - * [CryptoKeyVersion.external_destruction_failure_reason][google.cloud.kms.v1.CryptoKeyVersion.external_destruction_failure_reason]. - * - * Generated from protobuf enum EXTERNAL_DESTRUCTION_FAILED = 10; - */ - const EXTERNAL_DESTRUCTION_FAILED = 10; - - private static $valueToName = [ - self::CRYPTO_KEY_VERSION_STATE_UNSPECIFIED => 'CRYPTO_KEY_VERSION_STATE_UNSPECIFIED', - self::PENDING_GENERATION => 'PENDING_GENERATION', - self::ENABLED => 'ENABLED', - self::DISABLED => 'DISABLED', - self::DESTROYED => 'DESTROYED', - self::DESTROY_SCHEDULED => 'DESTROY_SCHEDULED', - self::PENDING_IMPORT => 'PENDING_IMPORT', - self::IMPORT_FAILED => 'IMPORT_FAILED', - self::GENERATION_FAILED => 'GENERATION_FAILED', - self::PENDING_EXTERNAL_DESTRUCTION => 'PENDING_EXTERNAL_DESTRUCTION', - self::EXTERNAL_DESTRUCTION_FAILED => 'EXTERNAL_DESTRUCTION_FAILED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CryptoKeyVersionState::class, \Google\Cloud\Kms\V1\CryptoKeyVersion_CryptoKeyVersionState::class); - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionView.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionView.php deleted file mode 100644 index 33a471de9ad7..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersion/CryptoKeyVersionView.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView - */ -class CryptoKeyVersionView -{ - /** - * Default view for each - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Does not - * include the - * [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation] field. - * - * Generated from protobuf enum CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0; - */ - const CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0; - /** - * Provides all fields in each - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], including the - * [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation]. - * - * Generated from protobuf enum FULL = 1; - */ - const FULL = 1; - - private static $valueToName = [ - self::CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED => 'CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED', - self::FULL => 'FULL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CryptoKeyVersionView::class, \Google\Cloud\Kms\V1\CryptoKeyVersion_CryptoKeyVersionView::class); - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersionTemplate.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersionTemplate.php deleted file mode 100644 index 6f88091103eb..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/CryptoKeyVersionTemplate.php +++ /dev/null @@ -1,150 +0,0 @@ -google.cloud.kms.v1.CryptoKeyVersionTemplate - */ -class CryptoKeyVersionTemplate extends \Google\Protobuf\Internal\Message -{ - /** - * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating - * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this - * template. Immutable. Defaults to - * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE]. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 1; - */ - protected $protection_level = 0; - /** - * Required. - * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * to use when creating a - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this - * template. - * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both - * this field is omitted and - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $algorithm = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $protection_level - * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating - * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this - * template. Immutable. Defaults to - * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE]. - * @type int $algorithm - * Required. - * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * to use when creating a - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this - * template. - * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both - * this field is omitted and - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating - * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this - * template. Immutable. Defaults to - * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE]. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 1; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating - * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this - * template. Immutable. Defaults to - * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE]. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 1; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - - /** - * Required. - * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * to use when creating a - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this - * template. - * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both - * this field is omitted and - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getAlgorithm() - { - return $this->algorithm; - } - - /** - * Required. - * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * to use when creating a - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this - * template. - * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both - * this field is omitted and - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setAlgorithm($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionAlgorithm::class); - $this->algorithm = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptRequest.php deleted file mode 100644 index 86cf3cc753e8..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptRequest.php +++ /dev/null @@ -1,529 +0,0 @@ -google.cloud.kms.v1.DecryptRequest - */ -class DecryptRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The - * server will choose the appropriate version. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The encrypted data originally returned in - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * - * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $ciphertext = ''; - /** - * Optional. Optional data that must match the data originally supplied in - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $additional_authenticated_data = ''; - /** - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) - * is equal to - * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ciphertext_crc32c = null; - /** - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) - * is equal to - * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $additional_authenticated_data_crc32c = null; - - /** - * @param string $name Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The - * server will choose the appropriate version. Please see - * {@see KeyManagementServiceClient::cryptoKeyName()} for help formatting this field. - * @param string $ciphertext Required. The encrypted data originally returned in - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * - * @return \Google\Cloud\Kms\V1\DecryptRequest - * - * @experimental - */ - public static function build(string $name, string $ciphertext): self - { - return (new self()) - ->setName($name) - ->setCiphertext($ciphertext); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The - * server will choose the appropriate version. - * @type string $ciphertext - * Required. The encrypted data originally returned in - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * @type string $additional_authenticated_data - * Optional. Optional data that must match the data originally supplied in - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * @type \Google\Protobuf\Int64Value $ciphertext_crc32c - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) - * is equal to - * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type \Google\Protobuf\Int64Value $additional_authenticated_data_crc32c - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) - * is equal to - * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The - * server will choose the appropriate version. - * - * 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 - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The - * server will choose the appropriate version. - * - * 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; - } - - /** - * Required. The encrypted data originally returned in - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * - * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCiphertext() - { - return $this->ciphertext; - } - - /** - * Required. The encrypted data originally returned in - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * - * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCiphertext($var) - { - GPBUtil::checkString($var, False); - $this->ciphertext = $var; - - return $this; - } - - /** - * Optional. Optional data that must match the data originally supplied in - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAdditionalAuthenticatedData() - { - return $this->additional_authenticated_data; - } - - /** - * Optional. Optional data that must match the data originally supplied in - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAdditionalAuthenticatedData($var) - { - GPBUtil::checkString($var, False); - $this->additional_authenticated_data = $var; - - return $this; - } - - /** - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) - * is equal to - * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getCiphertextCrc32C() - { - return $this->ciphertext_crc32c; - } - - public function hasCiphertextCrc32C() - { - return isset($this->ciphertext_crc32c); - } - - public function clearCiphertextCrc32C() - { - unset($this->ciphertext_crc32c); - } - - /** - * Returns the unboxed value from getCiphertextCrc32C() - - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) - * is equal to - * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getCiphertextCrc32CUnwrapped() - { - return $this->readWrapperValue("ciphertext_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) - * is equal to - * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setCiphertextCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->ciphertext_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) - * is equal to - * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setCiphertextCrc32CUnwrapped($var) - { - $this->writeWrapperValue("ciphertext_crc32c", $var); - return $this;} - - /** - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) - * is equal to - * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getAdditionalAuthenticatedDataCrc32C() - { - return $this->additional_authenticated_data_crc32c; - } - - public function hasAdditionalAuthenticatedDataCrc32C() - { - return isset($this->additional_authenticated_data_crc32c); - } - - public function clearAdditionalAuthenticatedDataCrc32C() - { - unset($this->additional_authenticated_data_crc32c); - } - - /** - * Returns the unboxed value from getAdditionalAuthenticatedDataCrc32C() - - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) - * is equal to - * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getAdditionalAuthenticatedDataCrc32CUnwrapped() - { - return $this->readWrapperValue("additional_authenticated_data_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) - * is equal to - * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setAdditionalAuthenticatedDataCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->additional_authenticated_data_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) - * is equal to - * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setAdditionalAuthenticatedDataCrc32CUnwrapped($var) - { - $this->writeWrapperValue("additional_authenticated_data_crc32c", $var); - return $this;} - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptResponse.php deleted file mode 100644 index 3910ec3ae0eb..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DecryptResponse.php +++ /dev/null @@ -1,315 +0,0 @@ -google.cloud.kms.v1.DecryptResponse - */ -class DecryptResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The decrypted data originally supplied in - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. - * - * Generated from protobuf field bytes plaintext = 1; - */ - protected $plaintext = ''; - /** - * Integrity verification field. A CRC32C checksum of the returned - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. - * An integrity check of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: receiving this response message indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - */ - protected $plaintext_crc32c = null; - /** - * Whether the Decryption was performed using the primary key version. - * - * Generated from protobuf field bool used_primary = 3; - */ - protected $used_primary = false; - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; - */ - protected $protection_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $plaintext - * The decrypted data originally supplied in - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. - * @type \Google\Protobuf\Int64Value $plaintext_crc32c - * Integrity verification field. A CRC32C checksum of the returned - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. - * An integrity check of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: receiving this response message indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type bool $used_primary - * Whether the Decryption was performed using the primary key version. - * @type int $protection_level - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The decrypted data originally supplied in - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. - * - * Generated from protobuf field bytes plaintext = 1; - * @return string - */ - public function getPlaintext() - { - return $this->plaintext; - } - - /** - * The decrypted data originally supplied in - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. - * - * Generated from protobuf field bytes plaintext = 1; - * @param string $var - * @return $this - */ - public function setPlaintext($var) - { - GPBUtil::checkString($var, False); - $this->plaintext = $var; - - return $this; - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. - * An integrity check of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: receiving this response message indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @return \Google\Protobuf\Int64Value|null - */ - public function getPlaintextCrc32C() - { - return $this->plaintext_crc32c; - } - - public function hasPlaintextCrc32C() - { - return isset($this->plaintext_crc32c); - } - - public function clearPlaintextCrc32C() - { - unset($this->plaintext_crc32c); - } - - /** - * Returns the unboxed value from getPlaintextCrc32C() - - * Integrity verification field. A CRC32C checksum of the returned - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. - * An integrity check of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: receiving this response message indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @return int|string|null - */ - public function getPlaintextCrc32CUnwrapped() - { - return $this->readWrapperValue("plaintext_crc32c"); - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. - * An integrity check of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: receiving this response message indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setPlaintextCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->plaintext_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Integrity verification field. A CRC32C checksum of the returned - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]. - * An integrity check of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * can be performed by computing the CRC32C checksum of - * [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: receiving this response message indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @param int|string|null $var - * @return $this - */ - public function setPlaintextCrc32CUnwrapped($var) - { - $this->writeWrapperValue("plaintext_crc32c", $var); - return $this;} - - /** - * Whether the Decryption was performed using the primary key version. - * - * Generated from protobuf field bool used_primary = 3; - * @return bool - */ - public function getUsedPrimary() - { - return $this->used_primary; - } - - /** - * Whether the Decryption was performed using the primary key version. - * - * Generated from protobuf field bool used_primary = 3; - * @param bool $var - * @return $this - */ - public function setUsedPrimary($var) - { - GPBUtil::checkBool($var); - $this->used_primary = $var; - - return $this; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 4; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DestroyCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DestroyCryptoKeyVersionRequest.php deleted file mode 100644 index 71fbcb00be4b..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/DestroyCryptoKeyVersionRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - */ -class DestroyCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. Please see - * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\DestroyCryptoKeyVersionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. - * - * 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 - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. - * - * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Digest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Digest.php deleted file mode 100644 index 90201ffc30de..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/Digest.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.kms.v1.Digest - */ -class Digest extends \Google\Protobuf\Internal\Message -{ - protected $digest; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $sha256 - * A message digest produced with the SHA-256 algorithm. - * @type string $sha384 - * A message digest produced with the SHA-384 algorithm. - * @type string $sha512 - * A message digest produced with the SHA-512 algorithm. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * A message digest produced with the SHA-256 algorithm. - * - * Generated from protobuf field bytes sha256 = 1; - * @return string - */ - public function getSha256() - { - return $this->readOneof(1); - } - - public function hasSha256() - { - return $this->hasOneof(1); - } - - /** - * A message digest produced with the SHA-256 algorithm. - * - * Generated from protobuf field bytes sha256 = 1; - * @param string $var - * @return $this - */ - public function setSha256($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * A message digest produced with the SHA-384 algorithm. - * - * Generated from protobuf field bytes sha384 = 2; - * @return string - */ - public function getSha384() - { - return $this->readOneof(2); - } - - public function hasSha384() - { - return $this->hasOneof(2); - } - - /** - * A message digest produced with the SHA-384 algorithm. - * - * Generated from protobuf field bytes sha384 = 2; - * @param string $var - * @return $this - */ - public function setSha384($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * A message digest produced with the SHA-512 algorithm. - * - * Generated from protobuf field bytes sha512 = 3; - * @return string - */ - public function getSha512() - { - return $this->readOneof(3); - } - - public function hasSha512() - { - return $this->hasOneof(3); - } - - /** - * A message digest produced with the SHA-512 algorithm. - * - * Generated from protobuf field bytes sha512 = 3; - * @param string $var - * @return $this - */ - public function setSha512($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getDigest() - { - return $this->whichOneof("digest"); - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConfig.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConfig.php deleted file mode 100644 index 92325efb4514..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConfig.php +++ /dev/null @@ -1,123 +0,0 @@ -google.cloud.kms.v1.EkmConfig - */ -class EkmConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name for the - * [EkmConfig][google.cloud.kms.v1.EkmConfig] in the format - * `projects/*/locations/*/ekmConfig`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Optional. Resource name of the default - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. Setting this field to - * the empty string removes the default. - * - * Generated from protobuf field string default_ekm_connection = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $default_ekm_connection = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name for the - * [EkmConfig][google.cloud.kms.v1.EkmConfig] in the format - * `projects/*/locations/*/ekmConfig`. - * @type string $default_ekm_connection - * Optional. Resource name of the default - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. Setting this field to - * the empty string removes the default. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name for the - * [EkmConfig][google.cloud.kms.v1.EkmConfig] in the format - * `projects/*/locations/*/ekmConfig`. - * - * 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 for the - * [EkmConfig][google.cloud.kms.v1.EkmConfig] in the format - * `projects/*/locations/*/ekmConfig`. - * - * 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. Resource name of the default - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. Setting this field to - * the empty string removes the default. - * - * Generated from protobuf field string default_ekm_connection = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getDefaultEkmConnection() - { - return $this->default_ekm_connection; - } - - /** - * Optional. Resource name of the default - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. Setting this field to - * the empty string removes the default. - * - * Generated from protobuf field string default_ekm_connection = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setDefaultEkmConnection($var) - { - GPBUtil::checkString($var, True); - $this->default_ekm_connection = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection.php deleted file mode 100644 index d8bbf9c4606f..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection.php +++ /dev/null @@ -1,314 +0,0 @@ -google.cloud.kms.v1.EkmConnection - */ -class EkmConnection extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name for the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] in the format - * `projects/*/locations/*/ekmConnections/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. The time at which the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * A list of - * [ServiceResolvers][google.cloud.kms.v1.EkmConnection.ServiceResolver] where - * the EKM can be reached. There should be one ServiceResolver per EKM - * replica. Currently, only a single - * [ServiceResolver][google.cloud.kms.v1.EkmConnection.ServiceResolver] is - * supported. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection.ServiceResolver service_resolvers = 3; - */ - private $service_resolvers; - /** - * Optional. Etag of the currently stored - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * - * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $etag = ''; - /** - * Optional. Describes who can perform control plane operations on the EKM. If - * unset, this defaults to - * [MANUAL][google.cloud.kms.v1.EkmConnection.KeyManagementMode.MANUAL]. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConnection.KeyManagementMode key_management_mode = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $key_management_mode = 0; - /** - * Optional. Identifies the EKM Crypto Space that this - * [EkmConnection][google.cloud.kms.v1.EkmConnection] maps to. Note: This - * field is required if - * [KeyManagementMode][google.cloud.kms.v1.EkmConnection.KeyManagementMode] is - * [CLOUD_KMS][google.cloud.kms.v1.EkmConnection.KeyManagementMode.CLOUD_KMS]. - * - * Generated from protobuf field string crypto_space_path = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $crypto_space_path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name for the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] in the format - * `projects/*/locations/*/ekmConnections/*`. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time at which the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] was created. - * @type array<\Google\Cloud\Kms\V1\EkmConnection\ServiceResolver>|\Google\Protobuf\Internal\RepeatedField $service_resolvers - * A list of - * [ServiceResolvers][google.cloud.kms.v1.EkmConnection.ServiceResolver] where - * the EKM can be reached. There should be one ServiceResolver per EKM - * replica. Currently, only a single - * [ServiceResolver][google.cloud.kms.v1.EkmConnection.ServiceResolver] is - * supported. - * @type string $etag - * Optional. Etag of the currently stored - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * @type int $key_management_mode - * Optional. Describes who can perform control plane operations on the EKM. If - * unset, this defaults to - * [MANUAL][google.cloud.kms.v1.EkmConnection.KeyManagementMode.MANUAL]. - * @type string $crypto_space_path - * Optional. Identifies the EKM Crypto Space that this - * [EkmConnection][google.cloud.kms.v1.EkmConnection] maps to. Note: This - * field is required if - * [KeyManagementMode][google.cloud.kms.v1.EkmConnection.KeyManagementMode] is - * [CLOUD_KMS][google.cloud.kms.v1.EkmConnection.KeyManagementMode.CLOUD_KMS]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name for the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] in the format - * `projects/*/locations/*/ekmConnections/*`. - * - * 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 for the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] in the format - * `projects/*/locations/*/ekmConnections/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time at which the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time at which the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * A list of - * [ServiceResolvers][google.cloud.kms.v1.EkmConnection.ServiceResolver] where - * the EKM can be reached. There should be one ServiceResolver per EKM - * replica. Currently, only a single - * [ServiceResolver][google.cloud.kms.v1.EkmConnection.ServiceResolver] is - * supported. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection.ServiceResolver service_resolvers = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServiceResolvers() - { - return $this->service_resolvers; - } - - /** - * A list of - * [ServiceResolvers][google.cloud.kms.v1.EkmConnection.ServiceResolver] where - * the EKM can be reached. There should be one ServiceResolver per EKM - * replica. Currently, only a single - * [ServiceResolver][google.cloud.kms.v1.EkmConnection.ServiceResolver] is - * supported. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection.ServiceResolver service_resolvers = 3; - * @param array<\Google\Cloud\Kms\V1\EkmConnection\ServiceResolver>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServiceResolvers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\EkmConnection\ServiceResolver::class); - $this->service_resolvers = $arr; - - return $this; - } - - /** - * Optional. Etag of the currently stored - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * - * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. Etag of the currently stored - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * - * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. Describes who can perform control plane operations on the EKM. If - * unset, this defaults to - * [MANUAL][google.cloud.kms.v1.EkmConnection.KeyManagementMode.MANUAL]. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConnection.KeyManagementMode key_management_mode = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getKeyManagementMode() - { - return $this->key_management_mode; - } - - /** - * Optional. Describes who can perform control plane operations on the EKM. If - * unset, this defaults to - * [MANUAL][google.cloud.kms.v1.EkmConnection.KeyManagementMode.MANUAL]. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConnection.KeyManagementMode key_management_mode = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setKeyManagementMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\EkmConnection\KeyManagementMode::class); - $this->key_management_mode = $var; - - return $this; - } - - /** - * Optional. Identifies the EKM Crypto Space that this - * [EkmConnection][google.cloud.kms.v1.EkmConnection] maps to. Note: This - * field is required if - * [KeyManagementMode][google.cloud.kms.v1.EkmConnection.KeyManagementMode] is - * [CLOUD_KMS][google.cloud.kms.v1.EkmConnection.KeyManagementMode.CLOUD_KMS]. - * - * Generated from protobuf field string crypto_space_path = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCryptoSpacePath() - { - return $this->crypto_space_path; - } - - /** - * Optional. Identifies the EKM Crypto Space that this - * [EkmConnection][google.cloud.kms.v1.EkmConnection] maps to. Note: This - * field is required if - * [KeyManagementMode][google.cloud.kms.v1.EkmConnection.KeyManagementMode] is - * [CLOUD_KMS][google.cloud.kms.v1.EkmConnection.KeyManagementMode.CLOUD_KMS]. - * - * Generated from protobuf field string crypto_space_path = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCryptoSpacePath($var) - { - GPBUtil::checkString($var, True); - $this->crypto_space_path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/KeyManagementMode.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/KeyManagementMode.php deleted file mode 100644 index 03dd23462c6c..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/KeyManagementMode.php +++ /dev/null @@ -1,90 +0,0 @@ -google.cloud.kms.v1.EkmConnection.KeyManagementMode - */ -class KeyManagementMode -{ - /** - * Not specified. - * - * Generated from protobuf enum KEY_MANAGEMENT_MODE_UNSPECIFIED = 0; - */ - const KEY_MANAGEMENT_MODE_UNSPECIFIED = 0; - /** - * EKM-side key management operations on - * [CryptoKeys][google.cloud.kms.v1.CryptoKey] created with this - * [EkmConnection][google.cloud.kms.v1.EkmConnection] must be initiated from - * the EKM directly and cannot be performed from Cloud KMS. This means that: - * * When creating a - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] associated with - * this - * [EkmConnection][google.cloud.kms.v1.EkmConnection], the caller must - * supply the key path of pre-existing external key material that will be - * linked to the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * * Destruction of external key material cannot be requested via the - * Cloud KMS API and must be performed directly in the EKM. - * * Automatic rotation of key material is not supported. - * - * Generated from protobuf enum MANUAL = 1; - */ - const MANUAL = 1; - /** - * All [CryptoKeys][google.cloud.kms.v1.CryptoKey] created with this - * [EkmConnection][google.cloud.kms.v1.EkmConnection] use EKM-side key - * management operations initiated from Cloud KMS. This means that: - * * When a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * associated with this [EkmConnection][google.cloud.kms.v1.EkmConnection] - * is - * created, the EKM automatically generates new key material and a new - * key path. The caller cannot supply the key path of pre-existing - * external key material. - * * Destruction of external key material associated with this - * [EkmConnection][google.cloud.kms.v1.EkmConnection] can be requested by - * calling [DestroyCryptoKeyVersion][EkmService.DestroyCryptoKeyVersion]. - * * Automatic rotation of key material is supported. - * - * Generated from protobuf enum CLOUD_KMS = 2; - */ - const CLOUD_KMS = 2; - - private static $valueToName = [ - self::KEY_MANAGEMENT_MODE_UNSPECIFIED => 'KEY_MANAGEMENT_MODE_UNSPECIFIED', - self::MANUAL => 'MANUAL', - self::CLOUD_KMS => 'CLOUD_KMS', - ]; - - 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(KeyManagementMode::class, \Google\Cloud\Kms\V1\EkmConnection_KeyManagementMode::class); - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/ServiceResolver.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/ServiceResolver.php deleted file mode 100644 index 37e72fe4b1a8..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EkmConnection/ServiceResolver.php +++ /dev/null @@ -1,206 +0,0 @@ -google.cloud.kms.v1.EkmConnection.ServiceResolver - */ -class ServiceResolver extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Service Directory service pointing to - * an EKM replica, in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * - * Generated from protobuf field string service_directory_service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $service_directory_service = ''; - /** - * Optional. The filter applied to the endpoints of the resolved service. If - * no filter is specified, all endpoints will be considered. An endpoint - * will be chosen arbitrarily from the filtered list for each request. - * For endpoint filter syntax and examples, see - * https://cloud.google.com/service-directory/docs/reference/rpc/google.cloud.servicedirectory.v1#resolveservicerequest. - * - * Generated from protobuf field string endpoint_filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $endpoint_filter = ''; - /** - * Required. The hostname of the EKM replica used at TLS and HTTP layers. - * - * Generated from protobuf field string hostname = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $hostname = ''; - /** - * Required. A list of leaf server certificates used to authenticate HTTPS - * connections to the EKM replica. Currently, a maximum of 10 - * [Certificate][google.cloud.kms.v1.Certificate] is supported. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.Certificate server_certificates = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $server_certificates; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service_directory_service - * Required. The resource name of the Service Directory service pointing to - * an EKM replica, in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * @type string $endpoint_filter - * Optional. The filter applied to the endpoints of the resolved service. If - * no filter is specified, all endpoints will be considered. An endpoint - * will be chosen arbitrarily from the filtered list for each request. - * For endpoint filter syntax and examples, see - * https://cloud.google.com/service-directory/docs/reference/rpc/google.cloud.servicedirectory.v1#resolveservicerequest. - * @type string $hostname - * Required. The hostname of the EKM replica used at TLS and HTTP layers. - * @type array<\Google\Cloud\Kms\V1\Certificate>|\Google\Protobuf\Internal\RepeatedField $server_certificates - * Required. A list of leaf server certificates used to authenticate HTTPS - * connections to the EKM replica. Currently, a maximum of 10 - * [Certificate][google.cloud.kms.v1.Certificate] is supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Service Directory service pointing to - * an EKM replica, in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * - * Generated from protobuf field string service_directory_service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getServiceDirectoryService() - { - return $this->service_directory_service; - } - - /** - * Required. The resource name of the Service Directory service pointing to - * an EKM replica, in the format - * `projects/*/locations/*/namespaces/*/services/*`. - * - * Generated from protobuf field string service_directory_service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceDirectoryService($var) - { - GPBUtil::checkString($var, True); - $this->service_directory_service = $var; - - return $this; - } - - /** - * Optional. The filter applied to the endpoints of the resolved service. If - * no filter is specified, all endpoints will be considered. An endpoint - * will be chosen arbitrarily from the filtered list for each request. - * For endpoint filter syntax and examples, see - * https://cloud.google.com/service-directory/docs/reference/rpc/google.cloud.servicedirectory.v1#resolveservicerequest. - * - * Generated from protobuf field string endpoint_filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEndpointFilter() - { - return $this->endpoint_filter; - } - - /** - * Optional. The filter applied to the endpoints of the resolved service. If - * no filter is specified, all endpoints will be considered. An endpoint - * will be chosen arbitrarily from the filtered list for each request. - * For endpoint filter syntax and examples, see - * https://cloud.google.com/service-directory/docs/reference/rpc/google.cloud.servicedirectory.v1#resolveservicerequest. - * - * Generated from protobuf field string endpoint_filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEndpointFilter($var) - { - GPBUtil::checkString($var, True); - $this->endpoint_filter = $var; - - return $this; - } - - /** - * Required. The hostname of the EKM replica used at TLS and HTTP layers. - * - * Generated from protobuf field string hostname = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getHostname() - { - return $this->hostname; - } - - /** - * Required. The hostname of the EKM replica used at TLS and HTTP layers. - * - * Generated from protobuf field string hostname = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setHostname($var) - { - GPBUtil::checkString($var, True); - $this->hostname = $var; - - return $this; - } - - /** - * Required. A list of leaf server certificates used to authenticate HTTPS - * connections to the EKM replica. Currently, a maximum of 10 - * [Certificate][google.cloud.kms.v1.Certificate] is supported. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.Certificate server_certificates = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServerCertificates() - { - return $this->server_certificates; - } - - /** - * Required. A list of leaf server certificates used to authenticate HTTPS - * connections to the EKM replica. Currently, a maximum of 10 - * [Certificate][google.cloud.kms.v1.Certificate] is supported. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.Certificate server_certificates = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Kms\V1\Certificate>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServerCertificates($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\Certificate::class); - $this->server_certificates = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ServiceResolver::class, \Google\Cloud\Kms\V1\EkmConnection_ServiceResolver::class); - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptRequest.php deleted file mode 100644 index 54a6c404dbc8..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptRequest.php +++ /dev/null @@ -1,625 +0,0 @@ -google.cloud.kms.v1.EncryptRequest - */ -class EncryptRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] or - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * encryption. - * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server - * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The data to encrypt. Must be no larger than 64KiB. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and - * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $plaintext = ''; - /** - * Optional. Optional data that, if specified, must also be provided during - * decryption through - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and - * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the - * AAD must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $additional_authenticated_data = ''; - /** - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) - * is equal to - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $plaintext_crc32c = null; - /** - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) - * is equal to - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $additional_authenticated_data_crc32c = null; - - /** - * @param string $name Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] or - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * encryption. - * - * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server - * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. - * @param string $plaintext Required. The data to encrypt. Must be no larger than 64KiB. - * - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and - * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * @return \Google\Cloud\Kms\V1\EncryptRequest - * - * @experimental - */ - public static function build(string $name, string $plaintext): self - { - return (new self()) - ->setName($name) - ->setPlaintext($plaintext); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] or - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * encryption. - * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server - * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. - * @type string $plaintext - * Required. The data to encrypt. Must be no larger than 64KiB. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and - * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * @type string $additional_authenticated_data - * Optional. Optional data that, if specified, must also be provided during - * decryption through - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and - * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the - * AAD must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * @type \Google\Protobuf\Int64Value $plaintext_crc32c - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) - * is equal to - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type \Google\Protobuf\Int64Value $additional_authenticated_data_crc32c - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) - * is equal to - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] or - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * encryption. - * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server - * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. - * - * 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 - * [CryptoKey][google.cloud.kms.v1.CryptoKey] or - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * encryption. - * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server - * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. - * - * 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; - } - - /** - * Required. The data to encrypt. Must be no larger than 64KiB. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and - * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getPlaintext() - { - return $this->plaintext; - } - - /** - * Required. The data to encrypt. Must be no larger than 64KiB. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and - * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setPlaintext($var) - { - GPBUtil::checkString($var, False); - $this->plaintext = $var; - - return $this; - } - - /** - * Optional. Optional data that, if specified, must also be provided during - * decryption through - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and - * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the - * AAD must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAdditionalAuthenticatedData() - { - return $this->additional_authenticated_data; - } - - /** - * Optional. Optional data that, if specified, must also be provided during - * decryption through - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and - * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the - * AAD must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAdditionalAuthenticatedData($var) - { - GPBUtil::checkString($var, False); - $this->additional_authenticated_data = $var; - - return $this; - } - - /** - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) - * is equal to - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getPlaintextCrc32C() - { - return $this->plaintext_crc32c; - } - - public function hasPlaintextCrc32C() - { - return isset($this->plaintext_crc32c); - } - - public function clearPlaintextCrc32C() - { - unset($this->plaintext_crc32c); - } - - /** - * Returns the unboxed value from getPlaintextCrc32C() - - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) - * is equal to - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getPlaintextCrc32CUnwrapped() - { - return $this->readWrapperValue("plaintext_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) - * is equal to - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setPlaintextCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->plaintext_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) - * is equal to - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setPlaintextCrc32CUnwrapped($var) - { - $this->writeWrapperValue("plaintext_crc32c", $var); - return $this;} - - /** - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) - * is equal to - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getAdditionalAuthenticatedDataCrc32C() - { - return $this->additional_authenticated_data_crc32c; - } - - public function hasAdditionalAuthenticatedDataCrc32C() - { - return isset($this->additional_authenticated_data_crc32c); - } - - public function clearAdditionalAuthenticatedDataCrc32C() - { - unset($this->additional_authenticated_data_crc32c); - } - - /** - * Returns the unboxed value from getAdditionalAuthenticatedDataCrc32C() - - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) - * is equal to - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getAdditionalAuthenticatedDataCrc32CUnwrapped() - { - return $this->readWrapperValue("additional_authenticated_data_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) - * is equal to - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setAdditionalAuthenticatedDataCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->additional_authenticated_data_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) - * is equal to - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setAdditionalAuthenticatedDataCrc32CUnwrapped($var) - { - $this->writeWrapperValue("additional_authenticated_data_crc32c", $var); - return $this;} - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptResponse.php deleted file mode 100644 index 7a18418344b6..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/EncryptResponse.php +++ /dev/null @@ -1,471 +0,0 @@ -google.cloud.kms.v1.EncryptResponse - */ -class EncryptResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. Check this field to verify that the intended resource was used - * for encryption. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The encrypted data. - * - * Generated from protobuf field bytes ciphertext = 2; - */ - protected $ciphertext = ''; - /** - * Integrity verification field. A CRC32C checksum of the returned - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * An integrity check of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * can be performed by computing the CRC32C checksum of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; - */ - protected $ciphertext_crc32c = null; - /** - * Integrity verification field. A flag indicating whether - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. A false value of - * this field indicates either that - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_plaintext_crc32c = 5; - */ - protected $verified_plaintext_crc32c = false; - /** - * Integrity verification field. A flag indicating whether - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [AAD][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. A - * false value of this field indicates either that - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 6; - */ - protected $verified_additional_authenticated_data_crc32c = false; - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7; - */ - protected $protection_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. Check this field to verify that the intended resource was used - * for encryption. - * @type string $ciphertext - * The encrypted data. - * @type \Google\Protobuf\Int64Value $ciphertext_crc32c - * Integrity verification field. A CRC32C checksum of the returned - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * An integrity check of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * can be performed by computing the CRC32C checksum of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * @type bool $verified_plaintext_crc32c - * Integrity verification field. A flag indicating whether - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. A false value of - * this field indicates either that - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type bool $verified_additional_authenticated_data_crc32c - * Integrity verification field. A flag indicating whether - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [AAD][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. A - * false value of this field indicates either that - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type int $protection_level - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. Check this field to verify that the intended resource was used - * for encryption. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. Check this field to verify that the intended resource was used - * for encryption. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The encrypted data. - * - * Generated from protobuf field bytes ciphertext = 2; - * @return string - */ - public function getCiphertext() - { - return $this->ciphertext; - } - - /** - * The encrypted data. - * - * Generated from protobuf field bytes ciphertext = 2; - * @param string $var - * @return $this - */ - public function setCiphertext($var) - { - GPBUtil::checkString($var, False); - $this->ciphertext = $var; - - return $this; - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * An integrity check of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * can be performed by computing the CRC32C checksum of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; - * @return \Google\Protobuf\Int64Value|null - */ - public function getCiphertextCrc32C() - { - return $this->ciphertext_crc32c; - } - - public function hasCiphertextCrc32C() - { - return isset($this->ciphertext_crc32c); - } - - public function clearCiphertextCrc32C() - { - unset($this->ciphertext_crc32c); - } - - /** - * Returns the unboxed value from getCiphertextCrc32C() - - * Integrity verification field. A CRC32C checksum of the returned - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * An integrity check of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * can be performed by computing the CRC32C checksum of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; - * @return int|string|null - */ - public function getCiphertextCrc32CUnwrapped() - { - return $this->readWrapperValue("ciphertext_crc32c"); - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * An integrity check of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * can be performed by computing the CRC32C checksum of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setCiphertextCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->ciphertext_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Integrity verification field. A CRC32C checksum of the returned - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * An integrity check of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * can be performed by computing the CRC32C checksum of - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; - * @param int|string|null $var - * @return $this - */ - public function setCiphertextCrc32CUnwrapped($var) - { - $this->writeWrapperValue("ciphertext_crc32c", $var); - return $this;} - - /** - * Integrity verification field. A flag indicating whether - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. A false value of - * this field indicates either that - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_plaintext_crc32c = 5; - * @return bool - */ - public function getVerifiedPlaintextCrc32C() - { - return $this->verified_plaintext_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. A false value of - * this field indicates either that - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_plaintext_crc32c = 5; - * @param bool $var - * @return $this - */ - public function setVerifiedPlaintextCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_plaintext_crc32c = $var; - - return $this; - } - - /** - * Integrity verification field. A flag indicating whether - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [AAD][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. A - * false value of this field indicates either that - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 6; - * @return bool - */ - public function getVerifiedAdditionalAuthenticatedDataCrc32C() - { - return $this->verified_additional_authenticated_data_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [AAD][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. A - * false value of this field indicates either that - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 6; - * @param bool $var - * @return $this - */ - public function setVerifiedAdditionalAuthenticatedDataCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_additional_authenticated_data_crc32c = $var; - - return $this; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 7; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ExternalProtectionLevelOptions.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ExternalProtectionLevelOptions.php deleted file mode 100644 index 9a8fb7d4fabb..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ExternalProtectionLevelOptions.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.kms.v1.ExternalProtectionLevelOptions - */ -class ExternalProtectionLevelOptions extends \Google\Protobuf\Internal\Message -{ - /** - * The URI for an external resource that this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents. - * - * Generated from protobuf field string external_key_uri = 1; - */ - protected $external_key_uri = ''; - /** - * The path to the external key material on the EKM when using - * [EkmConnection][google.cloud.kms.v1.EkmConnection] e.g., "v0/my/key". Set - * this field instead of external_key_uri when using an - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * - * Generated from protobuf field string ekm_connection_key_path = 2; - */ - protected $ekm_connection_key_path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $external_key_uri - * The URI for an external resource that this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents. - * @type string $ekm_connection_key_path - * The path to the external key material on the EKM when using - * [EkmConnection][google.cloud.kms.v1.EkmConnection] e.g., "v0/my/key". Set - * this field instead of external_key_uri when using an - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The URI for an external resource that this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents. - * - * Generated from protobuf field string external_key_uri = 1; - * @return string - */ - public function getExternalKeyUri() - { - return $this->external_key_uri; - } - - /** - * The URI for an external resource that this - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents. - * - * Generated from protobuf field string external_key_uri = 1; - * @param string $var - * @return $this - */ - public function setExternalKeyUri($var) - { - GPBUtil::checkString($var, True); - $this->external_key_uri = $var; - - return $this; - } - - /** - * The path to the external key material on the EKM when using - * [EkmConnection][google.cloud.kms.v1.EkmConnection] e.g., "v0/my/key". Set - * this field instead of external_key_uri when using an - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * - * Generated from protobuf field string ekm_connection_key_path = 2; - * @return string - */ - public function getEkmConnectionKeyPath() - { - return $this->ekm_connection_key_path; - } - - /** - * The path to the external key material on the EKM when using - * [EkmConnection][google.cloud.kms.v1.EkmConnection] e.g., "v0/my/key". Set - * this field instead of external_key_uri when using an - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * - * Generated from protobuf field string ekm_connection_key_path = 2; - * @param string $var - * @return $this - */ - public function setEkmConnectionKeyPath($var) - { - GPBUtil::checkString($var, True); - $this->ekm_connection_key_path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesRequest.php deleted file mode 100644 index 695206324a5a..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesRequest.php +++ /dev/null @@ -1,179 +0,0 @@ -google.cloud.kms.v1.GenerateRandomBytesRequest - */ -class GenerateRandomBytesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The project-specific location in which to generate random bytes. - * For example, "projects/my-project/locations/us-central1". - * - * Generated from protobuf field string location = 1; - */ - protected $location = ''; - /** - * The length in bytes of the amount of randomness to retrieve. Minimum 8 - * bytes, maximum 1024 bytes. - * - * Generated from protobuf field int32 length_bytes = 2; - */ - protected $length_bytes = 0; - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when - * generating the random data. Currently, only - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is - * supported. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; - */ - protected $protection_level = 0; - - /** - * @param string $location The project-specific location in which to generate random bytes. - * For example, "projects/my-project/locations/us-central1". - * @param int $lengthBytes The length in bytes of the amount of randomness to retrieve. Minimum 8 - * bytes, maximum 1024 bytes. - * @param int $protectionLevel The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when - * generating the random data. Currently, only - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is - * supported. - * For allowed values, use constants defined on {@see \Google\Cloud\Kms\V1\ProtectionLevel} - * - * @return \Google\Cloud\Kms\V1\GenerateRandomBytesRequest - * - * @experimental - */ - public static function build(string $location, int $lengthBytes, int $protectionLevel): self - { - return (new self()) - ->setLocation($location) - ->setLengthBytes($lengthBytes) - ->setProtectionLevel($protectionLevel); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $location - * The project-specific location in which to generate random bytes. - * For example, "projects/my-project/locations/us-central1". - * @type int $length_bytes - * The length in bytes of the amount of randomness to retrieve. Minimum 8 - * bytes, maximum 1024 bytes. - * @type int $protection_level - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when - * generating the random data. Currently, only - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is - * supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The project-specific location in which to generate random bytes. - * For example, "projects/my-project/locations/us-central1". - * - * Generated from protobuf field string location = 1; - * @return string - */ - public function getLocation() - { - return $this->location; - } - - /** - * The project-specific location in which to generate random bytes. - * For example, "projects/my-project/locations/us-central1". - * - * Generated from protobuf field string location = 1; - * @param string $var - * @return $this - */ - public function setLocation($var) - { - GPBUtil::checkString($var, True); - $this->location = $var; - - return $this; - } - - /** - * The length in bytes of the amount of randomness to retrieve. Minimum 8 - * bytes, maximum 1024 bytes. - * - * Generated from protobuf field int32 length_bytes = 2; - * @return int - */ - public function getLengthBytes() - { - return $this->length_bytes; - } - - /** - * The length in bytes of the amount of randomness to retrieve. Minimum 8 - * bytes, maximum 1024 bytes. - * - * Generated from protobuf field int32 length_bytes = 2; - * @param int $var - * @return $this - */ - public function setLengthBytes($var) - { - GPBUtil::checkInt32($var); - $this->length_bytes = $var; - - return $this; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when - * generating the random data. Currently, only - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is - * supported. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when - * generating the random data. Currently, only - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is - * supported. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesResponse.php deleted file mode 100644 index 4cf4401fde68..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GenerateRandomBytesResponse.php +++ /dev/null @@ -1,211 +0,0 @@ -google.cloud.kms.v1.GenerateRandomBytesResponse - */ -class GenerateRandomBytesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The generated data. - * - * Generated from protobuf field bytes data = 1; - */ - protected $data = ''; - /** - * Integrity verification field. A CRC32C checksum of the returned - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. - * An integrity check of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * can be performed by computing the CRC32C checksum of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3; - */ - protected $data_crc32c = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $data - * The generated data. - * @type \Google\Protobuf\Int64Value $data_crc32c - * Integrity verification field. A CRC32C checksum of the returned - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. - * An integrity check of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * can be performed by computing the CRC32C checksum of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The generated data. - * - * Generated from protobuf field bytes data = 1; - * @return string - */ - public function getData() - { - return $this->data; - } - - /** - * The generated data. - * - * Generated from protobuf field bytes data = 1; - * @param string $var - * @return $this - */ - public function setData($var) - { - GPBUtil::checkString($var, False); - $this->data = $var; - - return $this; - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. - * An integrity check of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * can be performed by computing the CRC32C checksum of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3; - * @return \Google\Protobuf\Int64Value|null - */ - public function getDataCrc32C() - { - return $this->data_crc32c; - } - - public function hasDataCrc32C() - { - return isset($this->data_crc32c); - } - - public function clearDataCrc32C() - { - unset($this->data_crc32c); - } - - /** - * Returns the unboxed value from getDataCrc32C() - - * Integrity verification field. A CRC32C checksum of the returned - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. - * An integrity check of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * can be performed by computing the CRC32C checksum of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3; - * @return int|string|null - */ - public function getDataCrc32CUnwrapped() - { - return $this->readWrapperValue("data_crc32c"); - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. - * An integrity check of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * can be performed by computing the CRC32C checksum of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setDataCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->data_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Integrity verification field. A CRC32C checksum of the returned - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]. - * An integrity check of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * can be performed by computing the CRC32C checksum of - * [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data] - * and comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3; - * @param int|string|null $var - * @return $this - */ - public function setDataCrc32CUnwrapped($var) - { - $this->writeWrapperValue("data_crc32c", $var); - return $this;} - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyRequest.php deleted file mode 100644 index a022fcb8a83f..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.kms.v1.GetCryptoKeyRequest - */ -class GetCryptoKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. Please see - * {@see KeyManagementServiceClient::cryptoKeyName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\GetCryptoKeyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. - * - * 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][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. - * - * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyVersionRequest.php deleted file mode 100644 index 1a7b994be0d8..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetCryptoKeyVersionRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.kms.v1.GetCryptoKeyVersionRequest - */ -class GetCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. Please see - * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\GetCryptoKeyVersionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. - * - * 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][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. - * - * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConfigRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConfigRequest.php deleted file mode 100644 index d51d9230caee..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConfigRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.kms.v1.GetEkmConfigRequest - */ -class GetEkmConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the - * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the - * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. Please see - * {@see EkmServiceClient::ekmConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\GetEkmConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the - * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the - * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. - * - * 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][google.cloud.kms.v1.EkmConfig.name] of the - * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. - * - * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConnectionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConnectionRequest.php deleted file mode 100644 index 8a5e1c04323e..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetEkmConnectionRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.kms.v1.GetEkmConnectionRequest - */ -class GetEkmConnectionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. Please see - * {@see EkmServiceClient::ekmConnectionName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\GetEkmConnectionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. - * - * 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][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. - * - * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetImportJobRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetImportJobRequest.php deleted file mode 100644 index a8f2614ffbbd..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetImportJobRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.kms.v1.GetImportJobRequest - */ -class GetImportJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the - * [ImportJob][google.cloud.kms.v1.ImportJob] to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The [name][google.cloud.kms.v1.ImportJob.name] of the - * [ImportJob][google.cloud.kms.v1.ImportJob] to get. Please see - * {@see KeyManagementServiceClient::importJobName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\GetImportJobRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the - * [ImportJob][google.cloud.kms.v1.ImportJob] to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the - * [ImportJob][google.cloud.kms.v1.ImportJob] to get. - * - * 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][google.cloud.kms.v1.ImportJob.name] of the - * [ImportJob][google.cloud.kms.v1.ImportJob] to get. - * - * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetKeyRingRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetKeyRingRequest.php deleted file mode 100644 index a34ae4a11196..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetKeyRingRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.kms.v1.GetKeyRingRequest - */ -class GetKeyRingRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The [name][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] to get. Please see - * {@see KeyManagementServiceClient::keyRingName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\GetKeyRingRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] to get. - * - * 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][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] to get. - * - * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetPublicKeyRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetPublicKeyRequest.php deleted file mode 100644 index 508c3434e2b9..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/GetPublicKeyRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.kms.v1.GetPublicKeyRequest - */ -class GetPublicKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. Please see - * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\GetPublicKeyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. - * - * 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][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. - * - * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportCryptoKeyVersionRequest.php deleted file mode 100644 index 9018eb71ff7e..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportCryptoKeyVersionRequest.php +++ /dev/null @@ -1,491 +0,0 @@ -google.cloud.kms.v1.ImportCryptoKeyVersionRequest - */ -class ImportCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to be imported into. - * The create permission is only required on this key when creating a new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The optional [name][google.cloud.kms.v1.CryptoKeyVersion.name] of - * an existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to - * target for an import operation. If this field is not present, a new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] containing the - * supplied key material is created. - * If this field is present, the supplied key material is imported into - * the existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. To - * import into an existing - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must be a child of - * [ImportCryptoKeyVersionRequest.parent][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.parent], - * have been previously created via [ImportCryptoKeyVersion][], and be in - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED] - * or - * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED] - * state. The key material and algorithm must match the previous - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] exactly if the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] has ever contained - * key material. - * - * Generated from protobuf field string crypto_key_version = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $crypto_key_version = ''; - /** - * Required. The - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * of the key being imported. This does not need to match the - * [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] this version imports into. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $algorithm = 0; - /** - * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the - * [ImportJob][google.cloud.kms.v1.ImportJob] that was used to wrap this key - * material. - * - * Generated from protobuf field string import_job = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $import_job = ''; - /** - * Optional. The wrapped key material to import. - * Before wrapping, key material must be formatted. If importing symmetric key - * material, the expected key material format is plain bytes. If importing - * asymmetric key material, the expected key material format is PKCS#8-encoded - * DER (the PrivateKeyInfo structure from RFC 5208). - * When wrapping with import methods - * ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256] - * or - * [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256] - * or - * [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256] - * or - * [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]), - * this field must contain the concatenation of: - *
    - *
  1. An ephemeral AES-256 wrapping key wrapped with the - * [public_key][google.cloud.kms.v1.ImportJob.public_key] using - * RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty - * label. - *
  2. - *
  3. The formatted key to be imported, wrapped with the ephemeral AES-256 - * key using AES-KWP (RFC 5649). - *
  4. - *
- * This format is the same as the format produced by PKCS#11 mechanism - * CKM_RSA_AES_KEY_WRAP. - * When wrapping with import methods - * ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256] - * or - * [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]), - * this field must contain the formatted key to be imported, wrapped with the - * [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP - * with SHA-256, MGF1 with SHA-256, and an empty label. - * - * Generated from protobuf field bytes wrapped_key = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $wrapped_key = ''; - protected $wrapped_key_material; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to be imported into. - * The create permission is only required on this key when creating a new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * @type string $crypto_key_version - * Optional. The optional [name][google.cloud.kms.v1.CryptoKeyVersion.name] of - * an existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to - * target for an import operation. If this field is not present, a new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] containing the - * supplied key material is created. - * If this field is present, the supplied key material is imported into - * the existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. To - * import into an existing - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must be a child of - * [ImportCryptoKeyVersionRequest.parent][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.parent], - * have been previously created via [ImportCryptoKeyVersion][], and be in - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED] - * or - * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED] - * state. The key material and algorithm must match the previous - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] exactly if the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] has ever contained - * key material. - * @type int $algorithm - * Required. The - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * of the key being imported. This does not need to match the - * [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] this version imports into. - * @type string $import_job - * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the - * [ImportJob][google.cloud.kms.v1.ImportJob] that was used to wrap this key - * material. - * @type string $wrapped_key - * Optional. The wrapped key material to import. - * Before wrapping, key material must be formatted. If importing symmetric key - * material, the expected key material format is plain bytes. If importing - * asymmetric key material, the expected key material format is PKCS#8-encoded - * DER (the PrivateKeyInfo structure from RFC 5208). - * When wrapping with import methods - * ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256] - * or - * [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256] - * or - * [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256] - * or - * [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]), - * this field must contain the concatenation of: - *
    - *
  1. An ephemeral AES-256 wrapping key wrapped with the - * [public_key][google.cloud.kms.v1.ImportJob.public_key] using - * RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty - * label. - *
  2. - *
  3. The formatted key to be imported, wrapped with the ephemeral AES-256 - * key using AES-KWP (RFC 5649). - *
  4. - *
- * This format is the same as the format produced by PKCS#11 mechanism - * CKM_RSA_AES_KEY_WRAP. - * When wrapping with import methods - * ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256] - * or - * [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]), - * this field must contain the formatted key to be imported, wrapped with the - * [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP - * with SHA-256, MGF1 with SHA-256, and an empty label. - * @type string $rsa_aes_wrapped_key - * Optional. This field has the same meaning as - * [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key]. - * Prefer to use that field in new work. Either that field or this field - * (but not both) must be specified. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to be imported into. - * The create permission is only required on this key when creating a new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to be imported into. - * The create permission is only required on this key when creating a new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The optional [name][google.cloud.kms.v1.CryptoKeyVersion.name] of - * an existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to - * target for an import operation. If this field is not present, a new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] containing the - * supplied key material is created. - * If this field is present, the supplied key material is imported into - * the existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. To - * import into an existing - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must be a child of - * [ImportCryptoKeyVersionRequest.parent][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.parent], - * have been previously created via [ImportCryptoKeyVersion][], and be in - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED] - * or - * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED] - * state. The key material and algorithm must match the previous - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] exactly if the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] has ever contained - * key material. - * - * Generated from protobuf field string crypto_key_version = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getCryptoKeyVersion() - { - return $this->crypto_key_version; - } - - /** - * Optional. The optional [name][google.cloud.kms.v1.CryptoKeyVersion.name] of - * an existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to - * target for an import operation. If this field is not present, a new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] containing the - * supplied key material is created. - * If this field is present, the supplied key material is imported into - * the existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. To - * import into an existing - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must be a child of - * [ImportCryptoKeyVersionRequest.parent][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.parent], - * have been previously created via [ImportCryptoKeyVersion][], and be in - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED] - * or - * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED] - * state. The key material and algorithm must match the previous - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] exactly if the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] has ever contained - * key material. - * - * Generated from protobuf field string crypto_key_version = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setCryptoKeyVersion($var) - { - GPBUtil::checkString($var, True); - $this->crypto_key_version = $var; - - return $this; - } - - /** - * Required. The - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * of the key being imported. This does not need to match the - * [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] this version imports into. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getAlgorithm() - { - return $this->algorithm; - } - - /** - * Required. The - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * of the key being imported. This does not need to match the - * [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] this version imports into. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setAlgorithm($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionAlgorithm::class); - $this->algorithm = $var; - - return $this; - } - - /** - * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the - * [ImportJob][google.cloud.kms.v1.ImportJob] that was used to wrap this key - * material. - * - * Generated from protobuf field string import_job = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getImportJob() - { - return $this->import_job; - } - - /** - * Required. The [name][google.cloud.kms.v1.ImportJob.name] of the - * [ImportJob][google.cloud.kms.v1.ImportJob] that was used to wrap this key - * material. - * - * Generated from protobuf field string import_job = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setImportJob($var) - { - GPBUtil::checkString($var, True); - $this->import_job = $var; - - return $this; - } - - /** - * Optional. The wrapped key material to import. - * Before wrapping, key material must be formatted. If importing symmetric key - * material, the expected key material format is plain bytes. If importing - * asymmetric key material, the expected key material format is PKCS#8-encoded - * DER (the PrivateKeyInfo structure from RFC 5208). - * When wrapping with import methods - * ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256] - * or - * [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256] - * or - * [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256] - * or - * [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]), - * this field must contain the concatenation of: - *
    - *
  1. An ephemeral AES-256 wrapping key wrapped with the - * [public_key][google.cloud.kms.v1.ImportJob.public_key] using - * RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty - * label. - *
  2. - *
  3. The formatted key to be imported, wrapped with the ephemeral AES-256 - * key using AES-KWP (RFC 5649). - *
  4. - *
- * This format is the same as the format produced by PKCS#11 mechanism - * CKM_RSA_AES_KEY_WRAP. - * When wrapping with import methods - * ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256] - * or - * [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]), - * this field must contain the formatted key to be imported, wrapped with the - * [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP - * with SHA-256, MGF1 with SHA-256, and an empty label. - * - * Generated from protobuf field bytes wrapped_key = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getWrappedKey() - { - return $this->wrapped_key; - } - - /** - * Optional. The wrapped key material to import. - * Before wrapping, key material must be formatted. If importing symmetric key - * material, the expected key material format is plain bytes. If importing - * asymmetric key material, the expected key material format is PKCS#8-encoded - * DER (the PrivateKeyInfo structure from RFC 5208). - * When wrapping with import methods - * ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256] - * or - * [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256] - * or - * [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256] - * or - * [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]), - * this field must contain the concatenation of: - *
    - *
  1. An ephemeral AES-256 wrapping key wrapped with the - * [public_key][google.cloud.kms.v1.ImportJob.public_key] using - * RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty - * label. - *
  2. - *
  3. The formatted key to be imported, wrapped with the ephemeral AES-256 - * key using AES-KWP (RFC 5649). - *
  4. - *
- * This format is the same as the format produced by PKCS#11 mechanism - * CKM_RSA_AES_KEY_WRAP. - * When wrapping with import methods - * ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256] - * or - * [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]), - * this field must contain the formatted key to be imported, wrapped with the - * [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP - * with SHA-256, MGF1 with SHA-256, and an empty label. - * - * Generated from protobuf field bytes wrapped_key = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setWrappedKey($var) - { - GPBUtil::checkString($var, False); - $this->wrapped_key = $var; - - return $this; - } - - /** - * Optional. This field has the same meaning as - * [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key]. - * Prefer to use that field in new work. Either that field or this field - * (but not both) must be specified. - * - * Generated from protobuf field bytes rsa_aes_wrapped_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRsaAesWrappedKey() - { - return $this->readOneof(5); - } - - public function hasRsaAesWrappedKey() - { - return $this->hasOneof(5); - } - - /** - * Optional. This field has the same meaning as - * [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key]. - * Prefer to use that field in new work. Either that field or this field - * (but not both) must be specified. - * - * Generated from protobuf field bytes rsa_aes_wrapped_key = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRsaAesWrappedKey($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getWrappedKeyMaterial() - { - return $this->whichOneof("wrapped_key_material"); - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob.php deleted file mode 100644 index 6eae364be08c..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob.php +++ /dev/null @@ -1,549 +0,0 @@ -google.cloud.kms.v1.ImportJob - */ -class ImportJob extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name for this - * [ImportJob][google.cloud.kms.v1.ImportJob] in the format - * `projects/*/locations/*/keyRings/*/importJobs/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Required. Immutable. The wrapping method to be used for incoming key - * material. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportMethod import_method = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $import_method = 0; - /** - * Required. Immutable. The protection level of the - * [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * of the [version_template][google.cloud.kms.v1.CryptoKey.version_template] - * on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you attempt to import - * into. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $protection_level = 0; - /** - * Output only. The time at which this - * [ImportJob][google.cloud.kms.v1.ImportJob] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key - * material was generated. - * - * Generated from protobuf field .google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $generate_time = null; - /** - * Output only. The time at which this - * [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for expiration and - * can no longer be used to import key material. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expire_time = null; - /** - * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] - * expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is - * [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED]. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expire_event_time = null; - /** - * Output only. The current state of the - * [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can be used. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. The public key with which to wrap key material prior to - * import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is - * [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE]. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $public_key = null; - /** - * Output only. Statement that was generated and signed by the key creator - * (for example, an HSM) at key creation time. Use this statement to verify - * attributes of the key as stored on the HSM, independently of Google. - * Only present if the chosen - * [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a - * protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $attestation = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name for this - * [ImportJob][google.cloud.kms.v1.ImportJob] in the format - * `projects/*/locations/*/keyRings/*/importJobs/*`. - * @type int $import_method - * Required. Immutable. The wrapping method to be used for incoming key - * material. - * @type int $protection_level - * Required. Immutable. The protection level of the - * [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * of the [version_template][google.cloud.kms.v1.CryptoKey.version_template] - * on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you attempt to import - * into. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time at which this - * [ImportJob][google.cloud.kms.v1.ImportJob] was created. - * @type \Google\Protobuf\Timestamp $generate_time - * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key - * material was generated. - * @type \Google\Protobuf\Timestamp $expire_time - * Output only. The time at which this - * [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for expiration and - * can no longer be used to import key material. - * @type \Google\Protobuf\Timestamp $expire_event_time - * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] - * expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is - * [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED]. - * @type int $state - * Output only. The current state of the - * [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can be used. - * @type \Google\Cloud\Kms\V1\ImportJob\WrappingPublicKey $public_key - * Output only. The public key with which to wrap key material prior to - * import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is - * [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE]. - * @type \Google\Cloud\Kms\V1\KeyOperationAttestation $attestation - * Output only. Statement that was generated and signed by the key creator - * (for example, an HSM) at key creation time. Use this statement to verify - * attributes of the key as stored on the HSM, independently of Google. - * Only present if the chosen - * [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a - * protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name for this - * [ImportJob][google.cloud.kms.v1.ImportJob] in the format - * `projects/*/locations/*/keyRings/*/importJobs/*`. - * - * 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 for this - * [ImportJob][google.cloud.kms.v1.ImportJob] in the format - * `projects/*/locations/*/keyRings/*/importJobs/*`. - * - * 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; - } - - /** - * Required. Immutable. The wrapping method to be used for incoming key - * material. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportMethod import_method = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getImportMethod() - { - return $this->import_method; - } - - /** - * Required. Immutable. The wrapping method to be used for incoming key - * material. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportMethod import_method = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setImportMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ImportJob\ImportMethod::class); - $this->import_method = $var; - - return $this; - } - - /** - * Required. Immutable. The protection level of the - * [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * of the [version_template][google.cloud.kms.v1.CryptoKey.version_template] - * on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you attempt to import - * into. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * Required. Immutable. The protection level of the - * [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * of the [version_template][google.cloud.kms.v1.CryptoKey.version_template] - * on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you attempt to import - * into. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - - /** - * Output only. The time at which this - * [ImportJob][google.cloud.kms.v1.ImportJob] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time at which this - * [ImportJob][google.cloud.kms.v1.ImportJob] was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key - * material was generated. - * - * Generated from protobuf field .google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getGenerateTime() - { - return $this->generate_time; - } - - public function hasGenerateTime() - { - return isset($this->generate_time); - } - - public function clearGenerateTime() - { - unset($this->generate_time); - } - - /** - * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key - * material was generated. - * - * Generated from protobuf field .google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setGenerateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->generate_time = $var; - - return $this; - } - - /** - * Output only. The time at which this - * [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for expiration and - * can no longer be used to import key material. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireTime() - { - return $this->expire_time; - } - - public function hasExpireTime() - { - return isset($this->expire_time); - } - - public function clearExpireTime() - { - unset($this->expire_time); - } - - /** - * Output only. The time at which this - * [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for expiration and - * can no longer be used to import key material. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expire_time = $var; - - return $this; - } - - /** - * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] - * expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is - * [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED]. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireEventTime() - { - return $this->expire_event_time; - } - - public function hasExpireEventTime() - { - return isset($this->expire_event_time); - } - - public function clearExpireEventTime() - { - unset($this->expire_event_time); - } - - /** - * Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] - * expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is - * [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED]. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireEventTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expire_event_time = $var; - - return $this; - } - - /** - * Output only. The current state of the - * [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can be used. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the - * [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can be used. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ImportJob\ImportJobState::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The public key with which to wrap key material prior to - * import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is - * [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE]. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Kms\V1\ImportJob\WrappingPublicKey|null - */ - public function getPublicKey() - { - return $this->public_key; - } - - public function hasPublicKey() - { - return isset($this->public_key); - } - - public function clearPublicKey() - { - unset($this->public_key); - } - - /** - * Output only. The public key with which to wrap key material prior to - * import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is - * [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE]. - * - * Generated from protobuf field .google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Kms\V1\ImportJob\WrappingPublicKey $var - * @return $this - */ - public function setPublicKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\ImportJob\WrappingPublicKey::class); - $this->public_key = $var; - - return $this; - } - - /** - * Output only. Statement that was generated and signed by the key creator - * (for example, an HSM) at key creation time. Use this statement to verify - * attributes of the key as stored on the HSM, independently of Google. - * Only present if the chosen - * [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a - * protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Kms\V1\KeyOperationAttestation|null - */ - public function getAttestation() - { - return $this->attestation; - } - - public function hasAttestation() - { - return isset($this->attestation); - } - - public function clearAttestation() - { - unset($this->attestation); - } - - /** - * Output only. Statement that was generated and signed by the key creator - * (for example, an HSM) at key creation time. Use this statement to verify - * attributes of the key as stored on the HSM, independently of Google. - * Only present if the chosen - * [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a - * protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Kms\V1\KeyOperationAttestation $var - * @return $this - */ - public function setAttestation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\KeyOperationAttestation::class); - $this->attestation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportJobState.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportJobState.php deleted file mode 100644 index b6e7a3e918ae..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportJobState.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.kms.v1.ImportJob.ImportJobState - */ -class ImportJobState -{ - /** - * Not specified. - * - * Generated from protobuf enum IMPORT_JOB_STATE_UNSPECIFIED = 0; - */ - const IMPORT_JOB_STATE_UNSPECIFIED = 0; - /** - * The wrapping key for this job is still being generated. It may not be - * used. Cloud KMS will automatically mark this job as - * [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE] as soon as - * the wrapping key is generated. - * - * Generated from protobuf enum PENDING_GENERATION = 1; - */ - const PENDING_GENERATION = 1; - /** - * This job may be used in - * [CreateCryptoKey][google.cloud.kms.v1.KeyManagementService.CreateCryptoKey] - * and - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * requests. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * This job can no longer be used and may not leave this state once entered. - * - * Generated from protobuf enum EXPIRED = 3; - */ - const EXPIRED = 3; - - private static $valueToName = [ - self::IMPORT_JOB_STATE_UNSPECIFIED => 'IMPORT_JOB_STATE_UNSPECIFIED', - self::PENDING_GENERATION => 'PENDING_GENERATION', - self::ACTIVE => 'ACTIVE', - self::EXPIRED => 'EXPIRED', - ]; - - 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(ImportJobState::class, \Google\Cloud\Kms\V1\ImportJob_ImportJobState::class); - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportMethod.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportMethod.php deleted file mode 100644 index f9a854116277..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/ImportMethod.php +++ /dev/null @@ -1,120 +0,0 @@ -google.cloud.kms.v1.ImportJob.ImportMethod - */ -class ImportMethod -{ - /** - * Not specified. - * - * Generated from protobuf enum IMPORT_METHOD_UNSPECIFIED = 0; - */ - const IMPORT_METHOD_UNSPECIFIED = 0; - /** - * This ImportMethod represents the CKM_RSA_AES_KEY_WRAP key wrapping - * scheme defined in the PKCS #11 standard. In summary, this involves - * wrapping the raw key with an ephemeral AES key, and wrapping the - * ephemeral AES key with a 3072 bit RSA key. For more details, see - * [RSA AES key wrap - * mechanism](http://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/cos01/pkcs11-curr-v2.40-cos01.html#_Toc408226908). - * - * Generated from protobuf enum RSA_OAEP_3072_SHA1_AES_256 = 1; - */ - const RSA_OAEP_3072_SHA1_AES_256 = 1; - /** - * This ImportMethod represents the CKM_RSA_AES_KEY_WRAP key wrapping - * scheme defined in the PKCS #11 standard. In summary, this involves - * wrapping the raw key with an ephemeral AES key, and wrapping the - * ephemeral AES key with a 4096 bit RSA key. For more details, see - * [RSA AES key wrap - * mechanism](http://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/cos01/pkcs11-curr-v2.40-cos01.html#_Toc408226908). - * - * Generated from protobuf enum RSA_OAEP_4096_SHA1_AES_256 = 2; - */ - const RSA_OAEP_4096_SHA1_AES_256 = 2; - /** - * This ImportMethod represents the CKM_RSA_AES_KEY_WRAP key wrapping - * scheme defined in the PKCS #11 standard. In summary, this involves - * wrapping the raw key with an ephemeral AES key, and wrapping the - * ephemeral AES key with a 3072 bit RSA key. For more details, see - * [RSA AES key wrap - * mechanism](http://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/cos01/pkcs11-curr-v2.40-cos01.html#_Toc408226908). - * - * Generated from protobuf enum RSA_OAEP_3072_SHA256_AES_256 = 3; - */ - const RSA_OAEP_3072_SHA256_AES_256 = 3; - /** - * This ImportMethod represents the CKM_RSA_AES_KEY_WRAP key wrapping - * scheme defined in the PKCS #11 standard. In summary, this involves - * wrapping the raw key with an ephemeral AES key, and wrapping the - * ephemeral AES key with a 4096 bit RSA key. For more details, see - * [RSA AES key wrap - * mechanism](http://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/cos01/pkcs11-curr-v2.40-cos01.html#_Toc408226908). - * - * Generated from protobuf enum RSA_OAEP_4096_SHA256_AES_256 = 4; - */ - const RSA_OAEP_4096_SHA256_AES_256 = 4; - /** - * This ImportMethod represents RSAES-OAEP with a 3072 bit RSA key. The - * key material to be imported is wrapped directly with the RSA key. Due - * to technical limitations of RSA wrapping, this method cannot be used to - * wrap RSA keys for import. - * - * Generated from protobuf enum RSA_OAEP_3072_SHA256 = 5; - */ - const RSA_OAEP_3072_SHA256 = 5; - /** - * This ImportMethod represents RSAES-OAEP with a 4096 bit RSA key. The - * key material to be imported is wrapped directly with the RSA key. Due - * to technical limitations of RSA wrapping, this method cannot be used to - * wrap RSA keys for import. - * - * Generated from protobuf enum RSA_OAEP_4096_SHA256 = 6; - */ - const RSA_OAEP_4096_SHA256 = 6; - - private static $valueToName = [ - self::IMPORT_METHOD_UNSPECIFIED => 'IMPORT_METHOD_UNSPECIFIED', - self::RSA_OAEP_3072_SHA1_AES_256 => 'RSA_OAEP_3072_SHA1_AES_256', - self::RSA_OAEP_4096_SHA1_AES_256 => 'RSA_OAEP_4096_SHA1_AES_256', - self::RSA_OAEP_3072_SHA256_AES_256 => 'RSA_OAEP_3072_SHA256_AES_256', - self::RSA_OAEP_4096_SHA256_AES_256 => 'RSA_OAEP_4096_SHA256_AES_256', - self::RSA_OAEP_3072_SHA256 => 'RSA_OAEP_3072_SHA256', - self::RSA_OAEP_4096_SHA256 => 'RSA_OAEP_4096_SHA256', - ]; - - 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(ImportMethod::class, \Google\Cloud\Kms\V1\ImportJob_ImportMethod::class); - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/WrappingPublicKey.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/WrappingPublicKey.php deleted file mode 100644 index 63be4f5d952d..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ImportJob/WrappingPublicKey.php +++ /dev/null @@ -1,88 +0,0 @@ -google.cloud.kms.v1.ImportJob.WrappingPublicKey - */ -class WrappingPublicKey extends \Google\Protobuf\Internal\Message -{ - /** - * The public key, encoded in PEM format. For more information, see the [RFC - * 7468](https://tools.ietf.org/html/rfc7468) sections for [General - * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and - * [Textual Encoding of Subject Public Key Info] - * (https://tools.ietf.org/html/rfc7468#section-13). - * - * Generated from protobuf field string pem = 1; - */ - protected $pem = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $pem - * The public key, encoded in PEM format. For more information, see the [RFC - * 7468](https://tools.ietf.org/html/rfc7468) sections for [General - * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and - * [Textual Encoding of Subject Public Key Info] - * (https://tools.ietf.org/html/rfc7468#section-13). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The public key, encoded in PEM format. For more information, see the [RFC - * 7468](https://tools.ietf.org/html/rfc7468) sections for [General - * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and - * [Textual Encoding of Subject Public Key Info] - * (https://tools.ietf.org/html/rfc7468#section-13). - * - * Generated from protobuf field string pem = 1; - * @return string - */ - public function getPem() - { - return $this->pem; - } - - /** - * The public key, encoded in PEM format. For more information, see the [RFC - * 7468](https://tools.ietf.org/html/rfc7468) sections for [General - * Considerations](https://tools.ietf.org/html/rfc7468#section-2) and - * [Textual Encoding of Subject Public Key Info] - * (https://tools.ietf.org/html/rfc7468#section-13). - * - * Generated from protobuf field string pem = 1; - * @param string $var - * @return $this - */ - public function setPem($var) - { - GPBUtil::checkString($var, True); - $this->pem = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(WrappingPublicKey::class, \Google\Cloud\Kms\V1\ImportJob_WrappingPublicKey::class); - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation.php deleted file mode 100644 index faed7bffa9e1..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation.php +++ /dev/null @@ -1,151 +0,0 @@ -google.cloud.kms.v1.KeyOperationAttestation - */ -class KeyOperationAttestation extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The format of the attestation data. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $format = 0; - /** - * Output only. The attestation data provided by the HSM when the key - * operation was performed. - * - * Generated from protobuf field bytes content = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $content = ''; - /** - * Output only. The certificate chains needed to validate the attestation - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.CertificateChains cert_chains = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $cert_chains = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $format - * Output only. The format of the attestation data. - * @type string $content - * Output only. The attestation data provided by the HSM when the key - * operation was performed. - * @type \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains $cert_chains - * Output only. The certificate chains needed to validate the attestation - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The format of the attestation data. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getFormat() - { - return $this->format; - } - - /** - * Output only. The format of the attestation data. - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setFormat($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\KeyOperationAttestation\AttestationFormat::class); - $this->format = $var; - - return $this; - } - - /** - * Output only. The attestation data provided by the HSM when the key - * operation was performed. - * - * Generated from protobuf field bytes content = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * Output only. The attestation data provided by the HSM when the key - * operation was performed. - * - * Generated from protobuf field bytes content = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkString($var, False); - $this->content = $var; - - return $this; - } - - /** - * Output only. The certificate chains needed to validate the attestation - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.CertificateChains cert_chains = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains|null - */ - public function getCertChains() - { - return $this->cert_chains; - } - - public function hasCertChains() - { - return isset($this->cert_chains); - } - - public function clearCertChains() - { - unset($this->cert_chains); - } - - /** - * Output only. The certificate chains needed to validate the attestation - * - * Generated from protobuf field .google.cloud.kms.v1.KeyOperationAttestation.CertificateChains cert_chains = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains $var - * @return $this - */ - public function setCertChains($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains::class); - $this->cert_chains = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/AttestationFormat.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/AttestationFormat.php deleted file mode 100644 index 43880fade2c1..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/AttestationFormat.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat - */ -class AttestationFormat -{ - /** - * Not specified. - * - * Generated from protobuf enum ATTESTATION_FORMAT_UNSPECIFIED = 0; - */ - const ATTESTATION_FORMAT_UNSPECIFIED = 0; - /** - * Cavium HSM attestation compressed with gzip. Note that this format is - * defined by Cavium and subject to change at any time. - * See - * https://www.marvell.com/products/security-solutions/nitrox-hs-adapters/software-key-attestation.html. - * - * Generated from protobuf enum CAVIUM_V1_COMPRESSED = 3; - */ - const CAVIUM_V1_COMPRESSED = 3; - /** - * Cavium HSM attestation V2 compressed with gzip. This is a new format - * introduced in Cavium's version 3.2-08. - * - * Generated from protobuf enum CAVIUM_V2_COMPRESSED = 4; - */ - const CAVIUM_V2_COMPRESSED = 4; - - private static $valueToName = [ - self::ATTESTATION_FORMAT_UNSPECIFIED => 'ATTESTATION_FORMAT_UNSPECIFIED', - self::CAVIUM_V1_COMPRESSED => 'CAVIUM_V1_COMPRESSED', - self::CAVIUM_V2_COMPRESSED => 'CAVIUM_V2_COMPRESSED', - ]; - - 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(AttestationFormat::class, \Google\Cloud\Kms\V1\KeyOperationAttestation_AttestationFormat::class); - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/CertificateChains.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/CertificateChains.php deleted file mode 100644 index b1eef375ad42..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyOperationAttestation/CertificateChains.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.kms.v1.KeyOperationAttestation.CertificateChains - */ -class CertificateChains extends \Google\Protobuf\Internal\Message -{ - /** - * Cavium certificate chain corresponding to the attestation. - * - * Generated from protobuf field repeated string cavium_certs = 1; - */ - private $cavium_certs; - /** - * Google card certificate chain corresponding to the attestation. - * - * Generated from protobuf field repeated string google_card_certs = 2; - */ - private $google_card_certs; - /** - * Google partition certificate chain corresponding to the attestation. - * - * Generated from protobuf field repeated string google_partition_certs = 3; - */ - private $google_partition_certs; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $cavium_certs - * Cavium certificate chain corresponding to the attestation. - * @type array|\Google\Protobuf\Internal\RepeatedField $google_card_certs - * Google card certificate chain corresponding to the attestation. - * @type array|\Google\Protobuf\Internal\RepeatedField $google_partition_certs - * Google partition certificate chain corresponding to the attestation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Cavium certificate chain corresponding to the attestation. - * - * Generated from protobuf field repeated string cavium_certs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCaviumCerts() - { - return $this->cavium_certs; - } - - /** - * Cavium certificate chain corresponding to the attestation. - * - * Generated from protobuf field repeated string cavium_certs = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCaviumCerts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->cavium_certs = $arr; - - return $this; - } - - /** - * Google card certificate chain corresponding to the attestation. - * - * Generated from protobuf field repeated string google_card_certs = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGoogleCardCerts() - { - return $this->google_card_certs; - } - - /** - * Google card certificate chain corresponding to the attestation. - * - * Generated from protobuf field repeated string google_card_certs = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGoogleCardCerts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->google_card_certs = $arr; - - return $this; - } - - /** - * Google partition certificate chain corresponding to the attestation. - * - * Generated from protobuf field repeated string google_partition_certs = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGooglePartitionCerts() - { - return $this->google_partition_certs; - } - - /** - * Google partition certificate chain corresponding to the attestation. - * - * Generated from protobuf field repeated string google_partition_certs = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGooglePartitionCerts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->google_partition_certs = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CertificateChains::class, \Google\Cloud\Kms\V1\KeyOperationAttestation_CertificateChains::class); - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyRing.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyRing.php deleted file mode 100644 index 797fe8942e0b..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/KeyRing.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.kms.v1.KeyRing - */ -class KeyRing extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name for the - * [KeyRing][google.cloud.kms.v1.KeyRing] in the format - * `projects/*/locations/*/keyRings/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. The time at which this [KeyRing][google.cloud.kms.v1.KeyRing] - * was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name for the - * [KeyRing][google.cloud.kms.v1.KeyRing] in the format - * `projects/*/locations/*/keyRings/*`. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time at which this [KeyRing][google.cloud.kms.v1.KeyRing] - * was created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name for the - * [KeyRing][google.cloud.kms.v1.KeyRing] in the format - * `projects/*/locations/*/keyRings/*`. - * - * 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 for the - * [KeyRing][google.cloud.kms.v1.KeyRing] in the format - * `projects/*/locations/*/keyRings/*`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The time at which this [KeyRing][google.cloud.kms.v1.KeyRing] - * was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time at which this [KeyRing][google.cloud.kms.v1.KeyRing] - * was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsRequest.php deleted file mode 100644 index b429f3ce2435..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsRequest.php +++ /dev/null @@ -1,314 +0,0 @@ -google.cloud.kms.v1.ListCryptoKeyVersionsRequest - */ -class ListCryptoKeyVersionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Optional limit on the number of - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] to include in the - * response. Further [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] - * can subsequently be obtained by including the - * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. Optional pagination token, returned earlier via - * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * The fields to include in the response. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; - */ - protected $view = 0; - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. Please see - * {@see KeyManagementServiceClient::cryptoKeyName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\ListCryptoKeyVersionsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * @type int $page_size - * Optional. Optional limit on the number of - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] to include in the - * response. Further [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] - * can subsequently be obtained by including the - * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @type string $page_token - * Optional. Optional pagination token, returned earlier via - * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]. - * @type int $view - * The fields to include in the response. - * @type string $filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type string $order_by - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * - * 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 - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Optional limit on the number of - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] to include in the - * response. Further [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] - * can subsequently be obtained by including the - * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Optional limit on the number of - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] to include in the - * response. Further [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] - * can subsequently be obtained by including the - * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. Optional pagination token, returned earlier via - * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. Optional pagination token, returned earlier via - * [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The fields to include in the response. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * The fields to include in the response. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionView::class); - $this->view = $var; - - return $this; - } - - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsResponse.php deleted file mode 100644 index bbbe9ccb0775..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeyVersionsResponse.php +++ /dev/null @@ -1,152 +0,0 @@ -google.cloud.kms.v1.ListCryptoKeyVersionsResponse - */ -class ListCryptoKeyVersionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKeyVersion crypto_key_versions = 1; - */ - private $crypto_key_versions; - /** - * A token to retrieve next page of results. Pass this value in - * [ListCryptoKeyVersionsRequest.page_token][google.cloud.kms.v1.ListCryptoKeyVersionsRequest.page_token] - * to retrieve the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * The total number of - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] that matched the - * query. - * - * Generated from protobuf field int32 total_size = 3; - */ - protected $total_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Kms\V1\CryptoKeyVersion>|\Google\Protobuf\Internal\RepeatedField $crypto_key_versions - * The list of [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - * @type string $next_page_token - * A token to retrieve next page of results. Pass this value in - * [ListCryptoKeyVersionsRequest.page_token][google.cloud.kms.v1.ListCryptoKeyVersionsRequest.page_token] - * to retrieve the next page of results. - * @type int $total_size - * The total number of - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] that matched the - * query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKeyVersion crypto_key_versions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCryptoKeyVersions() - { - return $this->crypto_key_versions; - } - - /** - * The list of [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKeyVersion crypto_key_versions = 1; - * @param array<\Google\Cloud\Kms\V1\CryptoKeyVersion>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCryptoKeyVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\CryptoKeyVersion::class); - $this->crypto_key_versions = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. Pass this value in - * [ListCryptoKeyVersionsRequest.page_token][google.cloud.kms.v1.ListCryptoKeyVersionsRequest.page_token] - * 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 next page of results. Pass this value in - * [ListCryptoKeyVersionsRequest.page_token][google.cloud.kms.v1.ListCryptoKeyVersionsRequest.page_token] - * 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; - } - - /** - * The total number of - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] that matched the - * query. - * - * Generated from protobuf field int32 total_size = 3; - * @return int - */ - public function getTotalSize() - { - return $this->total_size; - } - - /** - * The total number of - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] that matched the - * query. - * - * Generated from protobuf field int32 total_size = 3; - * @param int $var - * @return $this - */ - public function setTotalSize($var) - { - GPBUtil::checkInt32($var); - $this->total_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysRequest.php deleted file mode 100644 index dc800232d1eb..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysRequest.php +++ /dev/null @@ -1,309 +0,0 @@ -google.cloud.kms.v1.ListCryptoKeysRequest - */ -class ListCryptoKeysRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Optional limit on the number of - * [CryptoKeys][google.cloud.kms.v1.CryptoKey] to include in the response. - * Further [CryptoKeys][google.cloud.kms.v1.CryptoKey] can subsequently be - * obtained by including the - * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. Optional pagination token, returned earlier via - * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * The fields of the primary version to include in the response. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; - */ - protected $version_view = 0; - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. Please see - * {@see KeyManagementServiceClient::keyRingName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\ListCryptoKeysRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. - * @type int $page_size - * Optional. Optional limit on the number of - * [CryptoKeys][google.cloud.kms.v1.CryptoKey] to include in the response. - * Further [CryptoKeys][google.cloud.kms.v1.CryptoKey] can subsequently be - * obtained by including the - * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @type string $page_token - * Optional. Optional pagination token, returned earlier via - * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]. - * @type int $version_view - * The fields of the primary version to include in the response. - * @type string $filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type string $order_by - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. - * - * 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 [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Optional limit on the number of - * [CryptoKeys][google.cloud.kms.v1.CryptoKey] to include in the response. - * Further [CryptoKeys][google.cloud.kms.v1.CryptoKey] can subsequently be - * obtained by including the - * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Optional limit on the number of - * [CryptoKeys][google.cloud.kms.v1.CryptoKey] to include in the response. - * Further [CryptoKeys][google.cloud.kms.v1.CryptoKey] can subsequently be - * obtained by including the - * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. Optional pagination token, returned earlier via - * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. Optional pagination token, returned earlier via - * [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The fields of the primary version to include in the response. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; - * @return int - */ - public function getVersionView() - { - return $this->version_view; - } - - /** - * The fields of the primary version to include in the response. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; - * @param int $var - * @return $this - */ - public function setVersionView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionView::class); - $this->version_view = $var; - - return $this; - } - - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysResponse.php deleted file mode 100644 index 256c1b36b885..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListCryptoKeysResponse.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.kms.v1.ListCryptoKeysResponse - */ -class ListCryptoKeysResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKey crypto_keys = 1; - */ - private $crypto_keys; - /** - * A token to retrieve next page of results. Pass this value in - * [ListCryptoKeysRequest.page_token][google.cloud.kms.v1.ListCryptoKeysRequest.page_token] - * to retrieve the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * The total number of [CryptoKeys][google.cloud.kms.v1.CryptoKey] that - * matched the query. - * - * Generated from protobuf field int32 total_size = 3; - */ - protected $total_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Kms\V1\CryptoKey>|\Google\Protobuf\Internal\RepeatedField $crypto_keys - * The list of [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - * @type string $next_page_token - * A token to retrieve next page of results. Pass this value in - * [ListCryptoKeysRequest.page_token][google.cloud.kms.v1.ListCryptoKeysRequest.page_token] - * to retrieve the next page of results. - * @type int $total_size - * The total number of [CryptoKeys][google.cloud.kms.v1.CryptoKey] that - * matched the query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKey crypto_keys = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCryptoKeys() - { - return $this->crypto_keys; - } - - /** - * The list of [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.CryptoKey crypto_keys = 1; - * @param array<\Google\Cloud\Kms\V1\CryptoKey>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCryptoKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\CryptoKey::class); - $this->crypto_keys = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. Pass this value in - * [ListCryptoKeysRequest.page_token][google.cloud.kms.v1.ListCryptoKeysRequest.page_token] - * 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 next page of results. Pass this value in - * [ListCryptoKeysRequest.page_token][google.cloud.kms.v1.ListCryptoKeysRequest.page_token] - * 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; - } - - /** - * The total number of [CryptoKeys][google.cloud.kms.v1.CryptoKey] that - * matched the query. - * - * Generated from protobuf field int32 total_size = 3; - * @return int - */ - public function getTotalSize() - { - return $this->total_size; - } - - /** - * The total number of [CryptoKeys][google.cloud.kms.v1.CryptoKey] that - * matched the query. - * - * Generated from protobuf field int32 total_size = 3; - * @param int $var - * @return $this - */ - public function setTotalSize($var) - { - GPBUtil::checkInt32($var); - $this->total_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsRequest.php deleted file mode 100644 index 00bdce40d8da..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsRequest.php +++ /dev/null @@ -1,280 +0,0 @@ -google.cloud.kms.v1.ListEkmConnectionsRequest - */ -class ListEkmConnectionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the location associated with the - * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format - * `projects/*/locations/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Optional limit on the number of - * [EkmConnections][google.cloud.kms.v1.EkmConnection] to include in the - * response. Further [EkmConnections][google.cloud.kms.v1.EkmConnection] can - * subsequently be obtained by including the - * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. Optional pagination token, returned earlier via - * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The resource name of the location associated with the - * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format - * `projects/*/locations/*`. Please see - * {@see EkmServiceClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\ListEkmConnectionsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the location associated with the - * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format - * `projects/*/locations/*`. - * @type int $page_size - * Optional. Optional limit on the number of - * [EkmConnections][google.cloud.kms.v1.EkmConnection] to include in the - * response. Further [EkmConnections][google.cloud.kms.v1.EkmConnection] can - * subsequently be obtained by including the - * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @type string $page_token - * Optional. Optional pagination token, returned earlier via - * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token]. - * @type string $filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type string $order_by - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the location associated with the - * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format - * `projects/*/locations/*`. - * - * 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 location associated with the - * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format - * `projects/*/locations/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Optional limit on the number of - * [EkmConnections][google.cloud.kms.v1.EkmConnection] to include in the - * response. Further [EkmConnections][google.cloud.kms.v1.EkmConnection] can - * subsequently be obtained by including the - * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Optional limit on the number of - * [EkmConnections][google.cloud.kms.v1.EkmConnection] to include in the - * response. Further [EkmConnections][google.cloud.kms.v1.EkmConnection] can - * subsequently be obtained by including the - * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. Optional pagination token, returned earlier via - * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. Optional pagination token, returned earlier via - * [ListEkmConnectionsResponse.next_page_token][google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsResponse.php deleted file mode 100644 index cf84a145df5e..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListEkmConnectionsResponse.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.kms.v1.ListEkmConnectionsResponse - */ -class ListEkmConnectionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of [EkmConnections][google.cloud.kms.v1.EkmConnection]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection ekm_connections = 1; - */ - private $ekm_connections; - /** - * A token to retrieve next page of results. Pass this value in - * [ListEkmConnectionsRequest.page_token][google.cloud.kms.v1.ListEkmConnectionsRequest.page_token] - * to retrieve the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * The total number of [EkmConnections][google.cloud.kms.v1.EkmConnection] - * that matched the query. - * - * Generated from protobuf field int32 total_size = 3; - */ - protected $total_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Kms\V1\EkmConnection>|\Google\Protobuf\Internal\RepeatedField $ekm_connections - * The list of [EkmConnections][google.cloud.kms.v1.EkmConnection]. - * @type string $next_page_token - * A token to retrieve next page of results. Pass this value in - * [ListEkmConnectionsRequest.page_token][google.cloud.kms.v1.ListEkmConnectionsRequest.page_token] - * to retrieve the next page of results. - * @type int $total_size - * The total number of [EkmConnections][google.cloud.kms.v1.EkmConnection] - * that matched the query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * The list of [EkmConnections][google.cloud.kms.v1.EkmConnection]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection ekm_connections = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEkmConnections() - { - return $this->ekm_connections; - } - - /** - * The list of [EkmConnections][google.cloud.kms.v1.EkmConnection]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.EkmConnection ekm_connections = 1; - * @param array<\Google\Cloud\Kms\V1\EkmConnection>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEkmConnections($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\EkmConnection::class); - $this->ekm_connections = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. Pass this value in - * [ListEkmConnectionsRequest.page_token][google.cloud.kms.v1.ListEkmConnectionsRequest.page_token] - * 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 next page of results. Pass this value in - * [ListEkmConnectionsRequest.page_token][google.cloud.kms.v1.ListEkmConnectionsRequest.page_token] - * 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; - } - - /** - * The total number of [EkmConnections][google.cloud.kms.v1.EkmConnection] - * that matched the query. - * - * Generated from protobuf field int32 total_size = 3; - * @return int - */ - public function getTotalSize() - { - return $this->total_size; - } - - /** - * The total number of [EkmConnections][google.cloud.kms.v1.EkmConnection] - * that matched the query. - * - * Generated from protobuf field int32 total_size = 3; - * @param int $var - * @return $this - */ - public function setTotalSize($var) - { - GPBUtil::checkInt32($var); - $this->total_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsRequest.php deleted file mode 100644 index 463eb5440cc1..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsRequest.php +++ /dev/null @@ -1,275 +0,0 @@ -google.cloud.kms.v1.ListImportJobsRequest - */ -class ListImportJobsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Optional limit on the number of - * [ImportJobs][google.cloud.kms.v1.ImportJob] to include in the response. - * Further [ImportJobs][google.cloud.kms.v1.ImportJob] can subsequently be - * obtained by including the - * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. Optional pagination token, returned earlier via - * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. Please see - * {@see KeyManagementServiceClient::keyRingName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\ListImportJobsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. - * @type int $page_size - * Optional. Optional limit on the number of - * [ImportJobs][google.cloud.kms.v1.ImportJob] to include in the response. - * Further [ImportJobs][google.cloud.kms.v1.ImportJob] can subsequently be - * obtained by including the - * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @type string $page_token - * Optional. Optional pagination token, returned earlier via - * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token]. - * @type string $filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type string $order_by - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. - * - * 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 [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Optional limit on the number of - * [ImportJobs][google.cloud.kms.v1.ImportJob] to include in the response. - * Further [ImportJobs][google.cloud.kms.v1.ImportJob] can subsequently be - * obtained by including the - * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Optional limit on the number of - * [ImportJobs][google.cloud.kms.v1.ImportJob] to include in the response. - * Further [ImportJobs][google.cloud.kms.v1.ImportJob] can subsequently be - * obtained by including the - * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. Optional pagination token, returned earlier via - * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. Optional pagination token, returned earlier via - * [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsResponse.php deleted file mode 100644 index 04f11ca76dd2..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListImportJobsResponse.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.kms.v1.ListImportJobsResponse - */ -class ListImportJobsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of [ImportJobs][google.cloud.kms.v1.ImportJob]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.ImportJob import_jobs = 1; - */ - private $import_jobs; - /** - * A token to retrieve next page of results. Pass this value in - * [ListImportJobsRequest.page_token][google.cloud.kms.v1.ListImportJobsRequest.page_token] - * to retrieve the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * The total number of [ImportJobs][google.cloud.kms.v1.ImportJob] that - * matched the query. - * - * Generated from protobuf field int32 total_size = 3; - */ - protected $total_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Kms\V1\ImportJob>|\Google\Protobuf\Internal\RepeatedField $import_jobs - * The list of [ImportJobs][google.cloud.kms.v1.ImportJob]. - * @type string $next_page_token - * A token to retrieve next page of results. Pass this value in - * [ListImportJobsRequest.page_token][google.cloud.kms.v1.ListImportJobsRequest.page_token] - * to retrieve the next page of results. - * @type int $total_size - * The total number of [ImportJobs][google.cloud.kms.v1.ImportJob] that - * matched the query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of [ImportJobs][google.cloud.kms.v1.ImportJob]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.ImportJob import_jobs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getImportJobs() - { - return $this->import_jobs; - } - - /** - * The list of [ImportJobs][google.cloud.kms.v1.ImportJob]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.ImportJob import_jobs = 1; - * @param array<\Google\Cloud\Kms\V1\ImportJob>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setImportJobs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\ImportJob::class); - $this->import_jobs = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. Pass this value in - * [ListImportJobsRequest.page_token][google.cloud.kms.v1.ListImportJobsRequest.page_token] - * 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 next page of results. Pass this value in - * [ListImportJobsRequest.page_token][google.cloud.kms.v1.ListImportJobsRequest.page_token] - * 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; - } - - /** - * The total number of [ImportJobs][google.cloud.kms.v1.ImportJob] that - * matched the query. - * - * Generated from protobuf field int32 total_size = 3; - * @return int - */ - public function getTotalSize() - { - return $this->total_size; - } - - /** - * The total number of [ImportJobs][google.cloud.kms.v1.ImportJob] that - * matched the query. - * - * Generated from protobuf field int32 total_size = 3; - * @param int $var - * @return $this - */ - public function setTotalSize($var) - { - GPBUtil::checkInt32($var); - $this->total_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsRequest.php deleted file mode 100644 index 5f2032f8741e..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsRequest.php +++ /dev/null @@ -1,280 +0,0 @@ -google.cloud.kms.v1.ListKeyRingsRequest - */ -class ListKeyRingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Optional limit on the number of - * [KeyRings][google.cloud.kms.v1.KeyRing] to include in the response. Further - * [KeyRings][google.cloud.kms.v1.KeyRing] can subsequently be obtained by - * including the - * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. Optional pagination token, returned earlier via - * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. The resource name of the location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. Please see - * {@see KeyManagementServiceClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\ListKeyRingsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. - * @type int $page_size - * Optional. Optional limit on the number of - * [KeyRings][google.cloud.kms.v1.KeyRing] to include in the response. Further - * [KeyRings][google.cloud.kms.v1.KeyRing] can subsequently be obtained by - * including the - * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @type string $page_token - * Optional. Optional pagination token, returned earlier via - * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token]. - * @type string $filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type string $order_by - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. - * - * 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 location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Optional limit on the number of - * [KeyRings][google.cloud.kms.v1.KeyRing] to include in the response. Further - * [KeyRings][google.cloud.kms.v1.KeyRing] can subsequently be obtained by - * including the - * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Optional limit on the number of - * [KeyRings][google.cloud.kms.v1.KeyRing] to include in the response. Further - * [KeyRings][google.cloud.kms.v1.KeyRing] can subsequently be obtained by - * including the - * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token] - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. Optional pagination token, returned earlier via - * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. Optional pagination token, returned earlier via - * [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token]. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * - * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsResponse.php deleted file mode 100644 index 3deac0ea2e0f..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ListKeyRingsResponse.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.kms.v1.ListKeyRingsResponse - */ -class ListKeyRingsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of [KeyRings][google.cloud.kms.v1.KeyRing]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.KeyRing key_rings = 1; - */ - private $key_rings; - /** - * A token to retrieve next page of results. Pass this value in - * [ListKeyRingsRequest.page_token][google.cloud.kms.v1.ListKeyRingsRequest.page_token] - * to retrieve the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * The total number of [KeyRings][google.cloud.kms.v1.KeyRing] that matched - * the query. - * - * Generated from protobuf field int32 total_size = 3; - */ - protected $total_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Kms\V1\KeyRing>|\Google\Protobuf\Internal\RepeatedField $key_rings - * The list of [KeyRings][google.cloud.kms.v1.KeyRing]. - * @type string $next_page_token - * A token to retrieve next page of results. Pass this value in - * [ListKeyRingsRequest.page_token][google.cloud.kms.v1.ListKeyRingsRequest.page_token] - * to retrieve the next page of results. - * @type int $total_size - * The total number of [KeyRings][google.cloud.kms.v1.KeyRing] that matched - * the query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The list of [KeyRings][google.cloud.kms.v1.KeyRing]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.KeyRing key_rings = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getKeyRings() - { - return $this->key_rings; - } - - /** - * The list of [KeyRings][google.cloud.kms.v1.KeyRing]. - * - * Generated from protobuf field repeated .google.cloud.kms.v1.KeyRing key_rings = 1; - * @param array<\Google\Cloud\Kms\V1\KeyRing>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKeyRings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Kms\V1\KeyRing::class); - $this->key_rings = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. Pass this value in - * [ListKeyRingsRequest.page_token][google.cloud.kms.v1.ListKeyRingsRequest.page_token] - * 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 next page of results. Pass this value in - * [ListKeyRingsRequest.page_token][google.cloud.kms.v1.ListKeyRingsRequest.page_token] - * 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; - } - - /** - * The total number of [KeyRings][google.cloud.kms.v1.KeyRing] that matched - * the query. - * - * Generated from protobuf field int32 total_size = 3; - * @return int - */ - public function getTotalSize() - { - return $this->total_size; - } - - /** - * The total number of [KeyRings][google.cloud.kms.v1.KeyRing] that matched - * the query. - * - * Generated from protobuf field int32 total_size = 3; - * @param int $var - * @return $this - */ - public function setTotalSize($var) - { - GPBUtil::checkInt32($var); - $this->total_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/LocationMetadata.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/LocationMetadata.php deleted file mode 100644 index 656adb13aac7..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/LocationMetadata.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.kms.v1.LocationMetadata - */ -class LocationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this - * location. - * - * Generated from protobuf field bool hsm_available = 1; - */ - protected $hsm_available = false; - /** - * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] can be created in - * this location. - * - * Generated from protobuf field bool ekm_available = 2; - */ - protected $ekm_available = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $hsm_available - * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this - * location. - * @type bool $ekm_available - * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] can be created in - * this location. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this - * location. - * - * Generated from protobuf field bool hsm_available = 1; - * @return bool - */ - public function getHsmAvailable() - { - return $this->hsm_available; - } - - /** - * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this - * location. - * - * Generated from protobuf field bool hsm_available = 1; - * @param bool $var - * @return $this - */ - public function setHsmAvailable($var) - { - GPBUtil::checkBool($var); - $this->hsm_available = $var; - - return $this; - } - - /** - * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] can be created in - * this location. - * - * Generated from protobuf field bool ekm_available = 2; - * @return bool - */ - public function getEkmAvailable() - { - return $this->ekm_available; - } - - /** - * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] can be created in - * this location. - * - * Generated from protobuf field bool ekm_available = 2; - * @param bool $var - * @return $this - */ - public function setEkmAvailable($var) - { - GPBUtil::checkBool($var); - $this->ekm_available = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignRequest.php deleted file mode 100644 index efc81a1661d3..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignRequest.php +++ /dev/null @@ -1,300 +0,0 @@ -google.cloud.kms.v1.MacSignRequest - */ -class MacSignRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The data to sign. The MAC tag is computed over this data field - * based on the specific algorithm. - * - * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $data = ''; - /** - * Optional. An optional CRC32C checksum of the - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is - * equal to - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $data_crc32c = null; - - /** - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. Please see - * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. - * @param string $data Required. The data to sign. The MAC tag is computed over this data field - * based on the specific algorithm. - * - * @return \Google\Cloud\Kms\V1\MacSignRequest - * - * @experimental - */ - public static function build(string $name, string $data): self - { - return (new self()) - ->setName($name) - ->setData($data); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. - * @type string $data - * Required. The data to sign. The MAC tag is computed over this data field - * based on the specific algorithm. - * @type \Google\Protobuf\Int64Value $data_crc32c - * Optional. An optional CRC32C checksum of the - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is - * equal to - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. - * - * 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 - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. - * - * 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; - } - - /** - * Required. The data to sign. The MAC tag is computed over this data field - * based on the specific algorithm. - * - * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getData() - { - return $this->data; - } - - /** - * Required. The data to sign. The MAC tag is computed over this data field - * based on the specific algorithm. - * - * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setData($var) - { - GPBUtil::checkString($var, False); - $this->data = $var; - - return $this; - } - - /** - * Optional. An optional CRC32C checksum of the - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is - * equal to - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getDataCrc32C() - { - return $this->data_crc32c; - } - - public function hasDataCrc32C() - { - return isset($this->data_crc32c); - } - - public function clearDataCrc32C() - { - unset($this->data_crc32c); - } - - /** - * Returns the unboxed value from getDataCrc32C() - - * Optional. An optional CRC32C checksum of the - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is - * equal to - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getDataCrc32CUnwrapped() - { - return $this->readWrapperValue("data_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is - * equal to - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setDataCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->data_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is - * equal to - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setDataCrc32CUnwrapped($var) - { - $this->writeWrapperValue("data_crc32c", $var); - return $this;} - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignResponse.php deleted file mode 100644 index 632a972782b3..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacSignResponse.php +++ /dev/null @@ -1,377 +0,0 @@ -google.cloud.kms.v1.MacSignResponse - */ -class MacSignResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * Check this field to verify that the intended resource was used for signing. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The created signature. - * - * Generated from protobuf field bytes mac = 2; - */ - protected $mac = ''; - /** - * Integrity verification field. A CRC32C checksum of the returned - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An - * integrity check of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be - * performed by computing the CRC32C checksum of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and - * comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 3; - */ - protected $mac_crc32c = null; - /** - * Integrity verification field. A flag indicating whether - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacSignRequest.data]. A false value of this - * field indicates either that - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_data_crc32c = 4; - */ - protected $verified_data_crc32c = false; - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; - */ - protected $protection_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * Check this field to verify that the intended resource was used for signing. - * @type string $mac - * The created signature. - * @type \Google\Protobuf\Int64Value $mac_crc32c - * Integrity verification field. A CRC32C checksum of the returned - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An - * integrity check of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be - * performed by computing the CRC32C checksum of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and - * comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * @type bool $verified_data_crc32c - * Integrity verification field. A flag indicating whether - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacSignRequest.data]. A false value of this - * field indicates either that - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type int $protection_level - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * Check this field to verify that the intended resource was used for signing. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * Check this field to verify that the intended resource was used for signing. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The created signature. - * - * Generated from protobuf field bytes mac = 2; - * @return string - */ - public function getMac() - { - return $this->mac; - } - - /** - * The created signature. - * - * Generated from protobuf field bytes mac = 2; - * @param string $var - * @return $this - */ - public function setMac($var) - { - GPBUtil::checkString($var, False); - $this->mac = $var; - - return $this; - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An - * integrity check of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be - * performed by computing the CRC32C checksum of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and - * comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 3; - * @return \Google\Protobuf\Int64Value|null - */ - public function getMacCrc32C() - { - return $this->mac_crc32c; - } - - public function hasMacCrc32C() - { - return isset($this->mac_crc32c); - } - - public function clearMacCrc32C() - { - unset($this->mac_crc32c); - } - - /** - * Returns the unboxed value from getMacCrc32C() - - * Integrity verification field. A CRC32C checksum of the returned - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An - * integrity check of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be - * performed by computing the CRC32C checksum of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and - * comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 3; - * @return int|string|null - */ - public function getMacCrc32CUnwrapped() - { - return $this->readWrapperValue("mac_crc32c"); - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An - * integrity check of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be - * performed by computing the CRC32C checksum of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and - * comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 3; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setMacCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->mac_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Integrity verification field. A CRC32C checksum of the returned - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An - * integrity check of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be - * performed by computing the CRC32C checksum of - * [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and - * comparing your results to this field. Discard the response in case of - * non-matching checksum values, and perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 3; - * @param int|string|null $var - * @return $this - */ - public function setMacCrc32CUnwrapped($var) - { - $this->writeWrapperValue("mac_crc32c", $var); - return $this;} - - /** - * Integrity verification field. A flag indicating whether - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacSignRequest.data]. A false value of this - * field indicates either that - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_data_crc32c = 4; - * @return bool - */ - public function getVerifiedDataCrc32C() - { - return $this->verified_data_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacSignRequest.data]. A false value of this - * field indicates either that - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_data_crc32c = 4; - * @param bool $var - * @return $this - */ - public function setVerifiedDataCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_data_crc32c = $var; - - return $this; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyRequest.php deleted file mode 100644 index 57af029a1136..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyRequest.php +++ /dev/null @@ -1,508 +0,0 @@ -google.cloud.kms.v1.MacVerifyRequest - */ -class MacVerifyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * verification. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The data used previously as a - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate - * the MAC tag. - * - * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $data = ''; - /** - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) - * is equal to - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $data_crc32c = null; - /** - * Required. The signature to verify. - * - * Generated from protobuf field bytes mac = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $mac = ''; - /** - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.tag][]) is equal to - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $mac_crc32c = null; - - /** - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * verification. Please see - * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. - * @param string $data Required. The data used previously as a - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate - * the MAC tag. - * @param string $mac Required. The signature to verify. - * - * @return \Google\Cloud\Kms\V1\MacVerifyRequest - * - * @experimental - */ - public static function build(string $name, string $data, string $mac): self - { - return (new self()) - ->setName($name) - ->setData($data) - ->setMac($mac); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * verification. - * @type string $data - * Required. The data used previously as a - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate - * the MAC tag. - * @type \Google\Protobuf\Int64Value $data_crc32c - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) - * is equal to - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type string $mac - * Required. The signature to verify. - * @type \Google\Protobuf\Int64Value $mac_crc32c - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.tag][]) is equal to - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * verification. - * - * 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 - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * verification. - * - * 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; - } - - /** - * Required. The data used previously as a - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate - * the MAC tag. - * - * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getData() - { - return $this->data; - } - - /** - * Required. The data used previously as a - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate - * the MAC tag. - * - * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setData($var) - { - GPBUtil::checkString($var, False); - $this->data = $var; - - return $this; - } - - /** - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) - * is equal to - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getDataCrc32C() - { - return $this->data_crc32c; - } - - public function hasDataCrc32C() - { - return isset($this->data_crc32c); - } - - public function clearDataCrc32C() - { - unset($this->data_crc32c); - } - - /** - * Returns the unboxed value from getDataCrc32C() - - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) - * is equal to - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getDataCrc32CUnwrapped() - { - return $this->readWrapperValue("data_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) - * is equal to - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setDataCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->data_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) - * is equal to - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value data_crc32c = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setDataCrc32CUnwrapped($var) - { - $this->writeWrapperValue("data_crc32c", $var); - return $this;} - - /** - * Required. The signature to verify. - * - * Generated from protobuf field bytes mac = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getMac() - { - return $this->mac; - } - - /** - * Required. The signature to verify. - * - * Generated from protobuf field bytes mac = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setMac($var) - { - GPBUtil::checkString($var, False); - $this->mac = $var; - - return $this; - } - - /** - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.tag][]) is equal to - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getMacCrc32C() - { - return $this->mac_crc32c; - } - - public function hasMacCrc32C() - { - return isset($this->mac_crc32c); - } - - public function clearMacCrc32C() - { - unset($this->mac_crc32c); - } - - /** - * Returns the unboxed value from getMacCrc32C() - - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.tag][]) is equal to - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getMacCrc32CUnwrapped() - { - return $this->readWrapperValue("mac_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.tag][]) is equal to - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setMacCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->mac_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.tag][]) is equal to - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * - * Generated from protobuf field .google.protobuf.Int64Value mac_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setMacCrc32CUnwrapped($var) - { - $this->writeWrapperValue("mac_crc32c", $var); - return $this;} - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyResponse.php deleted file mode 100644 index 457f9f454810..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/MacVerifyResponse.php +++ /dev/null @@ -1,386 +0,0 @@ -google.cloud.kms.v1.MacVerifyResponse - */ -class MacVerifyResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for - * verification. Check this field to verify that the intended resource was - * used for verification. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * This field indicates whether or not the verification operation for - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] over - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] was - * successful. - * - * Generated from protobuf field bool success = 2; - */ - protected $success = false; - /** - * Integrity verification field. A flag indicating whether - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacVerifyRequest.data]. A false value of this - * field indicates either that - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_data_crc32c = 3; - */ - protected $verified_data_crc32c = false; - /** - * Integrity verification field. A flag indicating whether - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacVerifyRequest.mac]. A false value of this - * field indicates either that - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_mac_crc32c = 4; - */ - protected $verified_mac_crc32c = false; - /** - * Integrity verification field. This value is used for the integrity - * verification of [MacVerifyResponse.success]. If the value of this field - * contradicts the value of [MacVerifyResponse.success], discard the response - * and perform a limited number of retries. - * - * Generated from protobuf field bool verified_success_integrity = 5; - */ - protected $verified_success_integrity = false; - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for - * verification. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; - */ - protected $protection_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for - * verification. Check this field to verify that the intended resource was - * used for verification. - * @type bool $success - * This field indicates whether or not the verification operation for - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] over - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] was - * successful. - * @type bool $verified_data_crc32c - * Integrity verification field. A flag indicating whether - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacVerifyRequest.data]. A false value of this - * field indicates either that - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type bool $verified_mac_crc32c - * Integrity verification field. A flag indicating whether - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacVerifyRequest.mac]. A false value of this - * field indicates either that - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type bool $verified_success_integrity - * Integrity verification field. This value is used for the integrity - * verification of [MacVerifyResponse.success]. If the value of this field - * contradicts the value of [MacVerifyResponse.success], discard the response - * and perform a limited number of retries. - * @type int $protection_level - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for - * verification. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for - * verification. Check this field to verify that the intended resource was - * used for verification. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for - * verification. Check this field to verify that the intended resource was - * used for verification. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * This field indicates whether or not the verification operation for - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] over - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] was - * successful. - * - * Generated from protobuf field bool success = 2; - * @return bool - */ - public function getSuccess() - { - return $this->success; - } - - /** - * This field indicates whether or not the verification operation for - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] over - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] was - * successful. - * - * Generated from protobuf field bool success = 2; - * @param bool $var - * @return $this - */ - public function setSuccess($var) - { - GPBUtil::checkBool($var); - $this->success = $var; - - return $this; - } - - /** - * Integrity verification field. A flag indicating whether - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacVerifyRequest.data]. A false value of this - * field indicates either that - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_data_crc32c = 3; - * @return bool - */ - public function getVerifiedDataCrc32C() - { - return $this->verified_data_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacVerifyRequest.data]. A false value of this - * field indicates either that - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_data_crc32c = 3; - * @param bool $var - * @return $this - */ - public function setVerifiedDataCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_data_crc32c = $var; - - return $this; - } - - /** - * Integrity verification field. A flag indicating whether - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacVerifyRequest.mac]. A false value of this - * field indicates either that - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_mac_crc32c = 4; - * @return bool - */ - public function getVerifiedMacCrc32C() - { - return $this->verified_mac_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the - * [data][google.cloud.kms.v1.MacVerifyRequest.mac]. A false value of this - * field indicates either that - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_mac_crc32c = 4; - * @param bool $var - * @return $this - */ - public function setVerifiedMacCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_mac_crc32c = $var; - - return $this; - } - - /** - * Integrity verification field. This value is used for the integrity - * verification of [MacVerifyResponse.success]. If the value of this field - * contradicts the value of [MacVerifyResponse.success], discard the response - * and perform a limited number of retries. - * - * Generated from protobuf field bool verified_success_integrity = 5; - * @return bool - */ - public function getVerifiedSuccessIntegrity() - { - return $this->verified_success_integrity; - } - - /** - * Integrity verification field. This value is used for the integrity - * verification of [MacVerifyResponse.success]. If the value of this field - * contradicts the value of [MacVerifyResponse.success], discard the response - * and perform a limited number of retries. - * - * Generated from protobuf field bool verified_success_integrity = 5; - * @param bool $var - * @return $this - */ - public function setVerifiedSuccessIntegrity($var) - { - GPBUtil::checkBool($var); - $this->verified_success_integrity = $var; - - return $this; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for - * verification. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for - * verification. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 6; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ProtectionLevel.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ProtectionLevel.php deleted file mode 100644 index e6f74d6c62b8..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/ProtectionLevel.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.kms.v1.ProtectionLevel - */ -class ProtectionLevel -{ - /** - * Not specified. - * - * Generated from protobuf enum PROTECTION_LEVEL_UNSPECIFIED = 0; - */ - const PROTECTION_LEVEL_UNSPECIFIED = 0; - /** - * Crypto operations are performed in software. - * - * Generated from protobuf enum SOFTWARE = 1; - */ - const SOFTWARE = 1; - /** - * Crypto operations are performed in a Hardware Security Module. - * - * Generated from protobuf enum HSM = 2; - */ - const HSM = 2; - /** - * Crypto operations are performed by an external key manager. - * - * Generated from protobuf enum EXTERNAL = 3; - */ - const EXTERNAL = 3; - /** - * Crypto operations are performed in an EKM-over-VPC backend. - * - * Generated from protobuf enum EXTERNAL_VPC = 4; - */ - const EXTERNAL_VPC = 4; - - private static $valueToName = [ - self::PROTECTION_LEVEL_UNSPECIFIED => 'PROTECTION_LEVEL_UNSPECIFIED', - self::SOFTWARE => 'SOFTWARE', - self::HSM => 'HSM', - self::EXTERNAL => 'EXTERNAL', - self::EXTERNAL_VPC => 'EXTERNAL_VPC', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/PublicKey.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/PublicKey.php deleted file mode 100644 index 7309923596b0..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/PublicKey.php +++ /dev/null @@ -1,354 +0,0 @@ -google.cloud.kms.v1.PublicKey - */ -class PublicKey extends \Google\Protobuf\Internal\Message -{ - /** - * The public key, encoded in PEM format. For more information, see the - * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for - * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and - * [Textual Encoding of Subject Public Key Info] - * (https://tools.ietf.org/html/rfc7468#section-13). - * - * Generated from protobuf field string pem = 1; - */ - protected $pem = ''; - /** - * The - * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * associated with this key. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; - */ - protected $algorithm = 0; - /** - * Integrity verification field. A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by - * computing the CRC32C checksum of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your - * results to this field. Discard the response in case of non-matching - * checksum values, and perform a limited number of retries. A persistent - * mismatch may indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * NOTE: This field is in Beta. - * - * Generated from protobuf field .google.protobuf.Int64Value pem_crc32c = 3; - */ - protected $pem_crc32c = null; - /** - * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. - * Provided here for verification. - * NOTE: This field is in Beta. - * - * Generated from protobuf field string name = 4; - */ - protected $name = ''; - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; - */ - protected $protection_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $pem - * The public key, encoded in PEM format. For more information, see the - * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for - * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and - * [Textual Encoding of Subject Public Key Info] - * (https://tools.ietf.org/html/rfc7468#section-13). - * @type int $algorithm - * The - * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * associated with this key. - * @type \Google\Protobuf\Int64Value $pem_crc32c - * Integrity verification field. A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by - * computing the CRC32C checksum of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your - * results to this field. Discard the response in case of non-matching - * checksum values, and perform a limited number of retries. A persistent - * mismatch may indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * NOTE: This field is in Beta. - * @type string $name - * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. - * Provided here for verification. - * NOTE: This field is in Beta. - * @type int $protection_level - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce(); - parent::__construct($data); - } - - /** - * The public key, encoded in PEM format. For more information, see the - * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for - * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and - * [Textual Encoding of Subject Public Key Info] - * (https://tools.ietf.org/html/rfc7468#section-13). - * - * Generated from protobuf field string pem = 1; - * @return string - */ - public function getPem() - { - return $this->pem; - } - - /** - * The public key, encoded in PEM format. For more information, see the - * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for - * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and - * [Textual Encoding of Subject Public Key Info] - * (https://tools.ietf.org/html/rfc7468#section-13). - * - * Generated from protobuf field string pem = 1; - * @param string $var - * @return $this - */ - public function setPem($var) - { - GPBUtil::checkString($var, True); - $this->pem = $var; - - return $this; - } - - /** - * The - * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * associated with this key. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; - * @return int - */ - public function getAlgorithm() - { - return $this->algorithm; - } - - /** - * The - * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * associated with this key. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; - * @param int $var - * @return $this - */ - public function setAlgorithm($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionAlgorithm::class); - $this->algorithm = $var; - - return $this; - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by - * computing the CRC32C checksum of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your - * results to this field. Discard the response in case of non-matching - * checksum values, and perform a limited number of retries. A persistent - * mismatch may indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * NOTE: This field is in Beta. - * - * Generated from protobuf field .google.protobuf.Int64Value pem_crc32c = 3; - * @return \Google\Protobuf\Int64Value|null - */ - public function getPemCrc32C() - { - return $this->pem_crc32c; - } - - public function hasPemCrc32C() - { - return isset($this->pem_crc32c); - } - - public function clearPemCrc32C() - { - unset($this->pem_crc32c); - } - - /** - * Returns the unboxed value from getPemCrc32C() - - * Integrity verification field. A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by - * computing the CRC32C checksum of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your - * results to this field. Discard the response in case of non-matching - * checksum values, and perform a limited number of retries. A persistent - * mismatch may indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * NOTE: This field is in Beta. - * - * Generated from protobuf field .google.protobuf.Int64Value pem_crc32c = 3; - * @return int|string|null - */ - public function getPemCrc32CUnwrapped() - { - return $this->readWrapperValue("pem_crc32c"); - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by - * computing the CRC32C checksum of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your - * results to this field. Discard the response in case of non-matching - * checksum values, and perform a limited number of retries. A persistent - * mismatch may indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * NOTE: This field is in Beta. - * - * Generated from protobuf field .google.protobuf.Int64Value pem_crc32c = 3; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setPemCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->pem_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Integrity verification field. A CRC32C checksum of the returned - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by - * computing the CRC32C checksum of - * [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your - * results to this field. Discard the response in case of non-matching - * checksum values, and perform a limited number of retries. A persistent - * mismatch may indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * NOTE: This field is in Beta. - * - * Generated from protobuf field .google.protobuf.Int64Value pem_crc32c = 3; - * @param int|string|null $var - * @return $this - */ - public function setPemCrc32CUnwrapped($var) - { - $this->writeWrapperValue("pem_crc32c", $var); - return $this;} - - /** - * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. - * Provided here for verification. - * NOTE: This field is in Beta. - * - * Generated from protobuf field string name = 4; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. - * Provided here for verification. - * NOTE: This field is in Beta. - * - * Generated from protobuf field string name = 4; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 5; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptRequest.php deleted file mode 100644 index 3d6cd5c1a96f..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptRequest.php +++ /dev/null @@ -1,707 +0,0 @@ -google.cloud.kms.v1.RawDecryptRequest - */ -class RawDecryptRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * decryption. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. The encrypted data originally returned in - * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. - * - * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $ciphertext = ''; - /** - * Optional. Optional data that must match the data originally supplied in - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $additional_authenticated_data = ''; - /** - * Required. The initialization vector (IV) used during encryption, which must - * match the data originally provided in - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * - * Generated from protobuf field bytes initialization_vector = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $initialization_vector = ''; - /** - * The length of the authentication tag that is appended to the end of - * the ciphertext. If unspecified (0), the default value for the key's - * algorithm will be used (for AES-GCM, the default value is 16). - * - * Generated from protobuf field int32 tag_length = 5; - */ - protected $tag_length = 0; - /** - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received ciphertext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(ciphertext) is equal - * to ciphertext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ciphertext_crc32c = null; - /** - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $additional_authenticated_data_crc32c = null; - /** - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and - * if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $initialization_vector_crc32c = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * decryption. - * @type string $ciphertext - * Required. The encrypted data originally returned in - * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. - * @type string $additional_authenticated_data - * Optional. Optional data that must match the data originally supplied in - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * @type string $initialization_vector - * Required. The initialization vector (IV) used during encryption, which must - * match the data originally provided in - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * @type int $tag_length - * The length of the authentication tag that is appended to the end of - * the ciphertext. If unspecified (0), the default value for the key's - * algorithm will be used (for AES-GCM, the default value is 16). - * @type \Google\Protobuf\Int64Value $ciphertext_crc32c - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received ciphertext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(ciphertext) is equal - * to ciphertext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * @type \Google\Protobuf\Int64Value $additional_authenticated_data_crc32c - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * @type \Google\Protobuf\Int64Value $initialization_vector_crc32c - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and - * if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * decryption. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * decryption. - * - * 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; - } - - /** - * Required. The encrypted data originally returned in - * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. - * - * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCiphertext() - { - return $this->ciphertext; - } - - /** - * Required. The encrypted data originally returned in - * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. - * - * Generated from protobuf field bytes ciphertext = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCiphertext($var) - { - GPBUtil::checkString($var, False); - $this->ciphertext = $var; - - return $this; - } - - /** - * Optional. Optional data that must match the data originally supplied in - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAdditionalAuthenticatedData() - { - return $this->additional_authenticated_data; - } - - /** - * Optional. Optional data that must match the data originally supplied in - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAdditionalAuthenticatedData($var) - { - GPBUtil::checkString($var, False); - $this->additional_authenticated_data = $var; - - return $this; - } - - /** - * Required. The initialization vector (IV) used during encryption, which must - * match the data originally provided in - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * - * Generated from protobuf field bytes initialization_vector = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInitializationVector() - { - return $this->initialization_vector; - } - - /** - * Required. The initialization vector (IV) used during encryption, which must - * match the data originally provided in - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * - * Generated from protobuf field bytes initialization_vector = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInitializationVector($var) - { - GPBUtil::checkString($var, False); - $this->initialization_vector = $var; - - return $this; - } - - /** - * The length of the authentication tag that is appended to the end of - * the ciphertext. If unspecified (0), the default value for the key's - * algorithm will be used (for AES-GCM, the default value is 16). - * - * Generated from protobuf field int32 tag_length = 5; - * @return int - */ - public function getTagLength() - { - return $this->tag_length; - } - - /** - * The length of the authentication tag that is appended to the end of - * the ciphertext. If unspecified (0), the default value for the key's - * algorithm will be used (for AES-GCM, the default value is 16). - * - * Generated from protobuf field int32 tag_length = 5; - * @param int $var - * @return $this - */ - public function setTagLength($var) - { - GPBUtil::checkInt32($var); - $this->tag_length = $var; - - return $this; - } - - /** - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received ciphertext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(ciphertext) is equal - * to ciphertext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getCiphertextCrc32C() - { - return $this->ciphertext_crc32c; - } - - public function hasCiphertextCrc32C() - { - return isset($this->ciphertext_crc32c); - } - - public function clearCiphertextCrc32C() - { - unset($this->ciphertext_crc32c); - } - - /** - * Returns the unboxed value from getCiphertextCrc32C() - - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received ciphertext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(ciphertext) is equal - * to ciphertext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getCiphertextCrc32CUnwrapped() - { - return $this->readWrapperValue("ciphertext_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received ciphertext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(ciphertext) is equal - * to ciphertext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setCiphertextCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->ciphertext_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received ciphertext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(ciphertext) is equal - * to ciphertext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setCiphertextCrc32CUnwrapped($var) - { - $this->writeWrapperValue("ciphertext_crc32c", $var); - return $this;} - - /** - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getAdditionalAuthenticatedDataCrc32C() - { - return $this->additional_authenticated_data_crc32c; - } - - public function hasAdditionalAuthenticatedDataCrc32C() - { - return isset($this->additional_authenticated_data_crc32c); - } - - public function clearAdditionalAuthenticatedDataCrc32C() - { - unset($this->additional_authenticated_data_crc32c); - } - - /** - * Returns the unboxed value from getAdditionalAuthenticatedDataCrc32C() - - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getAdditionalAuthenticatedDataCrc32CUnwrapped() - { - return $this->readWrapperValue("additional_authenticated_data_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setAdditionalAuthenticatedDataCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->additional_authenticated_data_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setAdditionalAuthenticatedDataCrc32CUnwrapped($var) - { - $this->writeWrapperValue("additional_authenticated_data_crc32c", $var); - return $this;} - - /** - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and - * if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getInitializationVectorCrc32C() - { - return $this->initialization_vector_crc32c; - } - - public function hasInitializationVectorCrc32C() - { - return isset($this->initialization_vector_crc32c); - } - - public function clearInitializationVectorCrc32C() - { - unset($this->initialization_vector_crc32c); - } - - /** - * Returns the unboxed value from getInitializationVectorCrc32C() - - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and - * if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getInitializationVectorCrc32CUnwrapped() - { - return $this->readWrapperValue("initialization_vector_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and - * if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setInitializationVectorCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->initialization_vector_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and - * if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setInitializationVectorCrc32CUnwrapped($var) - { - $this->writeWrapperValue("initialization_vector_crc32c", $var); - return $this;} - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptResponse.php deleted file mode 100644 index 6ce9ba157ce9..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawDecryptResponse.php +++ /dev/null @@ -1,511 +0,0 @@ -google.cloud.kms.v1.RawDecryptResponse - */ -class RawDecryptResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The decrypted data. - * - * Generated from protobuf field bytes plaintext = 1; - */ - protected $plaintext = ''; - /** - * Integrity verification field. A CRC32C checksum of the returned - * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. - * An integrity check of plaintext can be performed by computing the CRC32C - * checksum of plaintext and comparing your results to this field. Discard the - * response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: receiving this response message - * indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - */ - protected $plaintext_crc32c = null; - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; - */ - protected $protection_level = 0; - /** - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the ciphertext. A false value of this - * field indicates either that - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_ciphertext_crc32c = 4; - */ - protected $verified_ciphertext_crc32c = false; - /** - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of additional_authenticated_data. A false - * value of this field indicates either that // - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 5; - */ - protected $verified_additional_authenticated_data_crc32c = false; - /** - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of initialization_vector. A false value of - * this field indicates either that - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_initialization_vector_crc32c = 6; - */ - protected $verified_initialization_vector_crc32c = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $plaintext - * The decrypted data. - * @type \Google\Protobuf\Int64Value $plaintext_crc32c - * Integrity verification field. A CRC32C checksum of the returned - * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. - * An integrity check of plaintext can be performed by computing the CRC32C - * checksum of plaintext and comparing your results to this field. Discard the - * response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: receiving this response message - * indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * @type int $protection_level - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * @type bool $verified_ciphertext_crc32c - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the ciphertext. A false value of this - * field indicates either that - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type bool $verified_additional_authenticated_data_crc32c - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of additional_authenticated_data. A false - * value of this field indicates either that // - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type bool $verified_initialization_vector_crc32c - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of initialization_vector. A false value of - * this field indicates either that - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The decrypted data. - * - * Generated from protobuf field bytes plaintext = 1; - * @return string - */ - public function getPlaintext() - { - return $this->plaintext; - } - - /** - * The decrypted data. - * - * Generated from protobuf field bytes plaintext = 1; - * @param string $var - * @return $this - */ - public function setPlaintext($var) - { - GPBUtil::checkString($var, False); - $this->plaintext = $var; - - return $this; - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. - * An integrity check of plaintext can be performed by computing the CRC32C - * checksum of plaintext and comparing your results to this field. Discard the - * response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: receiving this response message - * indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @return \Google\Protobuf\Int64Value|null - */ - public function getPlaintextCrc32C() - { - return $this->plaintext_crc32c; - } - - public function hasPlaintextCrc32C() - { - return isset($this->plaintext_crc32c); - } - - public function clearPlaintextCrc32C() - { - unset($this->plaintext_crc32c); - } - - /** - * Returns the unboxed value from getPlaintextCrc32C() - - * Integrity verification field. A CRC32C checksum of the returned - * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. - * An integrity check of plaintext can be performed by computing the CRC32C - * checksum of plaintext and comparing your results to this field. Discard the - * response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: receiving this response message - * indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @return int|string|null - */ - public function getPlaintextCrc32CUnwrapped() - { - return $this->readWrapperValue("plaintext_crc32c"); - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. - * An integrity check of plaintext can be performed by computing the CRC32C - * checksum of plaintext and comparing your results to this field. Discard the - * response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: receiving this response message - * indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setPlaintextCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->plaintext_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Integrity verification field. A CRC32C checksum of the returned - * [RawDecryptResponse.plaintext][google.cloud.kms.v1.RawDecryptResponse.plaintext]. - * An integrity check of plaintext can be performed by computing the CRC32C - * checksum of plaintext and comparing your results to this field. Discard the - * response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: receiving this response message - * indicates that - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to - * successfully decrypt the - * [ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 2; - * @param int|string|null $var - * @return $this - */ - public function setPlaintextCrc32CUnwrapped($var) - { - $this->writeWrapperValue("plaintext_crc32c", $var); - return $this;} - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * decryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 3; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - - /** - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the ciphertext. A false value of this - * field indicates either that - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_ciphertext_crc32c = 4; - * @return bool - */ - public function getVerifiedCiphertextCrc32C() - { - return $this->verified_ciphertext_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the ciphertext. A false value of this - * field indicates either that - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_ciphertext_crc32c = 4; - * @param bool $var - * @return $this - */ - public function setVerifiedCiphertextCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_ciphertext_crc32c = $var; - - return $this; - } - - /** - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of additional_authenticated_data. A false - * value of this field indicates either that // - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 5; - * @return bool - */ - public function getVerifiedAdditionalAuthenticatedDataCrc32C() - { - return $this->verified_additional_authenticated_data_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of additional_authenticated_data. A false - * value of this field indicates either that // - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 5; - * @param bool $var - * @return $this - */ - public function setVerifiedAdditionalAuthenticatedDataCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_additional_authenticated_data_crc32c = $var; - - return $this; - } - - /** - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of initialization_vector. A false value of - * this field indicates either that - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_initialization_vector_crc32c = 6; - * @return bool - */ - public function getVerifiedInitializationVectorCrc32C() - { - return $this->verified_initialization_vector_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of initialization_vector. A false value of - * this field indicates either that - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawDecryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_initialization_vector_crc32c = 6; - * @param bool $var - * @return $this - */ - public function setVerifiedInitializationVectorCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_initialization_vector_crc32c = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptRequest.php deleted file mode 100644 index 1f1d581d1d0d..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptRequest.php +++ /dev/null @@ -1,743 +0,0 @@ -google.cloud.kms.v1.RawEncryptRequest - */ -class RawEncryptRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * encryption. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. The data to encrypt. Must be no larger than 64KiB. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $plaintext = ''; - /** - * Optional. Optional data that, if specified, must also be provided during - * decryption through - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * This field may only be used in conjunction with an - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm] that accepts - * additional authenticated data (for example, AES-GCM). - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $additional_authenticated_data = ''; - /** - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received plaintext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(plaintext) is equal - * to plaintext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $plaintext_crc32c = null; - /** - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $additional_authenticated_data_crc32c = null; - /** - * Optional. A customer-supplied initialization vector that will be used for - * encryption. If it is not provided for AES-CBC and AES-CTR, one will be - * generated. It will be returned in - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * - * Generated from protobuf field bytes initialization_vector = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $initialization_vector = ''; - /** - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to - * initialization_vector_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $initialization_vector_crc32c = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * encryption. - * @type string $plaintext - * Required. The data to encrypt. Must be no larger than 64KiB. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * @type string $additional_authenticated_data - * Optional. Optional data that, if specified, must also be provided during - * decryption through - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * This field may only be used in conjunction with an - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm] that accepts - * additional authenticated data (for example, AES-GCM). - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * @type \Google\Protobuf\Int64Value $plaintext_crc32c - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received plaintext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(plaintext) is equal - * to plaintext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * @type \Google\Protobuf\Int64Value $additional_authenticated_data_crc32c - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * @type string $initialization_vector - * Optional. A customer-supplied initialization vector that will be used for - * encryption. If it is not provided for AES-CBC and AES-CTR, one will be - * generated. It will be returned in - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * @type \Google\Protobuf\Int64Value $initialization_vector_crc32c - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to - * initialization_vector_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * encryption. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * encryption. - * - * 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; - } - - /** - * Required. The data to encrypt. Must be no larger than 64KiB. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getPlaintext() - { - return $this->plaintext; - } - - /** - * Required. The data to encrypt. Must be no larger than 64KiB. - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes plaintext = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setPlaintext($var) - { - GPBUtil::checkString($var, False); - $this->plaintext = $var; - - return $this; - } - - /** - * Optional. Optional data that, if specified, must also be provided during - * decryption through - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * This field may only be used in conjunction with an - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm] that accepts - * additional authenticated data (for example, AES-GCM). - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAdditionalAuthenticatedData() - { - return $this->additional_authenticated_data; - } - - /** - * Optional. Optional data that, if specified, must also be provided during - * decryption through - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * This field may only be used in conjunction with an - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm] that accepts - * additional authenticated data (for example, AES-GCM). - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * - * Generated from protobuf field bytes additional_authenticated_data = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAdditionalAuthenticatedData($var) - { - GPBUtil::checkString($var, False); - $this->additional_authenticated_data = $var; - - return $this; - } - - /** - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received plaintext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(plaintext) is equal - * to plaintext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getPlaintextCrc32C() - { - return $this->plaintext_crc32c; - } - - public function hasPlaintextCrc32C() - { - return isset($this->plaintext_crc32c); - } - - public function clearPlaintextCrc32C() - { - unset($this->plaintext_crc32c); - } - - /** - * Returns the unboxed value from getPlaintextCrc32C() - - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received plaintext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(plaintext) is equal - * to plaintext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getPlaintextCrc32CUnwrapped() - { - return $this->readWrapperValue("plaintext_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received plaintext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(plaintext) is equal - * to plaintext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setPlaintextCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->plaintext_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received plaintext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(plaintext) is equal - * to plaintext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value plaintext_crc32c = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setPlaintextCrc32CUnwrapped($var) - { - $this->writeWrapperValue("plaintext_crc32c", $var); - return $this;} - - /** - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getAdditionalAuthenticatedDataCrc32C() - { - return $this->additional_authenticated_data_crc32c; - } - - public function hasAdditionalAuthenticatedDataCrc32C() - { - return isset($this->additional_authenticated_data_crc32c); - } - - public function clearAdditionalAuthenticatedDataCrc32C() - { - unset($this->additional_authenticated_data_crc32c); - } - - /** - * Returns the unboxed value from getAdditionalAuthenticatedDataCrc32C() - - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getAdditionalAuthenticatedDataCrc32CUnwrapped() - { - return $this->readWrapperValue("additional_authenticated_data_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setAdditionalAuthenticatedDataCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->additional_authenticated_data_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value additional_authenticated_data_crc32c = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setAdditionalAuthenticatedDataCrc32CUnwrapped($var) - { - $this->writeWrapperValue("additional_authenticated_data_crc32c", $var); - return $this;} - - /** - * Optional. A customer-supplied initialization vector that will be used for - * encryption. If it is not provided for AES-CBC and AES-CTR, one will be - * generated. It will be returned in - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * - * Generated from protobuf field bytes initialization_vector = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getInitializationVector() - { - return $this->initialization_vector; - } - - /** - * Optional. A customer-supplied initialization vector that will be used for - * encryption. If it is not provided for AES-CBC and AES-CTR, one will be - * generated. It will be returned in - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * - * Generated from protobuf field bytes initialization_vector = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setInitializationVector($var) - { - GPBUtil::checkString($var, False); - $this->initialization_vector = $var; - - return $this; - } - - /** - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to - * initialization_vector_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getInitializationVectorCrc32C() - { - return $this->initialization_vector_crc32c; - } - - public function hasInitializationVectorCrc32C() - { - return isset($this->initialization_vector_crc32c); - } - - public function clearInitializationVectorCrc32C() - { - unset($this->initialization_vector_crc32c); - } - - /** - * Returns the unboxed value from getInitializationVectorCrc32C() - - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to - * initialization_vector_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getInitializationVectorCrc32CUnwrapped() - { - return $this->readWrapperValue("initialization_vector_crc32c"); - } - - /** - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to - * initialization_vector_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setInitializationVectorCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->initialization_vector_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to - * initialization_vector_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setInitializationVectorCrc32CUnwrapped($var) - { - $this->writeWrapperValue("initialization_vector_crc32c", $var); - return $this;} - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptResponse.php deleted file mode 100644 index b779e66f66c8..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RawEncryptResponse.php +++ /dev/null @@ -1,744 +0,0 @@ -google.cloud.kms.v1.RawEncryptResponse - */ -class RawEncryptResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The encrypted data. In the case of AES-GCM, the authentication tag - * is the [tag_length][google.cloud.kms.v1.RawEncryptResponse.tag_length] - * bytes at the end of this field. - * - * Generated from protobuf field bytes ciphertext = 1; - */ - protected $ciphertext = ''; - /** - * The initialization vector (IV) generated by the service during - * encryption. This value must be stored and provided in - * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector] - * at decryption time. - * - * Generated from protobuf field bytes initialization_vector = 2; - */ - protected $initialization_vector = ''; - /** - * The length of the authentication tag that is appended to - * the end of the ciphertext. - * - * Generated from protobuf field int32 tag_length = 3; - */ - protected $tag_length = 0; - /** - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. - * An integrity check of ciphertext can be performed by computing the CRC32C - * checksum of ciphertext and comparing your results to this field. Discard - * the response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: This field is defined as int64 - * for reasons of compatibility across different languages. However, it is a - * non-negative integer, which will never exceed 2^32-1, and can be safely - * downconverted to uint32 in languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; - */ - protected $ciphertext_crc32c = null; - /** - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * An integrity check of initialization_vector can be performed by computing - * the CRC32C checksum of initialization_vector and comparing your results to - * this field. Discard the response in case of non-matching checksum values, - * and perform a limited number of retries. A persistent mismatch may indicate - * an issue in your computation of the CRC32C checksum. Note: This field is - * defined as int64 for reasons of compatibility across different languages. - * However, it is a non-negative integer, which will never exceed 2^32-1, and - * can be safely downconverted to uint32 in languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 5; - */ - protected $initialization_vector_crc32c = null; - /** - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the plaintext. A false value of this - * field indicates either that - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_plaintext_crc32c = 6; - */ - protected $verified_plaintext_crc32c = false; - /** - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of additional_authenticated_data. A false - * value of this field indicates either that // - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 7; - */ - protected $verified_additional_authenticated_data_crc32c = false; - /** - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of initialization_vector. A false value of - * this field indicates either that - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_initialization_vector_crc32c = 10; - */ - protected $verified_initialization_vector_crc32c = false; - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. Check this field to verify that the intended resource was used - * for encryption. - * - * Generated from protobuf field string name = 8; - */ - protected $name = ''; - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9; - */ - protected $protection_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $ciphertext - * The encrypted data. In the case of AES-GCM, the authentication tag - * is the [tag_length][google.cloud.kms.v1.RawEncryptResponse.tag_length] - * bytes at the end of this field. - * @type string $initialization_vector - * The initialization vector (IV) generated by the service during - * encryption. This value must be stored and provided in - * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector] - * at decryption time. - * @type int $tag_length - * The length of the authentication tag that is appended to - * the end of the ciphertext. - * @type \Google\Protobuf\Int64Value $ciphertext_crc32c - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. - * An integrity check of ciphertext can be performed by computing the CRC32C - * checksum of ciphertext and comparing your results to this field. Discard - * the response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: This field is defined as int64 - * for reasons of compatibility across different languages. However, it is a - * non-negative integer, which will never exceed 2^32-1, and can be safely - * downconverted to uint32 in languages that support this type. - * @type \Google\Protobuf\Int64Value $initialization_vector_crc32c - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * An integrity check of initialization_vector can be performed by computing - * the CRC32C checksum of initialization_vector and comparing your results to - * this field. Discard the response in case of non-matching checksum values, - * and perform a limited number of retries. A persistent mismatch may indicate - * an issue in your computation of the CRC32C checksum. Note: This field is - * defined as int64 for reasons of compatibility across different languages. - * However, it is a non-negative integer, which will never exceed 2^32-1, and - * can be safely downconverted to uint32 in languages that support this type. - * @type bool $verified_plaintext_crc32c - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the plaintext. A false value of this - * field indicates either that - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type bool $verified_additional_authenticated_data_crc32c - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of additional_authenticated_data. A false - * value of this field indicates either that // - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type bool $verified_initialization_vector_crc32c - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of initialization_vector. A false value of - * this field indicates either that - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * @type string $name - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. Check this field to verify that the intended resource was used - * for encryption. - * @type int $protection_level - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * The encrypted data. In the case of AES-GCM, the authentication tag - * is the [tag_length][google.cloud.kms.v1.RawEncryptResponse.tag_length] - * bytes at the end of this field. - * - * Generated from protobuf field bytes ciphertext = 1; - * @return string - */ - public function getCiphertext() - { - return $this->ciphertext; - } - - /** - * The encrypted data. In the case of AES-GCM, the authentication tag - * is the [tag_length][google.cloud.kms.v1.RawEncryptResponse.tag_length] - * bytes at the end of this field. - * - * Generated from protobuf field bytes ciphertext = 1; - * @param string $var - * @return $this - */ - public function setCiphertext($var) - { - GPBUtil::checkString($var, False); - $this->ciphertext = $var; - - return $this; - } - - /** - * The initialization vector (IV) generated by the service during - * encryption. This value must be stored and provided in - * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector] - * at decryption time. - * - * Generated from protobuf field bytes initialization_vector = 2; - * @return string - */ - public function getInitializationVector() - { - return $this->initialization_vector; - } - - /** - * The initialization vector (IV) generated by the service during - * encryption. This value must be stored and provided in - * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector] - * at decryption time. - * - * Generated from protobuf field bytes initialization_vector = 2; - * @param string $var - * @return $this - */ - public function setInitializationVector($var) - { - GPBUtil::checkString($var, False); - $this->initialization_vector = $var; - - return $this; - } - - /** - * The length of the authentication tag that is appended to - * the end of the ciphertext. - * - * Generated from protobuf field int32 tag_length = 3; - * @return int - */ - public function getTagLength() - { - return $this->tag_length; - } - - /** - * The length of the authentication tag that is appended to - * the end of the ciphertext. - * - * Generated from protobuf field int32 tag_length = 3; - * @param int $var - * @return $this - */ - public function setTagLength($var) - { - GPBUtil::checkInt32($var); - $this->tag_length = $var; - - return $this; - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. - * An integrity check of ciphertext can be performed by computing the CRC32C - * checksum of ciphertext and comparing your results to this field. Discard - * the response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: This field is defined as int64 - * for reasons of compatibility across different languages. However, it is a - * non-negative integer, which will never exceed 2^32-1, and can be safely - * downconverted to uint32 in languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; - * @return \Google\Protobuf\Int64Value|null - */ - public function getCiphertextCrc32C() - { - return $this->ciphertext_crc32c; - } - - public function hasCiphertextCrc32C() - { - return isset($this->ciphertext_crc32c); - } - - public function clearCiphertextCrc32C() - { - unset($this->ciphertext_crc32c); - } - - /** - * Returns the unboxed value from getCiphertextCrc32C() - - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. - * An integrity check of ciphertext can be performed by computing the CRC32C - * checksum of ciphertext and comparing your results to this field. Discard - * the response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: This field is defined as int64 - * for reasons of compatibility across different languages. However, it is a - * non-negative integer, which will never exceed 2^32-1, and can be safely - * downconverted to uint32 in languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; - * @return int|string|null - */ - public function getCiphertextCrc32CUnwrapped() - { - return $this->readWrapperValue("ciphertext_crc32c"); - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. - * An integrity check of ciphertext can be performed by computing the CRC32C - * checksum of ciphertext and comparing your results to this field. Discard - * the response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: This field is defined as int64 - * for reasons of compatibility across different languages. However, it is a - * non-negative integer, which will never exceed 2^32-1, and can be safely - * downconverted to uint32 in languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setCiphertextCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->ciphertext_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. - * An integrity check of ciphertext can be performed by computing the CRC32C - * checksum of ciphertext and comparing your results to this field. Discard - * the response in case of non-matching checksum values, and perform a limited - * number of retries. A persistent mismatch may indicate an issue in your - * computation of the CRC32C checksum. Note: This field is defined as int64 - * for reasons of compatibility across different languages. However, it is a - * non-negative integer, which will never exceed 2^32-1, and can be safely - * downconverted to uint32 in languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value ciphertext_crc32c = 4; - * @param int|string|null $var - * @return $this - */ - public function setCiphertextCrc32CUnwrapped($var) - { - $this->writeWrapperValue("ciphertext_crc32c", $var); - return $this;} - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * An integrity check of initialization_vector can be performed by computing - * the CRC32C checksum of initialization_vector and comparing your results to - * this field. Discard the response in case of non-matching checksum values, - * and perform a limited number of retries. A persistent mismatch may indicate - * an issue in your computation of the CRC32C checksum. Note: This field is - * defined as int64 for reasons of compatibility across different languages. - * However, it is a non-negative integer, which will never exceed 2^32-1, and - * can be safely downconverted to uint32 in languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 5; - * @return \Google\Protobuf\Int64Value|null - */ - public function getInitializationVectorCrc32C() - { - return $this->initialization_vector_crc32c; - } - - public function hasInitializationVectorCrc32C() - { - return isset($this->initialization_vector_crc32c); - } - - public function clearInitializationVectorCrc32C() - { - unset($this->initialization_vector_crc32c); - } - - /** - * Returns the unboxed value from getInitializationVectorCrc32C() - - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * An integrity check of initialization_vector can be performed by computing - * the CRC32C checksum of initialization_vector and comparing your results to - * this field. Discard the response in case of non-matching checksum values, - * and perform a limited number of retries. A persistent mismatch may indicate - * an issue in your computation of the CRC32C checksum. Note: This field is - * defined as int64 for reasons of compatibility across different languages. - * However, it is a non-negative integer, which will never exceed 2^32-1, and - * can be safely downconverted to uint32 in languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 5; - * @return int|string|null - */ - public function getInitializationVectorCrc32CUnwrapped() - { - return $this->readWrapperValue("initialization_vector_crc32c"); - } - - /** - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * An integrity check of initialization_vector can be performed by computing - * the CRC32C checksum of initialization_vector and comparing your results to - * this field. Discard the response in case of non-matching checksum values, - * and perform a limited number of retries. A persistent mismatch may indicate - * an issue in your computation of the CRC32C checksum. Note: This field is - * defined as int64 for reasons of compatibility across different languages. - * However, it is a non-negative integer, which will never exceed 2^32-1, and - * can be safely downconverted to uint32 in languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 5; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setInitializationVectorCrc32C($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->initialization_vector_crc32c = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Integrity verification field. A CRC32C checksum of the returned - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * An integrity check of initialization_vector can be performed by computing - * the CRC32C checksum of initialization_vector and comparing your results to - * this field. Discard the response in case of non-matching checksum values, - * and perform a limited number of retries. A persistent mismatch may indicate - * an issue in your computation of the CRC32C checksum. Note: This field is - * defined as int64 for reasons of compatibility across different languages. - * However, it is a non-negative integer, which will never exceed 2^32-1, and - * can be safely downconverted to uint32 in languages that support this type. - * - * Generated from protobuf field .google.protobuf.Int64Value initialization_vector_crc32c = 5; - * @param int|string|null $var - * @return $this - */ - public function setInitializationVectorCrc32CUnwrapped($var) - { - $this->writeWrapperValue("initialization_vector_crc32c", $var); - return $this;} - - /** - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the plaintext. A false value of this - * field indicates either that - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_plaintext_crc32c = 6; - * @return bool - */ - public function getVerifiedPlaintextCrc32C() - { - return $this->verified_plaintext_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of the plaintext. A false value of this - * field indicates either that - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.plaintext_crc32c][google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_plaintext_crc32c = 6; - * @param bool $var - * @return $this - */ - public function setVerifiedPlaintextCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_plaintext_crc32c = $var; - - return $this; - } - - /** - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of additional_authenticated_data. A false - * value of this field indicates either that // - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 7; - * @return bool - */ - public function getVerifiedAdditionalAuthenticatedDataCrc32C() - { - return $this->verified_additional_authenticated_data_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of additional_authenticated_data. A false - * value of this field indicates either that // - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_additional_authenticated_data_crc32c = 7; - * @param bool $var - * @return $this - */ - public function setVerifiedAdditionalAuthenticatedDataCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_additional_authenticated_data_crc32c = $var; - - return $this; - } - - /** - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of initialization_vector. A false value of - * this field indicates either that - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_initialization_vector_crc32c = 10; - * @return bool - */ - public function getVerifiedInitializationVectorCrc32C() - { - return $this->verified_initialization_vector_crc32c; - } - - /** - * Integrity verification field. A flag indicating whether - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * was received by - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used - * for the integrity verification of initialization_vector. A false value of - * this field indicates either that - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * was left unset or that it was not delivered to - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've - * set - * [RawEncryptRequest.initialization_vector_crc32c][google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c] - * but this field is still false, discard the response and perform a limited - * number of retries. - * - * Generated from protobuf field bool verified_initialization_vector_crc32c = 10; - * @param bool $var - * @return $this - */ - public function setVerifiedInitializationVectorCrc32C($var) - { - GPBUtil::checkBool($var); - $this->verified_initialization_vector_crc32c = $var; - - return $this; - } - - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. Check this field to verify that the intended resource was used - * for encryption. - * - * Generated from protobuf field string name = 8; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. Check this field to verify that the intended resource was used - * for encryption. - * - * Generated from protobuf field string name = 8; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9; - * @return int - */ - public function getProtectionLevel() - { - return $this->protection_level; - } - - /** - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in - * encryption. - * - * Generated from protobuf field .google.cloud.kms.v1.ProtectionLevel protection_level = 9; - * @param int $var - * @return $this - */ - public function setProtectionLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class); - $this->protection_level = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RestoreCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RestoreCryptoKeyVersionRequest.php deleted file mode 100644 index d62fe8e8863c..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/RestoreCryptoKeyVersionRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - */ -class RestoreCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. Please see - * {@see KeyManagementServiceClient::cryptoKeyVersionName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\RestoreCryptoKeyVersionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. - * - * 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 - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. - * - * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyPrimaryVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyPrimaryVersionRequest.php deleted file mode 100644 index 1a9161832a5e..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyPrimaryVersionRequest.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - */ -class UpdateCryptoKeyPrimaryVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The id of the child - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. - * - * Generated from protobuf field string crypto_key_version_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $crypto_key_version_id = ''; - - /** - * @param string $name Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. Please see - * {@see KeyManagementServiceClient::cryptoKeyName()} for help formatting this field. - * @param string $cryptoKeyVersionId Required. The id of the child - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. - * - * @return \Google\Cloud\Kms\V1\UpdateCryptoKeyPrimaryVersionRequest - * - * @experimental - */ - public static function build(string $name, string $cryptoKeyVersionId): self - { - return (new self()) - ->setName($name) - ->setCryptoKeyVersionId($cryptoKeyVersionId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. - * @type string $crypto_key_version_id - * Required. The id of the child - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. - * - * 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 - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. - * - * 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; - } - - /** - * Required. The id of the child - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. - * - * Generated from protobuf field string crypto_key_version_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCryptoKeyVersionId() - { - return $this->crypto_key_version_id; - } - - /** - * Required. The id of the child - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. - * - * Generated from protobuf field string crypto_key_version_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCryptoKeyVersionId($var) - { - GPBUtil::checkString($var, True); - $this->crypto_key_version_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyRequest.php deleted file mode 100644 index b11e974dbe70..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -google.cloud.kms.v1.UpdateCryptoKeyRequest - */ -class UpdateCryptoKeyRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $crypto_key = null; - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Kms\V1\CryptoKey $cryptoKey Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. - * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. - * - * @return \Google\Cloud\Kms\V1\UpdateCryptoKeyRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Kms\V1\CryptoKey $cryptoKey, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setCryptoKey($cryptoKey) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Kms\V1\CryptoKey $crypto_key - * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. List of fields to be updated in this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Kms\V1\CryptoKey|null - */ - public function getCryptoKey() - { - return $this->crypto_key; - } - - public function hasCryptoKey() - { - return isset($this->crypto_key); - } - - public function clearCryptoKey() - { - unset($this->crypto_key); - } - - /** - * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKey crypto_key = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Kms\V1\CryptoKey $var - * @return $this - */ - public function setCryptoKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKey::class); - $this->crypto_key = $var; - - return $this; - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyVersionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyVersionRequest.php deleted file mode 100644 index c91c56d8b516..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateCryptoKeyVersionRequest.php +++ /dev/null @@ -1,142 +0,0 @@ -google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - */ -class UpdateCryptoKeyVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * updated values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $crypto_key_version = null; - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Kms\V1\CryptoKeyVersion $cryptoKeyVersion Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * updated values. - * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. - * - * @return \Google\Cloud\Kms\V1\UpdateCryptoKeyVersionRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Kms\V1\CryptoKeyVersion $cryptoKeyVersion, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setCryptoKeyVersion($cryptoKeyVersion) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Kms\V1\CryptoKeyVersion $crypto_key_version - * Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * updated values. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. List of fields to be updated in this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce(); - parent::__construct($data); - } - - /** - * Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * updated values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Kms\V1\CryptoKeyVersion|null - */ - public function getCryptoKeyVersion() - { - return $this->crypto_key_version; - } - - public function hasCryptoKeyVersion() - { - return isset($this->crypto_key_version); - } - - public function clearCryptoKeyVersion() - { - unset($this->crypto_key_version); - } - - /** - * Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * updated values. - * - * Generated from protobuf field .google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Kms\V1\CryptoKeyVersion $var - * @return $this - */ - public function setCryptoKeyVersion($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKeyVersion::class); - $this->crypto_key_version = $var; - - return $this; - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConfigRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConfigRequest.php deleted file mode 100644 index e33d285b04a2..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConfigRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -google.cloud.kms.v1.UpdateEkmConfigRequest - */ -class UpdateEkmConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConfig ekm_config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $ekm_config = null; - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Kms\V1\EkmConfig $ekmConfig Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. - * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. - * - * @return \Google\Cloud\Kms\V1\UpdateEkmConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Kms\V1\EkmConfig $ekmConfig, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setEkmConfig($ekmConfig) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Kms\V1\EkmConfig $ekm_config - * Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. List of fields to be updated in this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConfig ekm_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Kms\V1\EkmConfig|null - */ - public function getEkmConfig() - { - return $this->ekm_config; - } - - public function hasEkmConfig() - { - return isset($this->ekm_config); - } - - public function clearEkmConfig() - { - unset($this->ekm_config); - } - - /** - * Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConfig ekm_config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Kms\V1\EkmConfig $var - * @return $this - */ - public function setEkmConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\EkmConfig::class); - $this->ekm_config = $var; - - return $this; - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConnectionRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConnectionRequest.php deleted file mode 100644 index 0a77d3a6ab24..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/UpdateEkmConnectionRequest.php +++ /dev/null @@ -1,142 +0,0 @@ -google.cloud.kms.v1.UpdateEkmConnectionRequest - */ -class UpdateEkmConnectionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $ekm_connection = null; - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Kms\V1\EkmConnection $ekmConnection Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated - * values. - * @param \Google\Protobuf\FieldMask $updateMask Required. List of fields to be updated in this request. - * - * @return \Google\Cloud\Kms\V1\UpdateEkmConnectionRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Kms\V1\EkmConnection $ekmConnection, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setEkmConnection($ekmConnection) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Kms\V1\EkmConnection $ekm_connection - * Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated - * values. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. List of fields to be updated in this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Kms\V1\EkmConnection|null - */ - public function getEkmConnection() - { - return $this->ekm_connection; - } - - public function hasEkmConnection() - { - return isset($this->ekm_connection); - } - - public function clearEkmConnection() - { - unset($this->ekm_connection); - } - - /** - * Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated - * values. - * - * Generated from protobuf field .google.cloud.kms.v1.EkmConnection ekm_connection = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Kms\V1\EkmConnection $var - * @return $this - */ - public function setEkmConnection($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\EkmConnection::class); - $this->ekm_connection = $var; - - return $this; - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. List of fields to be updated in this request. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityRequest.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityRequest.php deleted file mode 100644 index 7ad43869a480..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.kms.v1.VerifyConnectivityRequest - */ -class VerifyConnectivityRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. Please see - * {@see EkmServiceClient::ekmConnectionName()} for help formatting this field. - * - * @return \Google\Cloud\Kms\V1\VerifyConnectivityRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. - * - * 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][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. - * - * 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/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityResponse.php b/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityResponse.php deleted file mode 100644 index 4221f23c7637..000000000000 --- a/owl-bot-staging/Kms/v1/proto/src/Google/Cloud/Kms/V1/VerifyConnectivityResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.kms.v1.VerifyConnectivityResponse - */ -class VerifyConnectivityResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Kms\V1\EkmService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/create_ekm_connection.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/create_ekm_connection.php deleted file mode 100644 index da0a80095906..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/create_ekm_connection.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent) - ->setEkmConnectionId($ekmConnectionId) - ->setEkmConnection($ekmConnection); - - // Call the API and handle any network failures. - try { - /** @var EkmConnection $response */ - $response = $ekmServiceClient->createEkmConnection($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EkmServiceClient::locationName('[PROJECT]', '[LOCATION]'); - $ekmConnectionId = '[EKM_CONNECTION_ID]'; - - create_ekm_connection_sample($formattedParent, $ekmConnectionId); -} -// [END cloudkms_v1_generated_EkmService_CreateEkmConnection_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_config.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_config.php deleted file mode 100644 index 513e4675c0f5..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_config.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var EkmConfig $response */ - $response = $ekmServiceClient->getEkmConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = EkmServiceClient::ekmConfigName('[PROJECT]', '[LOCATION]'); - - get_ekm_config_sample($formattedName); -} -// [END cloudkms_v1_generated_EkmService_GetEkmConfig_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_connection.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_connection.php deleted file mode 100644 index af11f93fdf09..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_ekm_connection.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var EkmConnection $response */ - $response = $ekmServiceClient->getEkmConnection($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = EkmServiceClient::ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - - get_ekm_connection_sample($formattedName); -} -// [END cloudkms_v1_generated_EkmService_GetEkmConnection_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_iam_policy.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_iam_policy.php deleted file mode 100644 index 68149cdc7afa..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_iam_policy.php +++ /dev/null @@ -1,72 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $ekmServiceClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END cloudkms_v1_generated_EkmService_GetIamPolicy_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_location.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_location.php deleted file mode 100644 index 310924b508b7..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudkms_v1_generated_EkmService_GetLocation_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_ekm_connections.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_ekm_connections.php deleted file mode 100644 index d0be2f4c697e..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_ekm_connections.php +++ /dev/null @@ -1,78 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $ekmServiceClient->listEkmConnections($request); - - /** @var EkmConnection $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EkmServiceClient::locationName('[PROJECT]', '[LOCATION]'); - - list_ekm_connections_sample($formattedParent); -} -// [END cloudkms_v1_generated_EkmService_ListEkmConnections_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_locations.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_locations.php deleted file mode 100644 index 1bb19c6e2482..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudkms_v1_generated_EkmService_ListLocations_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/set_iam_policy.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/set_iam_policy.php deleted file mode 100644 index 8d33c45f5688..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/set_iam_policy.php +++ /dev/null @@ -1,77 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $ekmServiceClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END cloudkms_v1_generated_EkmService_SetIamPolicy_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/test_iam_permissions.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/test_iam_permissions.php deleted file mode 100644 index 5f04484afdcb..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/test_iam_permissions.php +++ /dev/null @@ -1,84 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $ekmServiceClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END cloudkms_v1_generated_EkmService_TestIamPermissions_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_config.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_config.php deleted file mode 100644 index 4545f68080e6..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_config.php +++ /dev/null @@ -1,63 +0,0 @@ -setEkmConfig($ekmConfig) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var EkmConfig $response */ - $response = $ekmServiceClient->updateEkmConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudkms_v1_generated_EkmService_UpdateEkmConfig_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_connection.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_connection.php deleted file mode 100644 index 25e0f134db8c..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/update_ekm_connection.php +++ /dev/null @@ -1,62 +0,0 @@ -setEkmConnection($ekmConnection) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var EkmConnection $response */ - $response = $ekmServiceClient->updateEkmConnection($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudkms_v1_generated_EkmService_UpdateEkmConnection_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/verify_connectivity.php b/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/verify_connectivity.php deleted file mode 100644 index f3a099f99485..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/EkmServiceClient/verify_connectivity.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var VerifyConnectivityResponse $response */ - $response = $ekmServiceClient->verifyConnectivity($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = EkmServiceClient::ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - - verify_connectivity_sample($formattedName); -} -// [END cloudkms_v1_generated_EkmService_VerifyConnectivity_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_decrypt.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_decrypt.php deleted file mode 100644 index 09b3e01d23b1..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_decrypt.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($formattedName) - ->setCiphertext($ciphertext); - - // Call the API and handle any network failures. - try { - /** @var AsymmetricDecryptResponse $response */ - $response = $keyManagementServiceClient->asymmetricDecrypt($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - $ciphertext = '...'; - - asymmetric_decrypt_sample($formattedName, $ciphertext); -} -// [END cloudkms_v1_generated_KeyManagementService_AsymmetricDecrypt_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_sign.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_sign.php deleted file mode 100644 index b8467961948b..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/asymmetric_sign.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName) - ->setDigest($digest); - - // Call the API and handle any network failures. - try { - /** @var AsymmetricSignResponse $response */ - $response = $keyManagementServiceClient->asymmetricSign($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - - asymmetric_sign_sample($formattedName); -} -// [END cloudkms_v1_generated_KeyManagementService_AsymmetricSign_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key.php deleted file mode 100644 index b2bc66b850b6..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key.php +++ /dev/null @@ -1,83 +0,0 @@ -setParent($formattedParent) - ->setCryptoKeyId($cryptoKeyId) - ->setCryptoKey($cryptoKey); - - // Call the API and handle any network failures. - try { - /** @var CryptoKey $response */ - $response = $keyManagementServiceClient->createCryptoKey($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = KeyManagementServiceClient::keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $cryptoKeyId = '[CRYPTO_KEY_ID]'; - - create_crypto_key_sample($formattedParent, $cryptoKeyId); -} -// [END cloudkms_v1_generated_KeyManagementService_CreateCryptoKey_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key_version.php deleted file mode 100644 index 71cc05d5681f..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_crypto_key_version.php +++ /dev/null @@ -1,85 +0,0 @@ -setParent($formattedParent) - ->setCryptoKeyVersion($cryptoKeyVersion); - - // Call the API and handle any network failures. - try { - /** @var CryptoKeyVersion $response */ - $response = $keyManagementServiceClient->createCryptoKeyVersion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = KeyManagementServiceClient::cryptoKeyName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - - create_crypto_key_version_sample($formattedParent); -} -// [END cloudkms_v1_generated_KeyManagementService_CreateCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_import_job.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_import_job.php deleted file mode 100644 index 510ff5be970a..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_import_job.php +++ /dev/null @@ -1,106 +0,0 @@ -setImportMethod($importJobImportMethod) - ->setProtectionLevel($importJobProtectionLevel); - $request = (new CreateImportJobRequest()) - ->setParent($formattedParent) - ->setImportJobId($importJobId) - ->setImportJob($importJob); - - // Call the API and handle any network failures. - try { - /** @var ImportJob $response */ - $response = $keyManagementServiceClient->createImportJob($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = KeyManagementServiceClient::keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $importJobId = '[IMPORT_JOB_ID]'; - $importJobImportMethod = ImportMethod::IMPORT_METHOD_UNSPECIFIED; - $importJobProtectionLevel = ProtectionLevel::PROTECTION_LEVEL_UNSPECIFIED; - - create_import_job_sample( - $formattedParent, - $importJobId, - $importJobImportMethod, - $importJobProtectionLevel - ); -} -// [END cloudkms_v1_generated_KeyManagementService_CreateImportJob_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_key_ring.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_key_ring.php deleted file mode 100644 index 5f8ee1d3ad45..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/create_key_ring.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent) - ->setKeyRingId($keyRingId) - ->setKeyRing($keyRing); - - // Call the API and handle any network failures. - try { - /** @var KeyRing $response */ - $response = $keyManagementServiceClient->createKeyRing($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = KeyManagementServiceClient::locationName('[PROJECT]', '[LOCATION]'); - $keyRingId = '[KEY_RING_ID]'; - - create_key_ring_sample($formattedParent, $keyRingId); -} -// [END cloudkms_v1_generated_KeyManagementService_CreateKeyRing_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/decrypt.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/decrypt.php deleted file mode 100644 index b5a474d68f41..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/decrypt.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($formattedName) - ->setCiphertext($ciphertext); - - // Call the API and handle any network failures. - try { - /** @var DecryptResponse $response */ - $response = $keyManagementServiceClient->decrypt($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::cryptoKeyName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - $ciphertext = '...'; - - decrypt_sample($formattedName, $ciphertext); -} -// [END cloudkms_v1_generated_KeyManagementService_Decrypt_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/destroy_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/destroy_crypto_key_version.php deleted file mode 100644 index b0090eef2c77..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/destroy_crypto_key_version.php +++ /dev/null @@ -1,98 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var CryptoKeyVersion $response */ - $response = $keyManagementServiceClient->destroyCryptoKeyVersion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - - destroy_crypto_key_version_sample($formattedName); -} -// [END cloudkms_v1_generated_KeyManagementService_DestroyCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/encrypt.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/encrypt.php deleted file mode 100644 index 7f719bcf2ef5..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/encrypt.php +++ /dev/null @@ -1,92 +0,0 @@ -setName($name) - ->setPlaintext($plaintext); - - // Call the API and handle any network failures. - try { - /** @var EncryptResponse $response */ - $response = $keyManagementServiceClient->encrypt($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - $plaintext = '...'; - - encrypt_sample($name, $plaintext); -} -// [END cloudkms_v1_generated_KeyManagementService_Encrypt_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/generate_random_bytes.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/generate_random_bytes.php deleted file mode 100644 index a63710011bfd..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/generate_random_bytes.php +++ /dev/null @@ -1,58 +0,0 @@ -generateRandomBytes($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudkms_v1_generated_KeyManagementService_GenerateRandomBytes_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key.php deleted file mode 100644 index 4919946c0081..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var CryptoKey $response */ - $response = $keyManagementServiceClient->getCryptoKey($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::cryptoKeyName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - - get_crypto_key_sample($formattedName); -} -// [END cloudkms_v1_generated_KeyManagementService_GetCryptoKey_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key_version.php deleted file mode 100644 index 17903f74ced5..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_crypto_key_version.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var CryptoKeyVersion $response */ - $response = $keyManagementServiceClient->getCryptoKeyVersion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - - get_crypto_key_version_sample($formattedName); -} -// [END cloudkms_v1_generated_KeyManagementService_GetCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_iam_policy.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_iam_policy.php deleted file mode 100644 index 71a0fe28319b..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_iam_policy.php +++ /dev/null @@ -1,72 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $keyManagementServiceClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END cloudkms_v1_generated_KeyManagementService_GetIamPolicy_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_import_job.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_import_job.php deleted file mode 100644 index 0d020d202343..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_import_job.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var ImportJob $response */ - $response = $keyManagementServiceClient->getImportJob($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::importJobName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[IMPORT_JOB]' - ); - - get_import_job_sample($formattedName); -} -// [END cloudkms_v1_generated_KeyManagementService_GetImportJob_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_key_ring.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_key_ring.php deleted file mode 100644 index b21c49ace1d3..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_key_ring.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var KeyRing $response */ - $response = $keyManagementServiceClient->getKeyRing($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - - get_key_ring_sample($formattedName); -} -// [END cloudkms_v1_generated_KeyManagementService_GetKeyRing_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_location.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_location.php deleted file mode 100644 index d5aa66a0b9d9..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudkms_v1_generated_KeyManagementService_GetLocation_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_public_key.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_public_key.php deleted file mode 100644 index e30e488a9e65..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/get_public_key.php +++ /dev/null @@ -1,83 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var PublicKey $response */ - $response = $keyManagementServiceClient->getPublicKey($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - - get_public_key_sample($formattedName); -} -// [END cloudkms_v1_generated_KeyManagementService_GetPublicKey_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/import_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/import_crypto_key_version.php deleted file mode 100644 index 8e82a9df1cc8..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/import_crypto_key_version.php +++ /dev/null @@ -1,103 +0,0 @@ -setParent($formattedParent) - ->setAlgorithm($algorithm) - ->setImportJob($importJob); - - // Call the API and handle any network failures. - try { - /** @var CryptoKeyVersion $response */ - $response = $keyManagementServiceClient->importCryptoKeyVersion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = KeyManagementServiceClient::cryptoKeyName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; - $importJob = '[IMPORT_JOB]'; - - import_crypto_key_version_sample($formattedParent, $algorithm, $importJob); -} -// [END cloudkms_v1_generated_KeyManagementService_ImportCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_key_versions.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_key_versions.php deleted file mode 100644 index 015a526ed4d2..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_key_versions.php +++ /dev/null @@ -1,83 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $keyManagementServiceClient->listCryptoKeyVersions($request); - - /** @var CryptoKeyVersion $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = KeyManagementServiceClient::cryptoKeyName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - - list_crypto_key_versions_sample($formattedParent); -} -// [END cloudkms_v1_generated_KeyManagementService_ListCryptoKeyVersions_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_keys.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_keys.php deleted file mode 100644 index 29a2ae2517ef..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_crypto_keys.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $keyManagementServiceClient->listCryptoKeys($request); - - /** @var CryptoKey $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = KeyManagementServiceClient::keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - - list_crypto_keys_sample($formattedParent); -} -// [END cloudkms_v1_generated_KeyManagementService_ListCryptoKeys_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_import_jobs.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_import_jobs.php deleted file mode 100644 index 8ffb69c6a6de..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_import_jobs.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $keyManagementServiceClient->listImportJobs($request); - - /** @var ImportJob $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = KeyManagementServiceClient::keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - - list_import_jobs_sample($formattedParent); -} -// [END cloudkms_v1_generated_KeyManagementService_ListImportJobs_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_key_rings.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_key_rings.php deleted file mode 100644 index 1aa8f0bbc947..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_key_rings.php +++ /dev/null @@ -1,78 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $keyManagementServiceClient->listKeyRings($request); - - /** @var KeyRing $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = KeyManagementServiceClient::locationName('[PROJECT]', '[LOCATION]'); - - list_key_rings_sample($formattedParent); -} -// [END cloudkms_v1_generated_KeyManagementService_ListKeyRings_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_locations.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_locations.php deleted file mode 100644 index fa3ffc21350e..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudkms_v1_generated_KeyManagementService_ListLocations_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_sign.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_sign.php deleted file mode 100644 index 41eb52ab8f14..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_sign.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($formattedName) - ->setData($data); - - // Call the API and handle any network failures. - try { - /** @var MacSignResponse $response */ - $response = $keyManagementServiceClient->macSign($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - $data = '...'; - - mac_sign_sample($formattedName, $data); -} -// [END cloudkms_v1_generated_KeyManagementService_MacSign_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_verify.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_verify.php deleted file mode 100644 index 31bbf3714133..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/mac_verify.php +++ /dev/null @@ -1,90 +0,0 @@ -setName($formattedName) - ->setData($data) - ->setMac($mac); - - // Call the API and handle any network failures. - try { - /** @var MacVerifyResponse $response */ - $response = $keyManagementServiceClient->macVerify($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - $data = '...'; - $mac = '...'; - - mac_verify_sample($formattedName, $data, $mac); -} -// [END cloudkms_v1_generated_KeyManagementService_MacVerify_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_decrypt.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_decrypt.php deleted file mode 100644 index 45d7fd391947..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_decrypt.php +++ /dev/null @@ -1,84 +0,0 @@ -setName($name) - ->setCiphertext($ciphertext) - ->setInitializationVector($initializationVector); - - // Call the API and handle any network failures. - try { - /** @var RawDecryptResponse $response */ - $response = $keyManagementServiceClient->rawDecrypt($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - $ciphertext = '...'; - $initializationVector = '...'; - - raw_decrypt_sample($name, $ciphertext, $initializationVector); -} -// [END cloudkms_v1_generated_KeyManagementService_RawDecrypt_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_encrypt.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_encrypt.php deleted file mode 100644 index 6087bc112e2c..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/raw_encrypt.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($name) - ->setPlaintext($plaintext); - - // Call the API and handle any network failures. - try { - /** @var RawEncryptResponse $response */ - $response = $keyManagementServiceClient->rawEncrypt($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - $plaintext = '...'; - - raw_encrypt_sample($name, $plaintext); -} -// [END cloudkms_v1_generated_KeyManagementService_RawEncrypt_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/restore_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/restore_crypto_key_version.php deleted file mode 100644 index 5d17fc937aaf..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/restore_crypto_key_version.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var CryptoKeyVersion $response */ - $response = $keyManagementServiceClient->restoreCryptoKeyVersion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::cryptoKeyVersionName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]', - '[CRYPTO_KEY_VERSION]' - ); - - restore_crypto_key_version_sample($formattedName); -} -// [END cloudkms_v1_generated_KeyManagementService_RestoreCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/set_iam_policy.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/set_iam_policy.php deleted file mode 100644 index e3db153a0131..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/set_iam_policy.php +++ /dev/null @@ -1,77 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $keyManagementServiceClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END cloudkms_v1_generated_KeyManagementService_SetIamPolicy_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/test_iam_permissions.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/test_iam_permissions.php deleted file mode 100644 index f7d0482b677c..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/test_iam_permissions.php +++ /dev/null @@ -1,84 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $keyManagementServiceClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END cloudkms_v1_generated_KeyManagementService_TestIamPermissions_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key.php deleted file mode 100644 index 083529fff6b1..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key.php +++ /dev/null @@ -1,62 +0,0 @@ -setCryptoKey($cryptoKey) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var CryptoKey $response */ - $response = $keyManagementServiceClient->updateCryptoKey($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKey_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_primary_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_primary_version.php deleted file mode 100644 index 6bf7dc69fbd7..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_primary_version.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($formattedName) - ->setCryptoKeyVersionId($cryptoKeyVersionId); - - // Call the API and handle any network failures. - try { - /** @var CryptoKey $response */ - $response = $keyManagementServiceClient->updateCryptoKeyPrimaryVersion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KeyManagementServiceClient::cryptoKeyName( - '[PROJECT]', - '[LOCATION]', - '[KEY_RING]', - '[CRYPTO_KEY]' - ); - $cryptoKeyVersionId = '[CRYPTO_KEY_VERSION_ID]'; - - update_crypto_key_primary_version_sample($formattedName, $cryptoKeyVersionId); -} -// [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync] diff --git a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_version.php b/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_version.php deleted file mode 100644 index 156a84fa5eae..000000000000 --- a/owl-bot-staging/Kms/v1/samples/V1/KeyManagementServiceClient/update_crypto_key_version.php +++ /dev/null @@ -1,73 +0,0 @@ -setCryptoKeyVersion($cryptoKeyVersion) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var CryptoKeyVersion $response */ - $response = $keyManagementServiceClient->updateCryptoKeyVersion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyVersion_sync] diff --git a/owl-bot-staging/Kms/v1/src/V1/Client/EkmServiceClient.php b/owl-bot-staging/Kms/v1/src/V1/Client/EkmServiceClient.php deleted file mode 100644 index 8375c57c58af..000000000000 --- a/owl-bot-staging/Kms/v1/src/V1/Client/EkmServiceClient.php +++ /dev/null @@ -1,635 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/ekm_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/ekm_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/ekm_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/ekm_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a ekm_config - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted ekm_config resource. - */ - public static function ekmConfigName(string $project, string $location): string - { - return self::getPathTemplate('ekmConfig')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * ekm_connection resource. - * - * @param string $project - * @param string $location - * @param string $ekmConnection - * - * @return string The formatted ekm_connection resource. - */ - public static function ekmConnectionName(string $project, string $location, string $ekmConnection): string - { - return self::getPathTemplate('ekmConnection')->render([ - 'project' => $project, - 'location' => $location, - 'ekm_connection' => $ekmConnection, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName(string $project, string $location, string $namespace, string $service): string - { - return self::getPathTemplate('service')->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - ekmConfig: projects/{project}/locations/{location}/ekmConfig - * - ekmConnection: projects/{project}/locations/{location}/ekmConnections/{ekm_connection} - * - location: projects/{project}/locations/{location} - * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * 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 'cloudkms.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given - * Project and Location. - * - * The async variant is {@see EkmServiceClient::createEkmConnectionAsync()} . - * - * @example samples/V1/EkmServiceClient/create_ekm_connection.php - * - * @param CreateEkmConnectionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 EkmConnection - * - * @throws ApiException Thrown if the API call fails. - */ - public function createEkmConnection(CreateEkmConnectionRequest $request, array $callOptions = []): EkmConnection - { - return $this->startApiCall('CreateEkmConnection', $request, $callOptions)->wait(); - } - - /** - * Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource - * for a given project and location. - * - * The async variant is {@see EkmServiceClient::getEkmConfigAsync()} . - * - * @example samples/V1/EkmServiceClient/get_ekm_config.php - * - * @param GetEkmConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 EkmConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function getEkmConfig(GetEkmConfigRequest $request, array $callOptions = []): EkmConfig - { - return $this->startApiCall('GetEkmConfig', $request, $callOptions)->wait(); - } - - /** - * Returns metadata for a given - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * - * The async variant is {@see EkmServiceClient::getEkmConnectionAsync()} . - * - * @example samples/V1/EkmServiceClient/get_ekm_connection.php - * - * @param GetEkmConnectionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 EkmConnection - * - * @throws ApiException Thrown if the API call fails. - */ - public function getEkmConnection(GetEkmConnectionRequest $request, array $callOptions = []): EkmConnection - { - return $this->startApiCall('GetEkmConnection', $request, $callOptions)->wait(); - } - - /** - * Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. - * - * The async variant is {@see EkmServiceClient::listEkmConnectionsAsync()} . - * - * @example samples/V1/EkmServiceClient/list_ekm_connections.php - * - * @param ListEkmConnectionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listEkmConnections(ListEkmConnectionsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListEkmConnections', $request, $callOptions); - } - - /** - * Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource - * for a given project and location. - * - * The async variant is {@see EkmServiceClient::updateEkmConfigAsync()} . - * - * @example samples/V1/EkmServiceClient/update_ekm_config.php - * - * @param UpdateEkmConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 EkmConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateEkmConfig(UpdateEkmConfigRequest $request, array $callOptions = []): EkmConfig - { - return $this->startApiCall('UpdateEkmConfig', $request, $callOptions)->wait(); - } - - /** - * Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata. - * - * The async variant is {@see EkmServiceClient::updateEkmConnectionAsync()} . - * - * @example samples/V1/EkmServiceClient/update_ekm_connection.php - * - * @param UpdateEkmConnectionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 EkmConnection - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateEkmConnection(UpdateEkmConnectionRequest $request, array $callOptions = []): EkmConnection - { - return $this->startApiCall('UpdateEkmConnection', $request, $callOptions)->wait(); - } - - /** - * Verifies that Cloud KMS can successfully connect to the external key - * manager specified by an [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * If there is an error connecting to the EKM, this method returns a - * FAILED_PRECONDITION status containing structured information as described - * at https://cloud.google.com/kms/docs/reference/ekm_errors. - * - * The async variant is {@see EkmServiceClient::verifyConnectivityAsync()} . - * - * @example samples/V1/EkmServiceClient/verify_connectivity.php - * - * @param VerifyConnectivityRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 VerifyConnectivityResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function verifyConnectivity(VerifyConnectivityRequest $request, array $callOptions = []): VerifyConnectivityResponse - { - return $this->startApiCall('VerifyConnectivity', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see EkmServiceClient::getLocationAsync()} . - * - * @example samples/V1/EkmServiceClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see EkmServiceClient::listLocationsAsync()} . - * - * @example samples/V1/EkmServiceClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * The async variant is {@see EkmServiceClient::getIamPolicyAsync()} . - * - * @example samples/V1/EkmServiceClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * The async variant is {@see EkmServiceClient::setIamPolicyAsync()} . - * - * @example samples/V1/EkmServiceClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * The async variant is {@see EkmServiceClient::testIamPermissionsAsync()} . - * - * @example samples/V1/EkmServiceClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Kms/v1/src/V1/Client/KeyManagementServiceClient.php b/owl-bot-staging/Kms/v1/src/V1/Client/KeyManagementServiceClient.php deleted file mode 100644 index bd0830b6946c..000000000000 --- a/owl-bot-staging/Kms/v1/src/V1/Client/KeyManagementServiceClient.php +++ /dev/null @@ -1,1374 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/key_management_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/key_management_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/key_management_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/key_management_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a crypto_key - * resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * - * @return string The formatted crypto_key resource. - */ - public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string - { - return self::getPathTemplate('cryptoKey')->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * crypto_key_version resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * @param string $cryptoKeyVersion - * - * @return string The formatted crypto_key_version resource. - */ - public static function cryptoKeyVersionName(string $project, string $location, string $keyRing, string $cryptoKey, string $cryptoKeyVersion): string - { - return self::getPathTemplate('cryptoKeyVersion')->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - 'crypto_key_version' => $cryptoKeyVersion, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a import_job - * resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $importJob - * - * @return string The formatted import_job resource. - */ - public static function importJobName(string $project, string $location, string $keyRing, string $importJob): string - { - return self::getPathTemplate('importJob')->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'import_job' => $importJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a key_ring - * resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * - * @return string The formatted key_ring resource. - */ - public static function keyRingName(string $project, string $location, string $keyRing): string - { - return self::getPathTemplate('keyRing')->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} - * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} - * - importJob: projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job} - * - keyRing: projects/{project}/locations/{location}/keyRings/{key_ring} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * 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 'cloudkms.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Decrypts data that was encrypted with a public key retrieved from - * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - * ASYMMETRIC_DECRYPT. - * - * The async variant is {@see KeyManagementServiceClient::asymmetricDecryptAsync()} - * . - * - * @example samples/V1/KeyManagementServiceClient/asymmetric_decrypt.php - * - * @param AsymmetricDecryptRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 AsymmetricDecryptResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function asymmetricDecrypt(AsymmetricDecryptRequest $request, array $callOptions = []): AsymmetricDecryptResponse - { - return $this->startApiCall('AsymmetricDecrypt', $request, $callOptions)->wait(); - } - - /** - * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - * ASYMMETRIC_SIGN, producing a signature that can be verified with the public - * key retrieved from - * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. - * - * The async variant is {@see KeyManagementServiceClient::asymmetricSignAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/asymmetric_sign.php - * - * @param AsymmetricSignRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 AsymmetricSignResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function asymmetricSign(AsymmetricSignRequest $request, array $callOptions = []): AsymmetricSignResponse - { - return $this->startApiCall('AsymmetricSign', $request, $callOptions)->wait(); - } - - /** - * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a - * [KeyRing][google.cloud.kms.v1.KeyRing]. - * - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and - * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] - * are required. - * - * The async variant is {@see KeyManagementServiceClient::createCryptoKeyAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/create_crypto_key.php - * - * @param CreateCryptoKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CryptoKey - * - * @throws ApiException Thrown if the API call fails. - */ - public function createCryptoKey(CreateCryptoKeyRequest $request, array $callOptions = []): CryptoKey - { - return $this->startApiCall('CreateCryptoKey', $request, $callOptions)->wait(); - } - - /** - * Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a - * [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * The server will assign the next sequential id. If unset, - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to - * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. - * - * The async variant is - * {@see KeyManagementServiceClient::createCryptoKeyVersionAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/create_crypto_key_version.php - * - * @param CreateCryptoKeyVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CryptoKeyVersion - * - * @throws ApiException Thrown if the API call fails. - */ - public function createCryptoKeyVersion(CreateCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion - { - return $this->startApiCall('CreateCryptoKeyVersion', $request, $callOptions)->wait(); - } - - /** - * Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a - * [KeyRing][google.cloud.kms.v1.KeyRing]. - * - * [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is - * required. - * - * The async variant is {@see KeyManagementServiceClient::createImportJobAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/create_import_job.php - * - * @param CreateImportJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 ImportJob - * - * @throws ApiException Thrown if the API call fails. - */ - public function createImportJob(CreateImportJobRequest $request, array $callOptions = []): ImportJob - { - return $this->startApiCall('CreateImportJob', $request, $callOptions)->wait(); - } - - /** - * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and - * Location. - * - * The async variant is {@see KeyManagementServiceClient::createKeyRingAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/create_key_ring.php - * - * @param CreateKeyRingRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 KeyRing - * - * @throws ApiException Thrown if the API call fails. - */ - public function createKeyRing(CreateKeyRingRequest $request, array $callOptions = []): KeyRing - { - return $this->startApiCall('CreateKeyRing', $request, $callOptions)->wait(); - } - - /** - * Decrypts data that was protected by - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - * - * The async variant is {@see KeyManagementServiceClient::decryptAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/decrypt.php - * - * @param DecryptRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 DecryptResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function decrypt(DecryptRequest $request, array $callOptions = []): DecryptResponse - { - return $this->startApiCall('Decrypt', $request, $callOptions)->wait(); - } - - /** - * Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for - * destruction. - * - * Upon calling this method, - * [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will - * be set to - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], - * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will - * be set to the time - * [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] - * in the future. At that time, the - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically - * change to - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], - * and the key material will be irrevocably destroyed. - * - * Before the - * [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is - * reached, - * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] - * may be called to reverse the process. - * - * The async variant is - * {@see KeyManagementServiceClient::destroyCryptoKeyVersionAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/destroy_crypto_key_version.php - * - * @param DestroyCryptoKeyVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CryptoKeyVersion - * - * @throws ApiException Thrown if the API call fails. - */ - public function destroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion - { - return $this->startApiCall('DestroyCryptoKeyVersion', $request, $callOptions)->wait(); - } - - /** - * Encrypts data, so that it can only be recovered by a call to - * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - * - * The async variant is {@see KeyManagementServiceClient::encryptAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/encrypt.php - * - * @param EncryptRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 EncryptResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function encrypt(EncryptRequest $request, array $callOptions = []): EncryptResponse - { - return $this->startApiCall('Encrypt', $request, $callOptions)->wait(); - } - - /** - * Generate random bytes using the Cloud KMS randomness source in the provided - * location. - * - * The async variant is - * {@see KeyManagementServiceClient::generateRandomBytesAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/generate_random_bytes.php - * - * @param GenerateRandomBytesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 GenerateRandomBytesResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function generateRandomBytes(GenerateRandomBytesRequest $request, array $callOptions = []): GenerateRandomBytesResponse - { - return $this->startApiCall('GenerateRandomBytes', $request, $callOptions)->wait(); - } - - /** - * Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as - * well as its [primary][google.cloud.kms.v1.CryptoKey.primary] - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * The async variant is {@see KeyManagementServiceClient::getCryptoKeyAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/get_crypto_key.php - * - * @param GetCryptoKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CryptoKey - * - * @throws ApiException Thrown if the API call fails. - */ - public function getCryptoKey(GetCryptoKeyRequest $request, array $callOptions = []): CryptoKey - { - return $this->startApiCall('GetCryptoKey', $request, $callOptions)->wait(); - } - - /** - * Returns metadata for a given - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * The async variant is - * {@see KeyManagementServiceClient::getCryptoKeyVersionAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/get_crypto_key_version.php - * - * @param GetCryptoKeyVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CryptoKeyVersion - * - * @throws ApiException Thrown if the API call fails. - */ - public function getCryptoKeyVersion(GetCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion - { - return $this->startApiCall('GetCryptoKeyVersion', $request, $callOptions)->wait(); - } - - /** - * Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. - * - * The async variant is {@see KeyManagementServiceClient::getImportJobAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/get_import_job.php - * - * @param GetImportJobRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 ImportJob - * - * @throws ApiException Thrown if the API call fails. - */ - public function getImportJob(GetImportJobRequest $request, array $callOptions = []): ImportJob - { - return $this->startApiCall('GetImportJob', $request, $callOptions)->wait(); - } - - /** - * Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. - * - * The async variant is {@see KeyManagementServiceClient::getKeyRingAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/get_key_ring.php - * - * @param GetKeyRingRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 KeyRing - * - * @throws ApiException Thrown if the API call fails. - */ - public function getKeyRing(GetKeyRingRequest $request, array $callOptions = []): KeyRing - { - return $this->startApiCall('GetKeyRing', $request, $callOptions)->wait(); - } - - /** - * Returns the public key for the given - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] - * or - * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. - * - * The async variant is {@see KeyManagementServiceClient::getPublicKeyAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/get_public_key.php - * - * @param GetPublicKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PublicKey - * - * @throws ApiException Thrown if the API call fails. - */ - public function getPublicKey(GetPublicKeyRequest $request, array $callOptions = []): PublicKey - { - return $this->startApiCall('GetPublicKey', $request, $callOptions)->wait(); - } - - /** - * Import wrapped key material into a - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If - * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] is additionally - * specified in the request, key material will be reimported into that - * version. Otherwise, a new version will be created, and will be assigned the - * next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * The async variant is - * {@see KeyManagementServiceClient::importCryptoKeyVersionAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/import_crypto_key_version.php - * - * @param ImportCryptoKeyVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CryptoKeyVersion - * - * @throws ApiException Thrown if the API call fails. - */ - public function importCryptoKeyVersion(ImportCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion - { - return $this->startApiCall('ImportCryptoKeyVersion', $request, $callOptions)->wait(); - } - - /** - * Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - * - * The async variant is - * {@see KeyManagementServiceClient::listCryptoKeyVersionsAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/list_crypto_key_versions.php - * - * @param ListCryptoKeyVersionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listCryptoKeyVersions(ListCryptoKeyVersionsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListCryptoKeyVersions', $request, $callOptions); - } - - /** - * Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - * - * The async variant is {@see KeyManagementServiceClient::listCryptoKeysAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/list_crypto_keys.php - * - * @param ListCryptoKeysRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listCryptoKeys(ListCryptoKeysRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListCryptoKeys', $request, $callOptions); - } - - /** - * Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. - * - * The async variant is {@see KeyManagementServiceClient::listImportJobsAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/list_import_jobs.php - * - * @param ListImportJobsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listImportJobs(ListImportJobsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListImportJobs', $request, $callOptions); - } - - /** - * Lists [KeyRings][google.cloud.kms.v1.KeyRing]. - * - * The async variant is {@see KeyManagementServiceClient::listKeyRingsAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/list_key_rings.php - * - * @param ListKeyRingsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listKeyRings(ListKeyRingsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListKeyRings', $request, $callOptions); - } - - /** - * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, - * producing a tag that can be verified by another source with the same key. - * - * The async variant is {@see KeyManagementServiceClient::macSignAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/mac_sign.php - * - * @param MacSignRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 MacSignResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function macSign(MacSignRequest $request, array $callOptions = []): MacSignResponse - { - return $this->startApiCall('MacSign', $request, $callOptions)->wait(); - } - - /** - * Verifies MAC tag using a - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns - * a response that indicates whether or not the verification was successful. - * - * The async variant is {@see KeyManagementServiceClient::macVerifyAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/mac_verify.php - * - * @param MacVerifyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 MacVerifyResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function macVerify(MacVerifyRequest $request, array $callOptions = []): MacVerifyResponse - { - return $this->startApiCall('MacVerify', $request, $callOptions)->wait(); - } - - /** - * Decrypts data that was originally encrypted using a raw cryptographic - * mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - * must be - * [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. - * - * The async variant is {@see KeyManagementServiceClient::rawDecryptAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/raw_decrypt.php - * - * @param RawDecryptRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 RawDecryptResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function rawDecrypt(RawDecryptRequest $request, array $callOptions = []): RawDecryptResponse - { - return $this->startApiCall('RawDecrypt', $request, $callOptions)->wait(); - } - - /** - * Encrypts data using portable cryptographic primitives. Most users should - * choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and - * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than - * their raw counterparts. The - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - * [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. - * - * The async variant is {@see KeyManagementServiceClient::rawEncryptAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/raw_encrypt.php - * - * @param RawEncryptRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 RawEncryptResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function rawEncrypt(RawEncryptRequest $request, array $callOptions = []): RawEncryptResponse - { - return $this->startApiCall('RawEncrypt', $request, $callOptions)->wait(); - } - - /** - * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] - * state. - * - * Upon restoration of the CryptoKeyVersion, - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to - * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], - * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will - * be cleared. - * - * The async variant is - * {@see KeyManagementServiceClient::restoreCryptoKeyVersionAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/restore_crypto_key_version.php - * - * @param RestoreCryptoKeyVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CryptoKeyVersion - * - * @throws ApiException Thrown if the API call fails. - */ - public function restoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion - { - return $this->startApiCall('RestoreCryptoKeyVersion', $request, $callOptions)->wait(); - } - - /** - * Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * The async variant is {@see KeyManagementServiceClient::updateCryptoKeyAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/update_crypto_key.php - * - * @param UpdateCryptoKeyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CryptoKey - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateCryptoKey(UpdateCryptoKeyRequest $request, array $callOptions = []): CryptoKey - { - return $this->startApiCall('UpdateCryptoKey', $request, $callOptions)->wait(); - } - - /** - * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that - * will be used in - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. - * - * Returns an error if called on a key whose purpose is not - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - * - * The async variant is - * {@see KeyManagementServiceClient::updateCryptoKeyPrimaryVersionAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/update_crypto_key_primary_version.php - * - * @param UpdateCryptoKeyPrimaryVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CryptoKey - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest $request, array $callOptions = []): CryptoKey - { - return $this->startApiCall('UpdateCryptoKeyPrimaryVersion', $request, $callOptions)->wait(); - } - - /** - * Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s - * metadata. - * - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between - * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] - * and - * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] - * using this method. See - * [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] - * and - * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] - * to move between other states. - * - * The async variant is - * {@see KeyManagementServiceClient::updateCryptoKeyVersionAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/update_crypto_key_version.php - * - * @param UpdateCryptoKeyVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 CryptoKeyVersion - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateCryptoKeyVersion(UpdateCryptoKeyVersionRequest $request, array $callOptions = []): CryptoKeyVersion - { - return $this->startApiCall('UpdateCryptoKeyVersion', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see KeyManagementServiceClient::getLocationAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see KeyManagementServiceClient::listLocationsAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * The async variant is {@see KeyManagementServiceClient::getIamPolicyAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * The async variant is {@see KeyManagementServiceClient::setIamPolicyAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * The async variant is - * {@see KeyManagementServiceClient::testIamPermissionsAsync()} . - * - * @example samples/V1/KeyManagementServiceClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * 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 TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Kms/v1/src/V1/EkmServiceClient.php b/owl-bot-staging/Kms/v1/src/V1/EkmServiceClient.php deleted file mode 100644 index c5197b35e4f8..000000000000 --- a/owl-bot-staging/Kms/v1/src/V1/EkmServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $ekmConnectionId = 'ekm_connection_id'; - * $ekmConnection = new EkmConnection(); - * $response = $ekmServiceClient->createEkmConnection($formattedParent, $ekmConnectionId, $ekmConnection); - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Kms\V1\Client\EkmServiceClient}. - */ -class EkmServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.kms.v1.EkmService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'cloudkms.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudkms.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloudkms', - ]; - - private static $ekmConfigNameTemplate; - - private static $ekmConnectionNameTemplate; - - private static $locationNameTemplate; - - private static $serviceNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/ekm_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/ekm_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/ekm_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/ekm_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEkmConfigNameTemplate() - { - if (self::$ekmConfigNameTemplate == null) { - self::$ekmConfigNameTemplate = new PathTemplate('projects/{project}/locations/{location}/ekmConfig'); - } - - return self::$ekmConfigNameTemplate; - } - - private static function getEkmConnectionNameTemplate() - { - if (self::$ekmConnectionNameTemplate == null) { - self::$ekmConnectionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/ekmConnections/{ekm_connection}'); - } - - return self::$ekmConnectionNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'ekmConfig' => self::getEkmConfigNameTemplate(), - 'ekmConnection' => self::getEkmConnectionNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'service' => self::getServiceNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a ekm_config - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted ekm_config resource. - */ - public static function ekmConfigName($project, $location) - { - return self::getEkmConfigNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * ekm_connection resource. - * - * @param string $project - * @param string $location - * @param string $ekmConnection - * - * @return string The formatted ekm_connection resource. - */ - public static function ekmConnectionName($project, $location, $ekmConnection) - { - return self::getEkmConnectionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'ekm_connection' => $ekmConnection, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName($project, $location, $namespace, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - ekmConfig: projects/{project}/locations/{location}/ekmConfig - * - ekmConnection: projects/{project}/locations/{location}/ekmConnections/{ekm_connection} - * - location: projects/{project}/locations/{location} - * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * 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 'cloudkms.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given - * Project and Location. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * $formattedParent = $ekmServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $ekmConnectionId = 'ekm_connection_id'; - * $ekmConnection = new EkmConnection(); - * $response = $ekmServiceClient->createEkmConnection($formattedParent, $ekmConnectionId, $ekmConnection); - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the location associated with the - * [EkmConnection][google.cloud.kms.v1.EkmConnection], in the format - * `projects/*/locations/*`. - * @param string $ekmConnectionId Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}`. - * @param EkmConnection $ekmConnection Required. An [EkmConnection][google.cloud.kms.v1.EkmConnection] with - * initial field values. - * @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\Kms\V1\EkmConnection - * - * @throws ApiException if the remote call fails - */ - public function createEkmConnection($parent, $ekmConnectionId, $ekmConnection, array $optionalArgs = []) - { - $request = new CreateEkmConnectionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setEkmConnectionId($ekmConnectionId); - $request->setEkmConnection($ekmConnection); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateEkmConnection', EkmConnection::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource - * for a given project and location. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * $formattedName = $ekmServiceClient->ekmConfigName('[PROJECT]', '[LOCATION]'); - * $response = $ekmServiceClient->getEkmConfig($formattedName); - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the - * [EkmConfig][google.cloud.kms.v1.EkmConfig] to get. - * @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\Kms\V1\EkmConfig - * - * @throws ApiException if the remote call fails - */ - public function getEkmConfig($name, array $optionalArgs = []) - { - $request = new GetEkmConfigRequest(); - $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('GetEkmConfig', EkmConfig::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns metadata for a given - * [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * $formattedName = $ekmServiceClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - * $response = $ekmServiceClient->getEkmConnection($formattedName); - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to get. - * @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\Kms\V1\EkmConnection - * - * @throws ApiException if the remote call fails - */ - public function getEkmConnection($name, array $optionalArgs = []) - { - $request = new GetEkmConnectionRequest(); - $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('GetEkmConnection', EkmConnection::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * $formattedParent = $ekmServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $ekmServiceClient->listEkmConnections($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $ekmServiceClient->listEkmConnections($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the location associated with the - * [EkmConnections][google.cloud.kms.v1.EkmConnection] to list, in the format - * `projects/*/locations/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type string $orderBy - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEkmConnections($parent, array $optionalArgs = []) - { - $request = new ListEkmConnectionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListEkmConnections', $optionalArgs, ListEkmConnectionsResponse::class, $request); - } - - /** - * Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource - * for a given project and location. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * $ekmConfig = new EkmConfig(); - * $updateMask = new FieldMask(); - * $response = $ekmServiceClient->updateEkmConfig($ekmConfig, $updateMask); - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param EkmConfig $ekmConfig Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values. - * @param FieldMask $updateMask Required. List of fields to be updated in this request. - * @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\Kms\V1\EkmConfig - * - * @throws ApiException if the remote call fails - */ - public function updateEkmConfig($ekmConfig, $updateMask, array $optionalArgs = []) - { - $request = new UpdateEkmConfigRequest(); - $requestParamHeaders = []; - $request->setEkmConfig($ekmConfig); - $request->setUpdateMask($updateMask); - $requestParamHeaders['ekm_config.name'] = $ekmConfig->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateEkmConfig', EkmConfig::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * $ekmConnection = new EkmConnection(); - * $updateMask = new FieldMask(); - * $response = $ekmServiceClient->updateEkmConnection($ekmConnection, $updateMask); - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param EkmConnection $ekmConnection Required. [EkmConnection][google.cloud.kms.v1.EkmConnection] with updated - * values. - * @param FieldMask $updateMask Required. List of fields to be updated in this request. - * @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\Kms\V1\EkmConnection - * - * @throws ApiException if the remote call fails - */ - public function updateEkmConnection($ekmConnection, $updateMask, array $optionalArgs = []) - { - $request = new UpdateEkmConnectionRequest(); - $requestParamHeaders = []; - $request->setEkmConnection($ekmConnection); - $request->setUpdateMask($updateMask); - $requestParamHeaders['ekm_connection.name'] = $ekmConnection->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateEkmConnection', EkmConnection::class, $optionalArgs, $request)->wait(); - } - - /** - * Verifies that Cloud KMS can successfully connect to the external key - * manager specified by an [EkmConnection][google.cloud.kms.v1.EkmConnection]. - * If there is an error connecting to the EKM, this method returns a - * FAILED_PRECONDITION status containing structured information as described - * at https://cloud.google.com/kms/docs/reference/ekm_errors. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * $formattedName = $ekmServiceClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - * $response = $ekmServiceClient->verifyConnectivity($formattedName); - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the - * [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify. - * @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\Kms\V1\VerifyConnectivityResponse - * - * @throws ApiException if the remote call fails - */ - public function verifyConnectivity($name, array $optionalArgs = []) - { - $request = new VerifyConnectivityRequest(); - $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('VerifyConnectivity', VerifyConnectivityResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * $response = $ekmServiceClient->getLocation(); - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $ekmServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $ekmServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * $resource = 'resource'; - * $response = $ekmServiceClient->getIamPolicy($resource); - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $ekmServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $ekmServiceClient = new EkmServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $ekmServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $ekmServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } -} diff --git a/owl-bot-staging/Kms/v1/src/V1/Gapic/KeyManagementServiceGapicClient.php b/owl-bot-staging/Kms/v1/src/V1/Gapic/KeyManagementServiceGapicClient.php deleted file mode 100644 index 5e00193b416b..000000000000 --- a/owl-bot-staging/Kms/v1/src/V1/Gapic/KeyManagementServiceGapicClient.php +++ /dev/null @@ -1,2841 +0,0 @@ -cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * $ciphertext = '...'; - * $response = $keyManagementServiceClient->asymmetricDecrypt($formattedName, $ciphertext); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Kms\V1\Client\KeyManagementServiceClient}. - */ -class KeyManagementServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.kms.v1.KeyManagementService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'cloudkms.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudkms.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloudkms', - ]; - - private static $cryptoKeyNameTemplate; - - private static $cryptoKeyVersionNameTemplate; - - private static $importJobNameTemplate; - - private static $keyRingNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/key_management_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/key_management_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/key_management_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/key_management_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getCryptoKeyNameTemplate() - { - if (self::$cryptoKeyNameTemplate == null) { - self::$cryptoKeyNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}'); - } - - return self::$cryptoKeyNameTemplate; - } - - private static function getCryptoKeyVersionNameTemplate() - { - if (self::$cryptoKeyVersionNameTemplate == null) { - self::$cryptoKeyVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}'); - } - - return self::$cryptoKeyVersionNameTemplate; - } - - private static function getImportJobNameTemplate() - { - if (self::$importJobNameTemplate == null) { - self::$importJobNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}'); - } - - return self::$importJobNameTemplate; - } - - private static function getKeyRingNameTemplate() - { - if (self::$keyRingNameTemplate == null) { - self::$keyRingNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}'); - } - - return self::$keyRingNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'cryptoKey' => self::getCryptoKeyNameTemplate(), - 'cryptoKeyVersion' => self::getCryptoKeyVersionNameTemplate(), - 'importJob' => self::getImportJobNameTemplate(), - 'keyRing' => self::getKeyRingNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a crypto_key - * resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * - * @return string The formatted crypto_key resource. - */ - public static function cryptoKeyName($project, $location, $keyRing, $cryptoKey) - { - return self::getCryptoKeyNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * crypto_key_version resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * @param string $cryptoKeyVersion - * - * @return string The formatted crypto_key_version resource. - */ - public static function cryptoKeyVersionName($project, $location, $keyRing, $cryptoKey, $cryptoKeyVersion) - { - return self::getCryptoKeyVersionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'crypto_key' => $cryptoKey, - 'crypto_key_version' => $cryptoKeyVersion, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a import_job - * resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $importJob - * - * @return string The formatted import_job resource. - */ - public static function importJobName($project, $location, $keyRing, $importJob) - { - return self::getImportJobNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - 'import_job' => $importJob, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a key_ring - * resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * - * @return string The formatted key_ring resource. - */ - public static function keyRingName($project, $location, $keyRing) - { - return self::getKeyRingNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'key_ring' => $keyRing, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} - * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} - * - importJob: projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job} - * - keyRing: projects/{project}/locations/{location}/keyRings/{key_ring} - * - location: projects/{project}/locations/{location} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * 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 'cloudkms.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Decrypts data that was encrypted with a public key retrieved from - * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - * corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - * ASYMMETRIC_DECRYPT. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * $ciphertext = '...'; - * $response = $keyManagementServiceClient->asymmetricDecrypt($formattedName, $ciphertext); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * decryption. - * @param string $ciphertext Required. The data encrypted with the named - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using - * OAEP. - * @param array $optionalArgs { - * Optional. - * - * @type Int64Value $ciphertextCrc32c - * Optional. An optional CRC32C checksum of the - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]) - * is equal to - * [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Kms\V1\AsymmetricDecryptResponse - * - * @throws ApiException if the remote call fails - */ - public function asymmetricDecrypt($name, $ciphertext, array $optionalArgs = []) - { - $request = new AsymmetricDecryptRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setCiphertext($ciphertext); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['ciphertextCrc32c'])) { - $request->setCiphertextCrc32c($optionalArgs['ciphertextCrc32c']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('AsymmetricDecrypt', AsymmetricDecryptResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - * ASYMMETRIC_SIGN, producing a signature that can be verified with the public - * key retrieved from - * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * $digest = new Digest(); - * $response = $keyManagementServiceClient->asymmetricSign($formattedName, $digest); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. - * @param Digest $digest Optional. The digest of the data to sign. The digest must be produced with - * the same digest algorithm as specified by the key version's - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. - * - * This field may not be supplied if - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * is supplied. - * @param array $optionalArgs { - * Optional. - * - * @type Int64Value $digestCrc32c - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]) - * is equal to - * [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type string $data - * Optional. The data to sign. - * It can't be supplied if - * [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest] - * is supplied. - * @type Int64Value $dataCrc32c - * Optional. An optional CRC32C checksum of the - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]) - * is equal to - * [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Kms\V1\AsymmetricSignResponse - * - * @throws ApiException if the remote call fails - */ - public function asymmetricSign($name, $digest, array $optionalArgs = []) - { - $request = new AsymmetricSignRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setDigest($digest); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['digestCrc32c'])) { - $request->setDigestCrc32c($optionalArgs['digestCrc32c']); - } - - if (isset($optionalArgs['data'])) { - $request->setData($optionalArgs['data']); - } - - if (isset($optionalArgs['dataCrc32c'])) { - $request->setDataCrc32c($optionalArgs['dataCrc32c']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('AsymmetricSign', AsymmetricSignResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a - * [KeyRing][google.cloud.kms.v1.KeyRing]. - * - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and - * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] - * are required. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedParent = $keyManagementServiceClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * $cryptoKeyId = 'crypto_key_id'; - * $cryptoKey = new CryptoKey(); - * $response = $keyManagementServiceClient->createCryptoKey($formattedParent, $cryptoKeyId, $cryptoKey); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing - * associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - * @param string $cryptoKeyId Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param CryptoKey $cryptoKey Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field - * values. - * @param array $optionalArgs { - * Optional. - * - * @type bool $skipInitialVersionCreation - * If set to true, the request will create a - * [CryptoKey][google.cloud.kms.v1.CryptoKey] without any - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must - * manually call - * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] - * or - * [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion] - * before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * @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\Kms\V1\CryptoKey - * - * @throws ApiException if the remote call fails - */ - public function createCryptoKey($parent, $cryptoKeyId, $cryptoKey, array $optionalArgs = []) - { - $request = new CreateCryptoKeyRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setCryptoKeyId($cryptoKeyId); - $request->setCryptoKey($cryptoKey); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['skipInitialVersionCreation'])) { - $request->setSkipInitialVersionCreation($optionalArgs['skipInitialVersionCreation']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateCryptoKey', CryptoKey::class, $optionalArgs, $request)->wait(); - } - - /** - * Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a - * [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * The server will assign the next sequential id. If unset, - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to - * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedParent = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * $cryptoKeyVersion = new CryptoKeyVersion(); - * $response = $keyManagementServiceClient->createCryptoKeyVersion($formattedParent, $cryptoKeyVersion); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the - * [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - * @param CryptoKeyVersion $cryptoKeyVersion Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * initial field values. - * @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\Kms\V1\CryptoKeyVersion - * - * @throws ApiException if the remote call fails - */ - public function createCryptoKeyVersion($parent, $cryptoKeyVersion, array $optionalArgs = []) - { - $request = new CreateCryptoKeyVersionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setCryptoKeyVersion($cryptoKeyVersion); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); - } - - /** - * Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a - * [KeyRing][google.cloud.kms.v1.KeyRing]. - * - * [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is - * required. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedParent = $keyManagementServiceClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * $importJobId = 'import_job_id'; - * $importJob = new ImportJob(); - * $response = $keyManagementServiceClient->createImportJob($formattedParent, $importJobId, $importJob); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The [name][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] associated with the - * [ImportJobs][google.cloud.kms.v1.ImportJob]. - * @param string $importJobId Required. It must be unique within a KeyRing and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param ImportJob $importJob Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field - * values. - * @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\Kms\V1\ImportJob - * - * @throws ApiException if the remote call fails - */ - public function createImportJob($parent, $importJobId, $importJob, array $optionalArgs = []) - { - $request = new CreateImportJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setImportJobId($importJobId); - $request->setImportJob($importJob); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateImportJob', ImportJob::class, $optionalArgs, $request)->wait(); - } - - /** - * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and - * Location. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedParent = $keyManagementServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $keyRingId = 'key_ring_id'; - * $keyRing = new KeyRing(); - * $response = $keyManagementServiceClient->createKeyRing($formattedParent, $keyRingId, $keyRing); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. - * @param string $keyRingId Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param KeyRing $keyRing Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field - * values. - * @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\Kms\V1\KeyRing - * - * @throws ApiException if the remote call fails - */ - public function createKeyRing($parent, $keyRingId, $keyRing, array $optionalArgs = []) - { - $request = new CreateKeyRingRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setKeyRingId($keyRingId); - $request->setKeyRing($keyRing); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateKeyRing', KeyRing::class, $optionalArgs, $request)->wait(); - } - - /** - * Decrypts data that was protected by - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * $ciphertext = '...'; - * $response = $keyManagementServiceClient->decrypt($formattedName, $ciphertext); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The - * server will choose the appropriate version. - * @param string $ciphertext Required. The encrypted data originally returned in - * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. - * @param array $optionalArgs { - * Optional. - * - * @type string $additionalAuthenticatedData - * Optional. Optional data that must match the data originally supplied in - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * @type Int64Value $ciphertextCrc32c - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]) - * is equal to - * [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type Int64Value $additionalAuthenticatedDataCrc32c - * Optional. An optional CRC32C checksum of the - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]) - * is equal to - * [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Kms\V1\DecryptResponse - * - * @throws ApiException if the remote call fails - */ - public function decrypt($name, $ciphertext, array $optionalArgs = []) - { - $request = new DecryptRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setCiphertext($ciphertext); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['additionalAuthenticatedData'])) { - $request->setAdditionalAuthenticatedData($optionalArgs['additionalAuthenticatedData']); - } - - if (isset($optionalArgs['ciphertextCrc32c'])) { - $request->setCiphertextCrc32c($optionalArgs['ciphertextCrc32c']); - } - - if (isset($optionalArgs['additionalAuthenticatedDataCrc32c'])) { - $request->setAdditionalAuthenticatedDataCrc32c($optionalArgs['additionalAuthenticatedDataCrc32c']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('Decrypt', DecryptResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for - * destruction. - * - * Upon calling this method, - * [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will - * be set to - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], - * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will - * be set to the time - * [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] - * in the future. At that time, the - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically - * change to - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], - * and the key material will be irrevocably destroyed. - * - * Before the - * [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is - * reached, - * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] - * may be called to reverse the process. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * $response = $keyManagementServiceClient->destroyCryptoKeyVersion($formattedName); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. - * @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\Kms\V1\CryptoKeyVersion - * - * @throws ApiException if the remote call fails - */ - public function destroyCryptoKeyVersion($name, array $optionalArgs = []) - { - $request = new DestroyCryptoKeyVersionRequest(); - $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('DestroyCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); - } - - /** - * Encrypts data, so that it can only be recovered by a call to - * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $name = 'name'; - * $plaintext = '...'; - * $response = $keyManagementServiceClient->encrypt($name, $plaintext); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] or - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * encryption. - * - * If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server - * will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. - * @param string $plaintext Required. The data to encrypt. Must be no larger than 64KiB. - * - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and - * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * @param array $optionalArgs { - * Optional. - * - * @type string $additionalAuthenticatedData - * Optional. Optional data that, if specified, must also be provided during - * decryption through - * [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. - * - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], - * [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and - * [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the - * AAD must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * @type Int64Value $plaintextCrc32c - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]) - * is equal to - * [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type Int64Value $additionalAuthenticatedDataCrc32c - * Optional. An optional CRC32C checksum of the - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received - * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data] - * using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]) - * is equal to - * [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Kms\V1\EncryptResponse - * - * @throws ApiException if the remote call fails - */ - public function encrypt($name, $plaintext, array $optionalArgs = []) - { - $request = new EncryptRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setPlaintext($plaintext); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['additionalAuthenticatedData'])) { - $request->setAdditionalAuthenticatedData($optionalArgs['additionalAuthenticatedData']); - } - - if (isset($optionalArgs['plaintextCrc32c'])) { - $request->setPlaintextCrc32c($optionalArgs['plaintextCrc32c']); - } - - if (isset($optionalArgs['additionalAuthenticatedDataCrc32c'])) { - $request->setAdditionalAuthenticatedDataCrc32c($optionalArgs['additionalAuthenticatedDataCrc32c']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('Encrypt', EncryptResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Generate random bytes using the Cloud KMS randomness source in the provided - * location. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $response = $keyManagementServiceClient->generateRandomBytes(); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $location - * The project-specific location in which to generate random bytes. - * For example, "projects/my-project/locations/us-central1". - * @type int $lengthBytes - * The length in bytes of the amount of randomness to retrieve. Minimum 8 - * bytes, maximum 1024 bytes. - * @type int $protectionLevel - * The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when - * generating the random data. Currently, only - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is - * supported. - * For allowed values, use constants defined on {@see \Google\Cloud\Kms\V1\ProtectionLevel} - * @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\Kms\V1\GenerateRandomBytesResponse - * - * @throws ApiException if the remote call fails - */ - public function generateRandomBytes(array $optionalArgs = []) - { - $request = new GenerateRandomBytesRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - if (isset($optionalArgs['lengthBytes'])) { - $request->setLengthBytes($optionalArgs['lengthBytes']); - } - - if (isset($optionalArgs['protectionLevel'])) { - $request->setProtectionLevel($optionalArgs['protectionLevel']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GenerateRandomBytes', GenerateRandomBytesResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as - * well as its [primary][google.cloud.kms.v1.CryptoKey.primary] - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * $response = $keyManagementServiceClient->getCryptoKey($formattedName); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. - * @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\Kms\V1\CryptoKey - * - * @throws ApiException if the remote call fails - */ - public function getCryptoKey($name, array $optionalArgs = []) - { - $request = new GetCryptoKeyRequest(); - $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('GetCryptoKey', CryptoKey::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns metadata for a given - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * $response = $keyManagementServiceClient->getCryptoKeyVersion($formattedName); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. - * @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\Kms\V1\CryptoKeyVersion - * - * @throws ApiException if the remote call fails - */ - public function getCryptoKeyVersion($name, array $optionalArgs = []) - { - $request = new GetCryptoKeyVersionRequest(); - $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('GetCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->importJobName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[IMPORT_JOB]'); - * $response = $keyManagementServiceClient->getImportJob($formattedName); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [name][google.cloud.kms.v1.ImportJob.name] of the - * [ImportJob][google.cloud.kms.v1.ImportJob] to get. - * @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\Kms\V1\ImportJob - * - * @throws ApiException if the remote call fails - */ - public function getImportJob($name, array $optionalArgs = []) - { - $request = new GetImportJobRequest(); - $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('GetImportJob', ImportJob::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * $response = $keyManagementServiceClient->getKeyRing($formattedName); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [name][google.cloud.kms.v1.KeyRing.name] of the - * [KeyRing][google.cloud.kms.v1.KeyRing] to get. - * @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\Kms\V1\KeyRing - * - * @throws ApiException if the remote call fails - */ - public function getKeyRing($name, array $optionalArgs = []) - { - $request = new GetKeyRingRequest(); - $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('GetKeyRing', KeyRing::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the public key for the given - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] - * or - * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * $response = $keyManagementServiceClient->getPublicKey($formattedName); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. - * @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\Kms\V1\PublicKey - * - * @throws ApiException if the remote call fails - */ - public function getPublicKey($name, array $optionalArgs = []) - { - $request = new GetPublicKeyRequest(); - $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('GetPublicKey', PublicKey::class, $optionalArgs, $request)->wait(); - } - - /** - * Import wrapped key material into a - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * - * All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If - * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] is additionally - * specified in the request, key material will be reimported into that - * version. Otherwise, a new version will be created, and will be assigned the - * next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedParent = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; - * $importJob = 'import_job'; - * $response = $keyManagementServiceClient->importCryptoKeyVersion($formattedParent, $algorithm, $importJob); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to be imported into. - * - * The create permission is only required on this key when creating a new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - * @param int $algorithm Required. The - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - * of the key being imported. This does not need to match the - * [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] this version imports into. - * For allowed values, use constants defined on {@see \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionAlgorithm} - * @param string $importJob Required. The [name][google.cloud.kms.v1.ImportJob.name] of the - * [ImportJob][google.cloud.kms.v1.ImportJob] that was used to wrap this key - * material. - * @param array $optionalArgs { - * Optional. - * - * @type string $cryptoKeyVersion - * Optional. The optional [name][google.cloud.kms.v1.CryptoKeyVersion.name] of - * an existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to - * target for an import operation. If this field is not present, a new - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] containing the - * supplied key material is created. - * - * If this field is present, the supplied key material is imported into - * the existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. To - * import into an existing - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must be a child of - * [ImportCryptoKeyVersionRequest.parent][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.parent], - * have been previously created via [ImportCryptoKeyVersion][], and be in - * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED] - * or - * [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED] - * state. The key material and algorithm must match the previous - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] exactly if the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] has ever contained - * key material. - * @type string $wrappedKey - * Optional. The wrapped key material to import. - * - * Before wrapping, key material must be formatted. If importing symmetric key - * material, the expected key material format is plain bytes. If importing - * asymmetric key material, the expected key material format is PKCS#8-encoded - * DER (the PrivateKeyInfo structure from RFC 5208). - * - * When wrapping with import methods - * ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256] - * or - * [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256] - * or - * [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256] - * or - * [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]), - * - * this field must contain the concatenation of: - *
    - *
  1. An ephemeral AES-256 wrapping key wrapped with the - * [public_key][google.cloud.kms.v1.ImportJob.public_key] using - * RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty - * label. - *
  2. - *
  3. The formatted key to be imported, wrapped with the ephemeral AES-256 - * key using AES-KWP (RFC 5649). - *
  4. - *
- * - * This format is the same as the format produced by PKCS#11 mechanism - * CKM_RSA_AES_KEY_WRAP. - * - * When wrapping with import methods - * ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256] - * or - * [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]), - * - * this field must contain the formatted key to be imported, wrapped with the - * [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP - * with SHA-256, MGF1 with SHA-256, and an empty label. - * @type string $rsaAesWrappedKey - * Optional. This field has the same meaning as - * [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key]. - * Prefer to use that field in new work. Either that field or this field - * (but not both) must be specified. - * @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\Kms\V1\CryptoKeyVersion - * - * @throws ApiException if the remote call fails - */ - public function importCryptoKeyVersion($parent, $algorithm, $importJob, array $optionalArgs = []) - { - $request = new ImportCryptoKeyVersionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setAlgorithm($algorithm); - $request->setImportJob($importJob); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['cryptoKeyVersion'])) { - $request->setCryptoKeyVersion($optionalArgs['cryptoKeyVersion']); - } - - if (isset($optionalArgs['wrappedKey'])) { - $request->setWrappedKey($optionalArgs['wrappedKey']); - } - - if (isset($optionalArgs['rsaAesWrappedKey'])) { - $request->setRsaAesWrappedKey($optionalArgs['rsaAesWrappedKey']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ImportCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedParent = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * // Iterate over pages of elements - * $pagedResponse = $keyManagementServiceClient->listCryptoKeyVersions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $keyManagementServiceClient->listCryptoKeyVersions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format - * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - * @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 int $view - * The fields to include in the response. - * For allowed values, use constants defined on {@see \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionView} - * @type string $filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type string $orderBy - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listCryptoKeyVersions($parent, array $optionalArgs = []) - { - $request = new ListCryptoKeyVersionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListCryptoKeyVersions', $optionalArgs, ListCryptoKeyVersionsResponse::class, $request); - } - - /** - * Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedParent = $keyManagementServiceClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * // Iterate over pages of elements - * $pagedResponse = $keyManagementServiceClient->listCryptoKeys($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $keyManagementServiceClient->listCryptoKeys($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. - * @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 int $versionView - * The fields of the primary version to include in the response. - * For allowed values, use constants defined on {@see \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionView} - * @type string $filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type string $orderBy - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listCryptoKeys($parent, array $optionalArgs = []) - { - $request = new ListCryptoKeysRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['versionView'])) { - $request->setVersionView($optionalArgs['versionView']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListCryptoKeys', $optionalArgs, ListCryptoKeysResponse::class, $request); - } - - /** - * Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedParent = $keyManagementServiceClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - * // Iterate over pages of elements - * $pagedResponse = $keyManagementServiceClient->listImportJobs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $keyManagementServiceClient->listImportJobs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing] - * to list, in the format `projects/*/locations/*/keyRings/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type string $orderBy - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listImportJobs($parent, array $optionalArgs = []) - { - $request = new ListImportJobsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListImportJobs', $optionalArgs, ListImportJobsResponse::class, $request); - } - - /** - * Lists [KeyRings][google.cloud.kms.v1.KeyRing]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedParent = $keyManagementServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $keyManagementServiceClient->listKeyRings($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $keyManagementServiceClient->listKeyRings($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the location associated with the - * [KeyRings][google.cloud.kms.v1.KeyRing], in the format - * `projects/*/locations/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Only include resources that match the filter in the response. For - * more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type string $orderBy - * Optional. Specify how the results should be sorted. If not specified, the - * results will be sorted in the default order. For more information, see - * [Sorting and filtering list - * results](https://cloud.google.com/kms/docs/sorting-and-filtering). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listKeyRings($parent, array $optionalArgs = []) - { - $request = new ListKeyRingsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListKeyRings', $optionalArgs, ListKeyRingsResponse::class, $request); - } - - /** - * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - * with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, - * producing a tag that can be verified by another source with the same key. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * $data = '...'; - * $response = $keyManagementServiceClient->macSign($formattedName, $data); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * signing. - * @param string $data Required. The data to sign. The MAC tag is computed over this data field - * based on the specific algorithm. - * @param array $optionalArgs { - * Optional. - * - * @type Int64Value $dataCrc32c - * Optional. An optional CRC32C checksum of the - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is - * equal to - * [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Kms\V1\MacSignResponse - * - * @throws ApiException if the remote call fails - */ - public function macSign($name, $data, array $optionalArgs = []) - { - $request = new MacSignRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setData($data); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['dataCrc32c'])) { - $request->setDataCrc32c($optionalArgs['dataCrc32c']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('MacSign', MacSignResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Verifies MAC tag using a - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns - * a response that indicates whether or not the verification was successful. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * $data = '...'; - * $mac = '...'; - * $response = $keyManagementServiceClient->macVerify($formattedName, $data, $mac); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * verification. - * @param string $data Required. The data used previously as a - * [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate - * the MAC tag. - * @param string $mac Required. The signature to verify. - * @param array $optionalArgs { - * Optional. - * - * @type Int64Value $dataCrc32c - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]) - * is equal to - * [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type Int64Value $macCrc32c - * Optional. An optional CRC32C checksum of the - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If - * specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will verify the integrity of the received - * [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C([MacVerifyRequest.tag][]) is equal to - * [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c], - * and if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. Note: This - * field is defined as int64 for reasons of compatibility across different - * languages. However, it is a non-negative integer, which will never exceed - * 2^32-1, and can be safely downconverted to uint32 in languages that support - * this type. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Kms\V1\MacVerifyResponse - * - * @throws ApiException if the remote call fails - */ - public function macVerify($name, $data, $mac, array $optionalArgs = []) - { - $request = new MacVerifyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setData($data); - $request->setMac($mac); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['dataCrc32c'])) { - $request->setDataCrc32c($optionalArgs['dataCrc32c']); - } - - if (isset($optionalArgs['macCrc32c'])) { - $request->setMacCrc32c($optionalArgs['macCrc32c']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('MacVerify', MacVerifyResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Decrypts data that was originally encrypted using a raw cryptographic - * mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - * must be - * [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $name = 'name'; - * $ciphertext = '...'; - * $initializationVector = '...'; - * $response = $keyManagementServiceClient->rawDecrypt($name, $ciphertext, $initializationVector); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * decryption. - * @param string $ciphertext Required. The encrypted data originally returned in - * [RawEncryptResponse.ciphertext][google.cloud.kms.v1.RawEncryptResponse.ciphertext]. - * @param string $initializationVector Required. The initialization vector (IV) used during encryption, which must - * match the data originally provided in - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * @param array $optionalArgs { - * Optional. - * - * @type string $additionalAuthenticatedData - * Optional. Optional data that must match the data originally supplied in - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * @type int $tagLength - * The length of the authentication tag that is appended to the end of - * the ciphertext. If unspecified (0), the default value for the key's - * algorithm will be used (for AES-GCM, the default value is 16). - * @type Int64Value $ciphertextCrc32c - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.ciphertext][google.cloud.kms.v1.RawDecryptRequest.ciphertext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received ciphertext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(ciphertext) is equal - * to ciphertext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * @type Int64Value $additionalAuthenticatedDataCrc32c - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * @type Int64Value $initializationVectorCrc32c - * Optional. An optional CRC32C checksum of the - * [RawDecryptRequest.initialization_vector][google.cloud.kms.v1.RawDecryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and - * if so, perform a limited number of retries. A persistent mismatch may - * indicate an issue in your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Kms\V1\RawDecryptResponse - * - * @throws ApiException if the remote call fails - */ - public function rawDecrypt($name, $ciphertext, $initializationVector, array $optionalArgs = []) - { - $request = new RawDecryptRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setCiphertext($ciphertext); - $request->setInitializationVector($initializationVector); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['additionalAuthenticatedData'])) { - $request->setAdditionalAuthenticatedData($optionalArgs['additionalAuthenticatedData']); - } - - if (isset($optionalArgs['tagLength'])) { - $request->setTagLength($optionalArgs['tagLength']); - } - - if (isset($optionalArgs['ciphertextCrc32c'])) { - $request->setCiphertextCrc32c($optionalArgs['ciphertextCrc32c']); - } - - if (isset($optionalArgs['additionalAuthenticatedDataCrc32c'])) { - $request->setAdditionalAuthenticatedDataCrc32c($optionalArgs['additionalAuthenticatedDataCrc32c']); - } - - if (isset($optionalArgs['initializationVectorCrc32c'])) { - $request->setInitializationVectorCrc32c($optionalArgs['initializationVectorCrc32c']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RawDecrypt', RawDecryptResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Encrypts data using portable cryptographic primitives. Most users should - * choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and - * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than - * their raw counterparts. The - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - * [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $name = 'name'; - * $plaintext = '...'; - * $response = $keyManagementServiceClient->rawEncrypt($name, $plaintext); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for - * encryption. - * @param string $plaintext Required. The data to encrypt. Must be no larger than 64KiB. - * - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * @param array $optionalArgs { - * Optional. - * - * @type string $additionalAuthenticatedData - * Optional. Optional data that, if specified, must also be provided during - * decryption through - * [RawDecryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data]. - * - * This field may only be used in conjunction with an - * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm] that accepts - * additional authenticated data (for example, AES-GCM). - * - * The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. - * For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the - * plaintext must be no larger than 64KiB. For - * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of - * the plaintext and additional_authenticated_data fields must be no larger - * than 8KiB. - * @type Int64Value $plaintextCrc32c - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.plaintext][google.cloud.kms.v1.RawEncryptRequest.plaintext]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received plaintext using this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that CRC32C(plaintext) is equal - * to plaintext_crc32c, and if so, perform a limited number of retries. A - * persistent mismatch may indicate an issue in your computation of the CRC32C - * checksum. Note: This field is defined as int64 for reasons of compatibility - * across different languages. However, it is a non-negative integer, which - * will never exceed 2^32-1, and can be safely downconverted to uint32 in - * languages that support this type. - * @type Int64Value $additionalAuthenticatedDataCrc32c - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.additional_authenticated_data][google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received additional_authenticated_data using - * this checksum. - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(additional_authenticated_data) is equal to - * additional_authenticated_data_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * @type string $initializationVector - * Optional. A customer-supplied initialization vector that will be used for - * encryption. If it is not provided for AES-CBC and AES-CTR, one will be - * generated. It will be returned in - * [RawEncryptResponse.initialization_vector][google.cloud.kms.v1.RawEncryptResponse.initialization_vector]. - * @type Int64Value $initializationVectorCrc32c - * Optional. An optional CRC32C checksum of the - * [RawEncryptRequest.initialization_vector][google.cloud.kms.v1.RawEncryptRequest.initialization_vector]. - * If specified, - * [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will - * verify the integrity of the received initialization_vector using this - * checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService] - * will report an error if the checksum verification fails. If you receive a - * checksum error, your client should verify that - * CRC32C(initialization_vector) is equal to - * initialization_vector_crc32c, and if so, perform - * a limited number of retries. A persistent mismatch may indicate an issue in - * your computation of the CRC32C checksum. - * Note: This field is defined as int64 for reasons of compatibility across - * different languages. However, it is a non-negative integer, which will - * never exceed 2^32-1, and can be safely downconverted to uint32 in languages - * that support this type. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Kms\V1\RawEncryptResponse - * - * @throws ApiException if the remote call fails - */ - public function rawEncrypt($name, $plaintext, array $optionalArgs = []) - { - $request = new RawEncryptRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setPlaintext($plaintext); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['additionalAuthenticatedData'])) { - $request->setAdditionalAuthenticatedData($optionalArgs['additionalAuthenticatedData']); - } - - if (isset($optionalArgs['plaintextCrc32c'])) { - $request->setPlaintextCrc32c($optionalArgs['plaintextCrc32c']); - } - - if (isset($optionalArgs['additionalAuthenticatedDataCrc32c'])) { - $request->setAdditionalAuthenticatedDataCrc32c($optionalArgs['additionalAuthenticatedDataCrc32c']); - } - - if (isset($optionalArgs['initializationVector'])) { - $request->setInitializationVector($optionalArgs['initializationVector']); - } - - if (isset($optionalArgs['initializationVectorCrc32c'])) { - $request->setInitializationVectorCrc32c($optionalArgs['initializationVectorCrc32c']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RawEncrypt', RawEncryptResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] - * state. - * - * Upon restoration of the CryptoKeyVersion, - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to - * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], - * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will - * be cleared. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - * $response = $keyManagementServiceClient->restoreCryptoKeyVersion($formattedName); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. - * @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\Kms\V1\CryptoKeyVersion - * - * @throws ApiException if the remote call fails - */ - public function restoreCryptoKeyVersion($name, array $optionalArgs = []) - { - $request = new RestoreCryptoKeyVersionRequest(); - $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('RestoreCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); - } - - /** - * Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $cryptoKey = new CryptoKey(); - * $updateMask = new FieldMask(); - * $response = $keyManagementServiceClient->updateCryptoKey($cryptoKey, $updateMask); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param CryptoKey $cryptoKey Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. - * @param FieldMask $updateMask Required. List of fields to be updated in this request. - * @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\Kms\V1\CryptoKey - * - * @throws ApiException if the remote call fails - */ - public function updateCryptoKey($cryptoKey, $updateMask, array $optionalArgs = []) - { - $request = new UpdateCryptoKeyRequest(); - $requestParamHeaders = []; - $request->setCryptoKey($cryptoKey); - $request->setUpdateMask($updateMask); - $requestParamHeaders['crypto_key.name'] = $cryptoKey->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateCryptoKey', CryptoKey::class, $optionalArgs, $request)->wait(); - } - - /** - * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that - * will be used in - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. - * - * Returns an error if called on a key whose purpose is not - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $formattedName = $keyManagementServiceClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - * $cryptoKeyVersionId = 'crypto_key_version_id'; - * $response = $keyManagementServiceClient->updateCryptoKeyPrimaryVersion($formattedName, $cryptoKeyVersionId); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. - * @param string $cryptoKeyVersionId Required. The id of the child - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. - * @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\Kms\V1\CryptoKey - * - * @throws ApiException if the remote call fails - */ - public function updateCryptoKeyPrimaryVersion($name, $cryptoKeyVersionId, array $optionalArgs = []) - { - $request = new UpdateCryptoKeyPrimaryVersionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setCryptoKeyVersionId($cryptoKeyVersionId); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateCryptoKeyPrimaryVersion', CryptoKey::class, $optionalArgs, $request)->wait(); - } - - /** - * Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s - * metadata. - * - * [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between - * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] - * and - * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] - * using this method. See - * [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] - * and - * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] - * to move between other states. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $cryptoKeyVersion = new CryptoKeyVersion(); - * $updateMask = new FieldMask(); - * $response = $keyManagementServiceClient->updateCryptoKeyVersion($cryptoKeyVersion, $updateMask); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param CryptoKeyVersion $cryptoKeyVersion Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - * updated values. - * @param FieldMask $updateMask Required. List of fields to be updated in this request. - * @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\Kms\V1\CryptoKeyVersion - * - * @throws ApiException if the remote call fails - */ - public function updateCryptoKeyVersion($cryptoKeyVersion, $updateMask, array $optionalArgs = []) - { - $request = new UpdateCryptoKeyVersionRequest(); - $requestParamHeaders = []; - $request->setCryptoKeyVersion($cryptoKeyVersion); - $request->setUpdateMask($updateMask); - $requestParamHeaders['crypto_key_version.name'] = $cryptoKeyVersion->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateCryptoKeyVersion', CryptoKeyVersion::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $response = $keyManagementServiceClient->getLocation(); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $keyManagementServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $keyManagementServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $resource = 'resource'; - * $response = $keyManagementServiceClient->getIamPolicy($resource); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $keyManagementServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $keyManagementServiceClient = new KeyManagementServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $keyManagementServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $keyManagementServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } -} diff --git a/owl-bot-staging/Kms/v1/src/V1/KeyManagementServiceClient.php b/owl-bot-staging/Kms/v1/src/V1/KeyManagementServiceClient.php deleted file mode 100644 index 4f107eec48d7..000000000000 --- a/owl-bot-staging/Kms/v1/src/V1/KeyManagementServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.cloud.kms.v1.EkmService' => [ - 'CreateEkmConnection' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\EkmConnection', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetEkmConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\EkmConfig', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetEkmConnection' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\EkmConnection', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListEkmConnections' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getEkmConnections', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\ListEkmConnectionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateEkmConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\EkmConfig', - 'headerParams' => [ - [ - 'keyName' => 'ekm_config.name', - 'fieldAccessors' => [ - 'getEkmConfig', - 'getName', - ], - ], - ], - ], - 'UpdateEkmConnection' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\EkmConnection', - 'headerParams' => [ - [ - 'keyName' => 'ekm_connection.name', - 'fieldAccessors' => [ - 'getEkmConnection', - 'getName', - ], - ], - ], - ], - 'VerifyConnectivity' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\VerifyConnectivityResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'templateMap' => [ - 'ekmConfig' => 'projects/{project}/locations/{location}/ekmConfig', - 'ekmConnection' => 'projects/{project}/locations/{location}/ekmConnections/{ekm_connection}', - 'location' => 'projects/{project}/locations/{location}', - 'service' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_rest_client_config.php b/owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_rest_client_config.php deleted file mode 100644 index d727cf9dbad7..000000000000 --- a/owl-bot-staging/Kms/v1/src/V1/resources/ekm_service_rest_client_config.php +++ /dev/null @@ -1,243 +0,0 @@ - [ - 'google.cloud.kms.v1.EkmService' => [ - 'CreateEkmConnection' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/ekmConnections', - 'body' => 'ekm_connection', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'ekm_connection_id', - ], - ], - 'GetEkmConfig' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/ekmConfig}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetEkmConnection' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/ekmConnections/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListEkmConnections' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/ekmConnections', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateEkmConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{ekm_config.name=projects/*/locations/*/ekmConfig}', - 'body' => 'ekm_config', - 'placeholders' => [ - 'ekm_config.name' => [ - 'getters' => [ - 'getEkmConfig', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateEkmConnection' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{ekm_connection.name=projects/*/locations/*/ekmConnections/*}', - 'body' => 'ekm_connection', - 'placeholders' => [ - 'ekm_connection.name' => [ - 'getters' => [ - 'getEkmConnection', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'VerifyConnectivity' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/ekmConnections/*}:verifyConnectivity', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_client_config.json b/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_client_config.json deleted file mode 100644 index e29002f9aa07..000000000000 --- a/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_client_config.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "interfaces": { - "google.cloud.kms.v1.KeyManagementService": { - "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "AsymmetricDecrypt": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AsymmetricSign": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateCryptoKey": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateImportJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateKeyRing": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "Decrypt": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DestroyCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "Encrypt": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GenerateRandomBytes": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetCryptoKey": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetImportJob": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetKeyRing": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetPublicKey": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ImportCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListCryptoKeyVersions": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListCryptoKeys": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListImportJobs": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListKeyRings": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "MacSign": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MacVerify": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RawDecrypt": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RawEncrypt": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestoreCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCryptoKey": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCryptoKeyPrimaryVersion": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCryptoKeyVersion": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_descriptor_config.php b/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_descriptor_config.php deleted file mode 100644 index 841c9a29088a..000000000000 --- a/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_descriptor_config.php +++ /dev/null @@ -1,478 +0,0 @@ - [ - 'google.cloud.kms.v1.KeyManagementService' => [ - 'AsymmetricDecrypt' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\AsymmetricDecryptResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'AsymmetricSign' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\AsymmetricSignResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'CreateCryptoKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\CryptoKey', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateCryptoKeyVersion' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateImportJob' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\ImportJob', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateKeyRing' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\KeyRing', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'Decrypt' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\DecryptResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DestroyCryptoKeyVersion' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'Encrypt' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\EncryptResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GenerateRandomBytes' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\GenerateRandomBytesResponse', - 'headerParams' => [ - [ - 'keyName' => 'location', - 'fieldAccessors' => [ - 'getLocation', - ], - ], - ], - ], - 'GetCryptoKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\CryptoKey', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetCryptoKeyVersion' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetImportJob' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\ImportJob', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetKeyRing' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\KeyRing', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetPublicKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\PublicKey', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ImportCryptoKeyVersion' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListCryptoKeyVersions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getCryptoKeyVersions', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\ListCryptoKeyVersionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListCryptoKeys' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getCryptoKeys', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\ListCryptoKeysResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListImportJobs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getImportJobs', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\ListImportJobsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListKeyRings' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getKeyRings', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\ListKeyRingsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'MacSign' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\MacSignResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'MacVerify' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\MacVerifyResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RawDecrypt' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\RawDecryptResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RawEncrypt' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\RawEncryptResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RestoreCryptoKeyVersion' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateCryptoKey' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\CryptoKey', - 'headerParams' => [ - [ - 'keyName' => 'crypto_key.name', - 'fieldAccessors' => [ - 'getCryptoKey', - 'getName', - ], - ], - ], - ], - 'UpdateCryptoKeyPrimaryVersion' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\CryptoKey', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateCryptoKeyVersion' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Kms\V1\CryptoKeyVersion', - 'headerParams' => [ - [ - 'keyName' => 'crypto_key_version.name', - 'fieldAccessors' => [ - 'getCryptoKeyVersion', - 'getName', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - 'interfaceOverride' => 'google.iam.v1.IAMPolicy', - ], - 'templateMap' => [ - 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', - 'cryptoKeyVersion' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}', - 'importJob' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}', - 'keyRing' => 'projects/{project}/locations/{location}/keyRings/{key_ring}', - 'location' => 'projects/{project}/locations/{location}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_rest_client_config.php b/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_rest_client_config.php deleted file mode 100644 index fb7c434b4e71..000000000000 --- a/owl-bot-staging/Kms/v1/src/V1/resources/key_management_service_rest_client_config.php +++ /dev/null @@ -1,496 +0,0 @@ - [ - 'google.cloud.kms.v1.KeyManagementService' => [ - 'AsymmetricDecrypt' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricDecrypt', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'AsymmetricSign' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricSign', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CreateCryptoKey' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys', - 'body' => 'crypto_key', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'crypto_key_id', - ], - ], - 'CreateCryptoKeyVersion' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions', - 'body' => 'crypto_key_version', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateImportJob' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs', - 'body' => 'import_job', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'import_job_id', - ], - ], - 'CreateKeyRing' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/keyRings', - 'body' => 'key_ring', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'key_ring_id', - ], - ], - 'Decrypt' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:decrypt', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DestroyCryptoKeyVersion' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:destroy', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'Encrypt' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/**}:encrypt', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GenerateRandomBytes' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{location=projects/*/locations/*}:generateRandomBytes', - 'body' => '*', - 'placeholders' => [ - 'location' => [ - 'getters' => [ - 'getLocation', - ], - ], - ], - ], - 'GetCryptoKey' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetCryptoKeyVersion' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetImportJob' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/importJobs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetKeyRing' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetPublicKey' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}/publicKey', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ImportCryptoKeyVersion' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:import', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListCryptoKeyVersions' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListCryptoKeys' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListImportJobs' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListKeyRings' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/keyRings', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'MacSign' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macSign', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'MacVerify' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macVerify', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RawDecrypt' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawDecrypt', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RawEncrypt' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawEncrypt', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RestoreCryptoKeyVersion' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:restore', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateCryptoKey' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{crypto_key.name=projects/*/locations/*/keyRings/*/cryptoKeys/*}', - 'body' => 'crypto_key', - 'placeholders' => [ - 'crypto_key.name' => [ - 'getters' => [ - 'getCryptoKey', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - 'UpdateCryptoKeyPrimaryVersion' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:updatePrimaryVersion', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateCryptoKeyVersion' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{crypto_key_version.name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}', - 'body' => 'crypto_key_version', - 'placeholders' => [ - 'crypto_key_version.name' => [ - 'getters' => [ - 'getCryptoKeyVersion', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/cryptoKeys/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/keyRings/*/importJobs/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConfig}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/ekmConnections/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/EkmServiceClientTest.php b/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/EkmServiceClientTest.php deleted file mode 100644 index 49e7f80489b6..000000000000 --- a/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/EkmServiceClientTest.php +++ /dev/null @@ -1,948 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return EkmServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new EkmServiceClient($options); - } - - /** @test */ - public function createEkmConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $cryptoSpacePath = 'cryptoSpacePath-1229393412'; - $expectedResponse = new EkmConnection(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setCryptoSpacePath($cryptoSpacePath); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $ekmConnectionId = 'ekmConnectionId270499940'; - $ekmConnection = new EkmConnection(); - $request = (new CreateEkmConnectionRequest()) - ->setParent($formattedParent) - ->setEkmConnectionId($ekmConnectionId) - ->setEkmConnection($ekmConnection); - $response = $gapicClient->createEkmConnection($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.kms.v1.EkmService/CreateEkmConnection', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getEkmConnectionId(); - $this->assertProtobufEquals($ekmConnectionId, $actualValue); - $actualValue = $actualRequestObject->getEkmConnection(); - $this->assertProtobufEquals($ekmConnection, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createEkmConnectionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $ekmConnectionId = 'ekmConnectionId270499940'; - $ekmConnection = new EkmConnection(); - $request = (new CreateEkmConnectionRequest()) - ->setParent($formattedParent) - ->setEkmConnectionId($ekmConnectionId) - ->setEkmConnection($ekmConnection); - try { - $gapicClient->createEkmConnection($request); - // 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 getEkmConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $defaultEkmConnection = 'defaultEkmConnection1342549844'; - $expectedResponse = new EkmConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setDefaultEkmConnection($defaultEkmConnection); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->ekmConfigName('[PROJECT]', '[LOCATION]'); - $request = (new GetEkmConfigRequest()) - ->setName($formattedName); - $response = $gapicClient->getEkmConfig($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.kms.v1.EkmService/GetEkmConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEkmConfigExceptionTest() - { - $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->ekmConfigName('[PROJECT]', '[LOCATION]'); - $request = (new GetEkmConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->getEkmConfig($request); - // 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 getEkmConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $cryptoSpacePath = 'cryptoSpacePath-1229393412'; - $expectedResponse = new EkmConnection(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setCryptoSpacePath($cryptoSpacePath); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - $request = (new GetEkmConnectionRequest()) - ->setName($formattedName); - $response = $gapicClient->getEkmConnection($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.kms.v1.EkmService/GetEkmConnection', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEkmConnectionExceptionTest() - { - $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->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - $request = (new GetEkmConnectionRequest()) - ->setName($formattedName); - try { - $gapicClient->getEkmConnection($request); - // 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 listEkmConnectionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $ekmConnectionsElement = new EkmConnection(); - $ekmConnections = [ - $ekmConnectionsElement, - ]; - $expectedResponse = new ListEkmConnectionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setEkmConnections($ekmConnections); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListEkmConnectionsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listEkmConnections($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEkmConnections()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.EkmService/ListEkmConnections', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEkmConnectionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListEkmConnectionsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listEkmConnections($request); - // 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 updateEkmConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $defaultEkmConnection = 'defaultEkmConnection1342549844'; - $expectedResponse = new EkmConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDefaultEkmConnection($defaultEkmConnection); - $transport->addResponse($expectedResponse); - // Mock request - $ekmConfig = new EkmConfig(); - $updateMask = new FieldMask(); - $request = (new UpdateEkmConfigRequest()) - ->setEkmConfig($ekmConfig) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateEkmConfig($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.kms.v1.EkmService/UpdateEkmConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getEkmConfig(); - $this->assertProtobufEquals($ekmConfig, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEkmConfigExceptionTest() - { - $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 - $ekmConfig = new EkmConfig(); - $updateMask = new FieldMask(); - $request = (new UpdateEkmConfigRequest()) - ->setEkmConfig($ekmConfig) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateEkmConfig($request); - // 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 updateEkmConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $cryptoSpacePath = 'cryptoSpacePath-1229393412'; - $expectedResponse = new EkmConnection(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setCryptoSpacePath($cryptoSpacePath); - $transport->addResponse($expectedResponse); - // Mock request - $ekmConnection = new EkmConnection(); - $updateMask = new FieldMask(); - $request = (new UpdateEkmConnectionRequest()) - ->setEkmConnection($ekmConnection) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateEkmConnection($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.kms.v1.EkmService/UpdateEkmConnection', $actualFuncCall); - $actualValue = $actualRequestObject->getEkmConnection(); - $this->assertProtobufEquals($ekmConnection, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEkmConnectionExceptionTest() - { - $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 - $ekmConnection = new EkmConnection(); - $updateMask = new FieldMask(); - $request = (new UpdateEkmConnectionRequest()) - ->setEkmConnection($ekmConnection) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateEkmConnection($request); - // 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 verifyConnectivityTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new VerifyConnectivityResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - $request = (new VerifyConnectivityRequest()) - ->setName($formattedName); - $response = $gapicClient->verifyConnectivity($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.kms.v1.EkmService/VerifyConnectivity', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function verifyConnectivityExceptionTest() - { - $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->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - $request = (new VerifyConnectivityRequest()) - ->setName($formattedName); - try { - $gapicClient->verifyConnectivity($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($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.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 createEkmConnectionAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $cryptoSpacePath = 'cryptoSpacePath-1229393412'; - $expectedResponse = new EkmConnection(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setCryptoSpacePath($cryptoSpacePath); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $ekmConnectionId = 'ekmConnectionId270499940'; - $ekmConnection = new EkmConnection(); - $request = (new CreateEkmConnectionRequest()) - ->setParent($formattedParent) - ->setEkmConnectionId($ekmConnectionId) - ->setEkmConnection($ekmConnection); - $response = $gapicClient->createEkmConnectionAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.EkmService/CreateEkmConnection', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getEkmConnectionId(); - $this->assertProtobufEquals($ekmConnectionId, $actualValue); - $actualValue = $actualRequestObject->getEkmConnection(); - $this->assertProtobufEquals($ekmConnection, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/KeyManagementServiceClientTest.php b/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/KeyManagementServiceClientTest.php deleted file mode 100644 index a908438108e1..000000000000 --- a/owl-bot-staging/Kms/v1/tests/Unit/V1/Client/KeyManagementServiceClientTest.php +++ /dev/null @@ -1,2573 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return KeyManagementServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new KeyManagementServiceClient($options); - } - - /** @test */ - public function asymmetricDecryptTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $plaintext = '-9'; - $verifiedCiphertextCrc32c = true; - $expectedResponse = new AsymmetricDecryptResponse(); - $expectedResponse->setPlaintext($plaintext); - $expectedResponse->setVerifiedCiphertextCrc32c($verifiedCiphertextCrc32c); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $ciphertext = '-72'; - $request = (new AsymmetricDecryptRequest()) - ->setName($formattedName) - ->setCiphertext($ciphertext); - $response = $gapicClient->asymmetricDecrypt($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.kms.v1.KeyManagementService/AsymmetricDecrypt', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getCiphertext(); - $this->assertProtobufEquals($ciphertext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function asymmetricDecryptExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $ciphertext = '-72'; - $request = (new AsymmetricDecryptRequest()) - ->setName($formattedName) - ->setCiphertext($ciphertext); - try { - $gapicClient->asymmetricDecrypt($request); - // 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 asymmetricSignTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $signature = '-72'; - $verifiedDigestCrc32c = true; - $name2 = 'name2-1052831874'; - $verifiedDataCrc32c = true; - $expectedResponse = new AsymmetricSignResponse(); - $expectedResponse->setSignature($signature); - $expectedResponse->setVerifiedDigestCrc32c($verifiedDigestCrc32c); - $expectedResponse->setName($name2); - $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $digest = new Digest(); - $request = (new AsymmetricSignRequest()) - ->setName($formattedName) - ->setDigest($digest); - $response = $gapicClient->asymmetricSign($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.kms.v1.KeyManagementService/AsymmetricSign', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getDigest(); - $this->assertProtobufEquals($digest, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function asymmetricSignExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $digest = new Digest(); - $request = (new AsymmetricSignRequest()) - ->setName($formattedName) - ->setDigest($digest); - try { - $gapicClient->asymmetricSign($request); - // 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 createCryptoKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $importOnly = true; - $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; - $expectedResponse = new CryptoKey(); - $expectedResponse->setName($name); - $expectedResponse->setImportOnly($importOnly); - $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $cryptoKeyId = 'cryptoKeyId-2123094983'; - $cryptoKey = new CryptoKey(); - $request = (new CreateCryptoKeyRequest()) - ->setParent($formattedParent) - ->setCryptoKeyId($cryptoKeyId) - ->setCryptoKey($cryptoKey); - $response = $gapicClient->createCryptoKey($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.kms.v1.KeyManagementService/CreateCryptoKey', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getCryptoKeyId(); - $this->assertProtobufEquals($cryptoKeyId, $actualValue); - $actualValue = $actualRequestObject->getCryptoKey(); - $this->assertProtobufEquals($cryptoKey, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createCryptoKeyExceptionTest() - { - $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $cryptoKeyId = 'cryptoKeyId-2123094983'; - $cryptoKey = new CryptoKey(); - $request = (new CreateCryptoKeyRequest()) - ->setParent($formattedParent) - ->setCryptoKeyId($cryptoKeyId) - ->setCryptoKey($cryptoKey); - try { - $gapicClient->createCryptoKey($request); - // 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 createCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $importJob = 'importJob2125587491'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name); - $expectedResponse->setImportJob($importJob); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $cryptoKeyVersion = new CryptoKeyVersion(); - $request = (new CreateCryptoKeyVersionRequest()) - ->setParent($formattedParent) - ->setCryptoKeyVersion($cryptoKeyVersion); - $response = $gapicClient->createCryptoKeyVersion($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.kms.v1.KeyManagementService/CreateCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getCryptoKeyVersion(); - $this->assertProtobufEquals($cryptoKeyVersion, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createCryptoKeyVersionExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $cryptoKeyVersion = new CryptoKeyVersion(); - $request = (new CreateCryptoKeyVersionRequest()) - ->setParent($formattedParent) - ->setCryptoKeyVersion($cryptoKeyVersion); - try { - $gapicClient->createCryptoKeyVersion($request); - // 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 createImportJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new ImportJob(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $importJobId = 'importJobId-1620773193'; - $importJob = new ImportJob(); - $importJobImportMethod = ImportMethod::IMPORT_METHOD_UNSPECIFIED; - $importJob->setImportMethod($importJobImportMethod); - $importJobProtectionLevel = ProtectionLevel::PROTECTION_LEVEL_UNSPECIFIED; - $importJob->setProtectionLevel($importJobProtectionLevel); - $request = (new CreateImportJobRequest()) - ->setParent($formattedParent) - ->setImportJobId($importJobId) - ->setImportJob($importJob); - $response = $gapicClient->createImportJob($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.kms.v1.KeyManagementService/CreateImportJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getImportJobId(); - $this->assertProtobufEquals($importJobId, $actualValue); - $actualValue = $actualRequestObject->getImportJob(); - $this->assertProtobufEquals($importJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createImportJobExceptionTest() - { - $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $importJobId = 'importJobId-1620773193'; - $importJob = new ImportJob(); - $importJobImportMethod = ImportMethod::IMPORT_METHOD_UNSPECIFIED; - $importJob->setImportMethod($importJobImportMethod); - $importJobProtectionLevel = ProtectionLevel::PROTECTION_LEVEL_UNSPECIFIED; - $importJob->setProtectionLevel($importJobProtectionLevel); - $request = (new CreateImportJobRequest()) - ->setParent($formattedParent) - ->setImportJobId($importJobId) - ->setImportJob($importJob); - try { - $gapicClient->createImportJob($request); - // 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 createKeyRingTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new KeyRing(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $keyRingId = 'keyRingId-2056646742'; - $keyRing = new KeyRing(); - $request = (new CreateKeyRingRequest()) - ->setParent($formattedParent) - ->setKeyRingId($keyRingId) - ->setKeyRing($keyRing); - $response = $gapicClient->createKeyRing($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.kms.v1.KeyManagementService/CreateKeyRing', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getKeyRingId(); - $this->assertProtobufEquals($keyRingId, $actualValue); - $actualValue = $actualRequestObject->getKeyRing(); - $this->assertProtobufEquals($keyRing, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createKeyRingExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $keyRingId = 'keyRingId-2056646742'; - $keyRing = new KeyRing(); - $request = (new CreateKeyRingRequest()) - ->setParent($formattedParent) - ->setKeyRingId($keyRingId) - ->setKeyRing($keyRing); - try { - $gapicClient->createKeyRing($request); - // 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 decryptTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $plaintext = '-9'; - $usedPrimary = true; - $expectedResponse = new DecryptResponse(); - $expectedResponse->setPlaintext($plaintext); - $expectedResponse->setUsedPrimary($usedPrimary); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $ciphertext = '-72'; - $request = (new DecryptRequest()) - ->setName($formattedName) - ->setCiphertext($ciphertext); - $response = $gapicClient->decrypt($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.kms.v1.KeyManagementService/Decrypt', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getCiphertext(); - $this->assertProtobufEquals($ciphertext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function decryptExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $ciphertext = '-72'; - $request = (new DecryptRequest()) - ->setName($formattedName) - ->setCiphertext($ciphertext); - try { - $gapicClient->decrypt($request); - // 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 destroyCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $importJob = 'importJob2125587491'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name2); - $expectedResponse->setImportJob($importJob); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $request = (new DestroyCryptoKeyVersionRequest()) - ->setName($formattedName); - $response = $gapicClient->destroyCryptoKeyVersion($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.kms.v1.KeyManagementService/DestroyCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function destroyCryptoKeyVersionExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $request = (new DestroyCryptoKeyVersionRequest()) - ->setName($formattedName); - try { - $gapicClient->destroyCryptoKeyVersion($request); - // 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 encryptTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $ciphertext = '-72'; - $verifiedPlaintextCrc32c = false; - $verifiedAdditionalAuthenticatedDataCrc32c = true; - $expectedResponse = new EncryptResponse(); - $expectedResponse->setName($name2); - $expectedResponse->setCiphertext($ciphertext); - $expectedResponse->setVerifiedPlaintextCrc32c($verifiedPlaintextCrc32c); - $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $plaintext = '-9'; - $request = (new EncryptRequest()) - ->setName($name) - ->setPlaintext($plaintext); - $response = $gapicClient->encrypt($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.kms.v1.KeyManagementService/Encrypt', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getPlaintext(); - $this->assertProtobufEquals($plaintext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function encryptExceptionTest() - { - $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 - $name = 'name3373707'; - $plaintext = '-9'; - $request = (new EncryptRequest()) - ->setName($name) - ->setPlaintext($plaintext); - try { - $gapicClient->encrypt($request); - // 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 generateRandomBytesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $data = '-86'; - $expectedResponse = new GenerateRandomBytesResponse(); - $expectedResponse->setData($data); - $transport->addResponse($expectedResponse); - $request = new GenerateRandomBytesRequest(); - $response = $gapicClient->generateRandomBytes($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.kms.v1.KeyManagementService/GenerateRandomBytes', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateRandomBytesExceptionTest() - { - $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); - $request = new GenerateRandomBytesRequest(); - try { - $gapicClient->generateRandomBytes($request); - // 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 getCryptoKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $importOnly = true; - $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; - $expectedResponse = new CryptoKey(); - $expectedResponse->setName($name2); - $expectedResponse->setImportOnly($importOnly); - $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $request = (new GetCryptoKeyRequest()) - ->setName($formattedName); - $response = $gapicClient->getCryptoKey($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.kms.v1.KeyManagementService/GetCryptoKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCryptoKeyExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $request = (new GetCryptoKeyRequest()) - ->setName($formattedName); - try { - $gapicClient->getCryptoKey($request); - // 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 getCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $importJob = 'importJob2125587491'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name2); - $expectedResponse->setImportJob($importJob); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $request = (new GetCryptoKeyVersionRequest()) - ->setName($formattedName); - $response = $gapicClient->getCryptoKeyVersion($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.kms.v1.KeyManagementService/GetCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCryptoKeyVersionExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $request = (new GetCryptoKeyVersionRequest()) - ->setName($formattedName); - try { - $gapicClient->getCryptoKeyVersion($request); - // 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 getImportJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new ImportJob(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->importJobName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[IMPORT_JOB]'); - $request = (new GetImportJobRequest()) - ->setName($formattedName); - $response = $gapicClient->getImportJob($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.kms.v1.KeyManagementService/GetImportJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getImportJobExceptionTest() - { - $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->importJobName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[IMPORT_JOB]'); - $request = (new GetImportJobRequest()) - ->setName($formattedName); - try { - $gapicClient->getImportJob($request); - // 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 getKeyRingTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new KeyRing(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $request = (new GetKeyRingRequest()) - ->setName($formattedName); - $response = $gapicClient->getKeyRing($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.kms.v1.KeyManagementService/GetKeyRing', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getKeyRingExceptionTest() - { - $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $request = (new GetKeyRingRequest()) - ->setName($formattedName); - try { - $gapicClient->getKeyRing($request); - // 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 getPublicKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $pem = 'pem110872'; - $name2 = 'name2-1052831874'; - $expectedResponse = new PublicKey(); - $expectedResponse->setPem($pem); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $request = (new GetPublicKeyRequest()) - ->setName($formattedName); - $response = $gapicClient->getPublicKey($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.kms.v1.KeyManagementService/GetPublicKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPublicKeyExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $request = (new GetPublicKeyRequest()) - ->setName($formattedName); - try { - $gapicClient->getPublicKey($request); - // 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 importCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $importJob2 = 'importJob2-1714851050'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name); - $expectedResponse->setImportJob($importJob2); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; - $importJob = 'importJob2125587491'; - $request = (new ImportCryptoKeyVersionRequest()) - ->setParent($formattedParent) - ->setAlgorithm($algorithm) - ->setImportJob($importJob); - $response = $gapicClient->importCryptoKeyVersion($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.kms.v1.KeyManagementService/ImportCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getAlgorithm(); - $this->assertProtobufEquals($algorithm, $actualValue); - $actualValue = $actualRequestObject->getImportJob(); - $this->assertProtobufEquals($importJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function importCryptoKeyVersionExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; - $importJob = 'importJob2125587491'; - $request = (new ImportCryptoKeyVersionRequest()) - ->setParent($formattedParent) - ->setAlgorithm($algorithm) - ->setImportJob($importJob); - try { - $gapicClient->importCryptoKeyVersion($request); - // 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 listCryptoKeyVersionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $cryptoKeyVersionsElement = new CryptoKeyVersion(); - $cryptoKeyVersions = [ - $cryptoKeyVersionsElement, - ]; - $expectedResponse = new ListCryptoKeyVersionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setCryptoKeyVersions($cryptoKeyVersions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $request = (new ListCryptoKeyVersionsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listCryptoKeyVersions($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCryptoKeyVersions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListCryptoKeyVersions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCryptoKeyVersionsExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $request = (new ListCryptoKeyVersionsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listCryptoKeyVersions($request); - // 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 listCryptoKeysTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $cryptoKeysElement = new CryptoKey(); - $cryptoKeys = [ - $cryptoKeysElement, - ]; - $expectedResponse = new ListCryptoKeysResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setCryptoKeys($cryptoKeys); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $request = (new ListCryptoKeysRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listCryptoKeys($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCryptoKeys()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListCryptoKeys', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCryptoKeysExceptionTest() - { - $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $request = (new ListCryptoKeysRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listCryptoKeys($request); - // 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 listImportJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $importJobsElement = new ImportJob(); - $importJobs = [ - $importJobsElement, - ]; - $expectedResponse = new ListImportJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setImportJobs($importJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $request = (new ListImportJobsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listImportJobs($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getImportJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListImportJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listImportJobsExceptionTest() - { - $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $request = (new ListImportJobsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listImportJobs($request); - // 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 listKeyRingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $keyRingsElement = new KeyRing(); - $keyRings = [ - $keyRingsElement, - ]; - $expectedResponse = new ListKeyRingsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setKeyRings($keyRings); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListKeyRingsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listKeyRings($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getKeyRings()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListKeyRings', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listKeyRingsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListKeyRingsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listKeyRings($request); - // 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 macSignTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $mac = '79'; - $verifiedDataCrc32c = true; - $expectedResponse = new MacSignResponse(); - $expectedResponse->setName($name2); - $expectedResponse->setMac($mac); - $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $data = '-86'; - $request = (new MacSignRequest()) - ->setName($formattedName) - ->setData($data); - $response = $gapicClient->macSign($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.kms.v1.KeyManagementService/MacSign', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getData(); - $this->assertProtobufEquals($data, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function macSignExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $data = '-86'; - $request = (new MacSignRequest()) - ->setName($formattedName) - ->setData($data); - try { - $gapicClient->macSign($request); - // 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 macVerifyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $success = false; - $verifiedDataCrc32c = true; - $verifiedMacCrc32c = false; - $verifiedSuccessIntegrity = true; - $expectedResponse = new MacVerifyResponse(); - $expectedResponse->setName($name2); - $expectedResponse->setSuccess($success); - $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); - $expectedResponse->setVerifiedMacCrc32c($verifiedMacCrc32c); - $expectedResponse->setVerifiedSuccessIntegrity($verifiedSuccessIntegrity); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $data = '-86'; - $mac = '79'; - $request = (new MacVerifyRequest()) - ->setName($formattedName) - ->setData($data) - ->setMac($mac); - $response = $gapicClient->macVerify($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.kms.v1.KeyManagementService/MacVerify', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getData(); - $this->assertProtobufEquals($data, $actualValue); - $actualValue = $actualRequestObject->getMac(); - $this->assertProtobufEquals($mac, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function macVerifyExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $data = '-86'; - $mac = '79'; - $request = (new MacVerifyRequest()) - ->setName($formattedName) - ->setData($data) - ->setMac($mac); - try { - $gapicClient->macVerify($request); - // 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 rawDecryptTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $plaintext = '-9'; - $verifiedCiphertextCrc32c = true; - $verifiedAdditionalAuthenticatedDataCrc32c = true; - $verifiedInitializationVectorCrc32c = true; - $expectedResponse = new RawDecryptResponse(); - $expectedResponse->setPlaintext($plaintext); - $expectedResponse->setVerifiedCiphertextCrc32c($verifiedCiphertextCrc32c); - $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); - $expectedResponse->setVerifiedInitializationVectorCrc32c($verifiedInitializationVectorCrc32c); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $ciphertext = '-72'; - $initializationVector = '-62'; - $request = (new RawDecryptRequest()) - ->setName($name) - ->setCiphertext($ciphertext) - ->setInitializationVector($initializationVector); - $response = $gapicClient->rawDecrypt($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.kms.v1.KeyManagementService/RawDecrypt', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getCiphertext(); - $this->assertProtobufEquals($ciphertext, $actualValue); - $actualValue = $actualRequestObject->getInitializationVector(); - $this->assertProtobufEquals($initializationVector, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rawDecryptExceptionTest() - { - $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 - $name = 'name3373707'; - $ciphertext = '-72'; - $initializationVector = '-62'; - $request = (new RawDecryptRequest()) - ->setName($name) - ->setCiphertext($ciphertext) - ->setInitializationVector($initializationVector); - try { - $gapicClient->rawDecrypt($request); - // 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 rawEncryptTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $ciphertext = '-72'; - $initializationVector2 = '-11'; - $tagLength = 172791595; - $verifiedPlaintextCrc32c = false; - $verifiedAdditionalAuthenticatedDataCrc32c = true; - $verifiedInitializationVectorCrc32c = true; - $name2 = 'name2-1052831874'; - $expectedResponse = new RawEncryptResponse(); - $expectedResponse->setCiphertext($ciphertext); - $expectedResponse->setInitializationVector($initializationVector2); - $expectedResponse->setTagLength($tagLength); - $expectedResponse->setVerifiedPlaintextCrc32c($verifiedPlaintextCrc32c); - $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); - $expectedResponse->setVerifiedInitializationVectorCrc32c($verifiedInitializationVectorCrc32c); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $plaintext = '-9'; - $request = (new RawEncryptRequest()) - ->setName($name) - ->setPlaintext($plaintext); - $response = $gapicClient->rawEncrypt($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.kms.v1.KeyManagementService/RawEncrypt', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getPlaintext(); - $this->assertProtobufEquals($plaintext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rawEncryptExceptionTest() - { - $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 - $name = 'name3373707'; - $plaintext = '-9'; - $request = (new RawEncryptRequest()) - ->setName($name) - ->setPlaintext($plaintext); - try { - $gapicClient->rawEncrypt($request); - // 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 restoreCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $importJob = 'importJob2125587491'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name2); - $expectedResponse->setImportJob($importJob); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $request = (new RestoreCryptoKeyVersionRequest()) - ->setName($formattedName); - $response = $gapicClient->restoreCryptoKeyVersion($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.kms.v1.KeyManagementService/RestoreCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function restoreCryptoKeyVersionExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $request = (new RestoreCryptoKeyVersionRequest()) - ->setName($formattedName); - try { - $gapicClient->restoreCryptoKeyVersion($request); - // 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 updateCryptoKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $importOnly = true; - $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; - $expectedResponse = new CryptoKey(); - $expectedResponse->setName($name); - $expectedResponse->setImportOnly($importOnly); - $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); - $transport->addResponse($expectedResponse); - // Mock request - $cryptoKey = new CryptoKey(); - $updateMask = new FieldMask(); - $request = (new UpdateCryptoKeyRequest()) - ->setCryptoKey($cryptoKey) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateCryptoKey($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.kms.v1.KeyManagementService/UpdateCryptoKey', $actualFuncCall); - $actualValue = $actualRequestObject->getCryptoKey(); - $this->assertProtobufEquals($cryptoKey, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateCryptoKeyExceptionTest() - { - $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 - $cryptoKey = new CryptoKey(); - $updateMask = new FieldMask(); - $request = (new UpdateCryptoKeyRequest()) - ->setCryptoKey($cryptoKey) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateCryptoKey($request); - // 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 updateCryptoKeyPrimaryVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $importOnly = true; - $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; - $expectedResponse = new CryptoKey(); - $expectedResponse->setName($name2); - $expectedResponse->setImportOnly($importOnly); - $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $cryptoKeyVersionId = 'cryptoKeyVersionId729489152'; - $request = (new UpdateCryptoKeyPrimaryVersionRequest()) - ->setName($formattedName) - ->setCryptoKeyVersionId($cryptoKeyVersionId); - $response = $gapicClient->updateCryptoKeyPrimaryVersion($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.kms.v1.KeyManagementService/UpdateCryptoKeyPrimaryVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getCryptoKeyVersionId(); - $this->assertProtobufEquals($cryptoKeyVersionId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateCryptoKeyPrimaryVersionExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $cryptoKeyVersionId = 'cryptoKeyVersionId729489152'; - $request = (new UpdateCryptoKeyPrimaryVersionRequest()) - ->setName($formattedName) - ->setCryptoKeyVersionId($cryptoKeyVersionId); - try { - $gapicClient->updateCryptoKeyPrimaryVersion($request); - // 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 updateCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $importJob = 'importJob2125587491'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name); - $expectedResponse->setImportJob($importJob); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $cryptoKeyVersion = new CryptoKeyVersion(); - $updateMask = new FieldMask(); - $request = (new UpdateCryptoKeyVersionRequest()) - ->setCryptoKeyVersion($cryptoKeyVersion) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateCryptoKeyVersion($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.kms.v1.KeyManagementService/UpdateCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getCryptoKeyVersion(); - $this->assertProtobufEquals($cryptoKeyVersion, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateCryptoKeyVersionExceptionTest() - { - $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 - $cryptoKeyVersion = new CryptoKeyVersion(); - $updateMask = new FieldMask(); - $request = (new UpdateCryptoKeyVersionRequest()) - ->setCryptoKeyVersion($cryptoKeyVersion) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateCryptoKeyVersion($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($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.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // 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 asymmetricDecryptAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $plaintext = '-9'; - $verifiedCiphertextCrc32c = true; - $expectedResponse = new AsymmetricDecryptResponse(); - $expectedResponse->setPlaintext($plaintext); - $expectedResponse->setVerifiedCiphertextCrc32c($verifiedCiphertextCrc32c); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $ciphertext = '-72'; - $request = (new AsymmetricDecryptRequest()) - ->setName($formattedName) - ->setCiphertext($ciphertext); - $response = $gapicClient->asymmetricDecryptAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/AsymmetricDecrypt', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getCiphertext(); - $this->assertProtobufEquals($ciphertext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Kms/v1/tests/Unit/V1/EkmServiceClientTest.php b/owl-bot-staging/Kms/v1/tests/Unit/V1/EkmServiceClientTest.php deleted file mode 100644 index 5b8208c26ee5..000000000000 --- a/owl-bot-staging/Kms/v1/tests/Unit/V1/EkmServiceClientTest.php +++ /dev/null @@ -1,839 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return EkmServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new EkmServiceClient($options); - } - - /** @test */ - public function createEkmConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $cryptoSpacePath = 'cryptoSpacePath-1229393412'; - $expectedResponse = new EkmConnection(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setCryptoSpacePath($cryptoSpacePath); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $ekmConnectionId = 'ekmConnectionId270499940'; - $ekmConnection = new EkmConnection(); - $response = $gapicClient->createEkmConnection($formattedParent, $ekmConnectionId, $ekmConnection); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.EkmService/CreateEkmConnection', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getEkmConnectionId(); - $this->assertProtobufEquals($ekmConnectionId, $actualValue); - $actualValue = $actualRequestObject->getEkmConnection(); - $this->assertProtobufEquals($ekmConnection, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createEkmConnectionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $ekmConnectionId = 'ekmConnectionId270499940'; - $ekmConnection = new EkmConnection(); - try { - $gapicClient->createEkmConnection($formattedParent, $ekmConnectionId, $ekmConnection); - // 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 getEkmConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $defaultEkmConnection = 'defaultEkmConnection1342549844'; - $expectedResponse = new EkmConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setDefaultEkmConnection($defaultEkmConnection); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->ekmConfigName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->getEkmConfig($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.kms.v1.EkmService/GetEkmConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEkmConfigExceptionTest() - { - $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->ekmConfigName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->getEkmConfig($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 getEkmConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $etag = 'etag3123477'; - $cryptoSpacePath = 'cryptoSpacePath-1229393412'; - $expectedResponse = new EkmConnection(); - $expectedResponse->setName($name2); - $expectedResponse->setEtag($etag); - $expectedResponse->setCryptoSpacePath($cryptoSpacePath); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - $response = $gapicClient->getEkmConnection($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.kms.v1.EkmService/GetEkmConnection', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEkmConnectionExceptionTest() - { - $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->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - try { - $gapicClient->getEkmConnection($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 listEkmConnectionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $ekmConnectionsElement = new EkmConnection(); - $ekmConnections = [ - $ekmConnectionsElement, - ]; - $expectedResponse = new ListEkmConnectionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setEkmConnections($ekmConnections); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listEkmConnections($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEkmConnections()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.EkmService/ListEkmConnections', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEkmConnectionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listEkmConnections($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 updateEkmConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $defaultEkmConnection = 'defaultEkmConnection1342549844'; - $expectedResponse = new EkmConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDefaultEkmConnection($defaultEkmConnection); - $transport->addResponse($expectedResponse); - // Mock request - $ekmConfig = new EkmConfig(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateEkmConfig($ekmConfig, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.EkmService/UpdateEkmConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getEkmConfig(); - $this->assertProtobufEquals($ekmConfig, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEkmConfigExceptionTest() - { - $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 - $ekmConfig = new EkmConfig(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateEkmConfig($ekmConfig, $updateMask); - // 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 updateEkmConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $etag = 'etag3123477'; - $cryptoSpacePath = 'cryptoSpacePath-1229393412'; - $expectedResponse = new EkmConnection(); - $expectedResponse->setName($name); - $expectedResponse->setEtag($etag); - $expectedResponse->setCryptoSpacePath($cryptoSpacePath); - $transport->addResponse($expectedResponse); - // Mock request - $ekmConnection = new EkmConnection(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateEkmConnection($ekmConnection, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.EkmService/UpdateEkmConnection', $actualFuncCall); - $actualValue = $actualRequestObject->getEkmConnection(); - $this->assertProtobufEquals($ekmConnection, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateEkmConnectionExceptionTest() - { - $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 - $ekmConnection = new EkmConnection(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateEkmConnection($ekmConnection, $updateMask); - // 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 verifyConnectivityTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new VerifyConnectivityResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - $response = $gapicClient->verifyConnectivity($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.kms.v1.EkmService/VerifyConnectivity', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function verifyConnectivityExceptionTest() - { - $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->ekmConnectionName('[PROJECT]', '[LOCATION]', '[EKM_CONNECTION]'); - try { - $gapicClient->verifyConnectivity($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 getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Kms/v1/tests/Unit/V1/KeyManagementServiceClientTest.php b/owl-bot-staging/Kms/v1/tests/Unit/V1/KeyManagementServiceClientTest.php deleted file mode 100644 index 4422a7b80bcd..000000000000 --- a/owl-bot-staging/Kms/v1/tests/Unit/V1/KeyManagementServiceClientTest.php +++ /dev/null @@ -1,2331 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return KeyManagementServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new KeyManagementServiceClient($options); - } - - /** @test */ - public function asymmetricDecryptTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $plaintext = '-9'; - $verifiedCiphertextCrc32c = true; - $expectedResponse = new AsymmetricDecryptResponse(); - $expectedResponse->setPlaintext($plaintext); - $expectedResponse->setVerifiedCiphertextCrc32c($verifiedCiphertextCrc32c); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $ciphertext = '-72'; - $response = $gapicClient->asymmetricDecrypt($formattedName, $ciphertext); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/AsymmetricDecrypt', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getCiphertext(); - $this->assertProtobufEquals($ciphertext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function asymmetricDecryptExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $ciphertext = '-72'; - try { - $gapicClient->asymmetricDecrypt($formattedName, $ciphertext); - // 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 asymmetricSignTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $signature = '-72'; - $verifiedDigestCrc32c = true; - $name2 = 'name2-1052831874'; - $verifiedDataCrc32c = true; - $expectedResponse = new AsymmetricSignResponse(); - $expectedResponse->setSignature($signature); - $expectedResponse->setVerifiedDigestCrc32c($verifiedDigestCrc32c); - $expectedResponse->setName($name2); - $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $digest = new Digest(); - $response = $gapicClient->asymmetricSign($formattedName, $digest); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/AsymmetricSign', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getDigest(); - $this->assertProtobufEquals($digest, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function asymmetricSignExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $digest = new Digest(); - try { - $gapicClient->asymmetricSign($formattedName, $digest); - // 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 createCryptoKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $importOnly = true; - $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; - $expectedResponse = new CryptoKey(); - $expectedResponse->setName($name); - $expectedResponse->setImportOnly($importOnly); - $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $cryptoKeyId = 'cryptoKeyId-2123094983'; - $cryptoKey = new CryptoKey(); - $response = $gapicClient->createCryptoKey($formattedParent, $cryptoKeyId, $cryptoKey); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/CreateCryptoKey', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getCryptoKeyId(); - $this->assertProtobufEquals($cryptoKeyId, $actualValue); - $actualValue = $actualRequestObject->getCryptoKey(); - $this->assertProtobufEquals($cryptoKey, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createCryptoKeyExceptionTest() - { - $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $cryptoKeyId = 'cryptoKeyId-2123094983'; - $cryptoKey = new CryptoKey(); - try { - $gapicClient->createCryptoKey($formattedParent, $cryptoKeyId, $cryptoKey); - // 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 createCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $importJob = 'importJob2125587491'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name); - $expectedResponse->setImportJob($importJob); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $cryptoKeyVersion = new CryptoKeyVersion(); - $response = $gapicClient->createCryptoKeyVersion($formattedParent, $cryptoKeyVersion); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/CreateCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getCryptoKeyVersion(); - $this->assertProtobufEquals($cryptoKeyVersion, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createCryptoKeyVersionExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $cryptoKeyVersion = new CryptoKeyVersion(); - try { - $gapicClient->createCryptoKeyVersion($formattedParent, $cryptoKeyVersion); - // 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 createImportJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new ImportJob(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $importJobId = 'importJobId-1620773193'; - $importJob = new ImportJob(); - $importJobImportMethod = ImportMethod::IMPORT_METHOD_UNSPECIFIED; - $importJob->setImportMethod($importJobImportMethod); - $importJobProtectionLevel = ProtectionLevel::PROTECTION_LEVEL_UNSPECIFIED; - $importJob->setProtectionLevel($importJobProtectionLevel); - $response = $gapicClient->createImportJob($formattedParent, $importJobId, $importJob); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/CreateImportJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getImportJobId(); - $this->assertProtobufEquals($importJobId, $actualValue); - $actualValue = $actualRequestObject->getImportJob(); - $this->assertProtobufEquals($importJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createImportJobExceptionTest() - { - $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $importJobId = 'importJobId-1620773193'; - $importJob = new ImportJob(); - $importJobImportMethod = ImportMethod::IMPORT_METHOD_UNSPECIFIED; - $importJob->setImportMethod($importJobImportMethod); - $importJobProtectionLevel = ProtectionLevel::PROTECTION_LEVEL_UNSPECIFIED; - $importJob->setProtectionLevel($importJobProtectionLevel); - try { - $gapicClient->createImportJob($formattedParent, $importJobId, $importJob); - // 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 createKeyRingTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new KeyRing(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $keyRingId = 'keyRingId-2056646742'; - $keyRing = new KeyRing(); - $response = $gapicClient->createKeyRing($formattedParent, $keyRingId, $keyRing); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/CreateKeyRing', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getKeyRingId(); - $this->assertProtobufEquals($keyRingId, $actualValue); - $actualValue = $actualRequestObject->getKeyRing(); - $this->assertProtobufEquals($keyRing, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createKeyRingExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $keyRingId = 'keyRingId-2056646742'; - $keyRing = new KeyRing(); - try { - $gapicClient->createKeyRing($formattedParent, $keyRingId, $keyRing); - // 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 decryptTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $plaintext = '-9'; - $usedPrimary = true; - $expectedResponse = new DecryptResponse(); - $expectedResponse->setPlaintext($plaintext); - $expectedResponse->setUsedPrimary($usedPrimary); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $ciphertext = '-72'; - $response = $gapicClient->decrypt($formattedName, $ciphertext); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/Decrypt', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getCiphertext(); - $this->assertProtobufEquals($ciphertext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function decryptExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $ciphertext = '-72'; - try { - $gapicClient->decrypt($formattedName, $ciphertext); - // 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 destroyCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $importJob = 'importJob2125587491'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name2); - $expectedResponse->setImportJob($importJob); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $response = $gapicClient->destroyCryptoKeyVersion($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.kms.v1.KeyManagementService/DestroyCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function destroyCryptoKeyVersionExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - try { - $gapicClient->destroyCryptoKeyVersion($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 encryptTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $ciphertext = '-72'; - $verifiedPlaintextCrc32c = false; - $verifiedAdditionalAuthenticatedDataCrc32c = true; - $expectedResponse = new EncryptResponse(); - $expectedResponse->setName($name2); - $expectedResponse->setCiphertext($ciphertext); - $expectedResponse->setVerifiedPlaintextCrc32c($verifiedPlaintextCrc32c); - $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $plaintext = '-9'; - $response = $gapicClient->encrypt($name, $plaintext); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/Encrypt', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getPlaintext(); - $this->assertProtobufEquals($plaintext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function encryptExceptionTest() - { - $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 - $name = 'name3373707'; - $plaintext = '-9'; - try { - $gapicClient->encrypt($name, $plaintext); - // 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 generateRandomBytesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $data = '-86'; - $expectedResponse = new GenerateRandomBytesResponse(); - $expectedResponse->setData($data); - $transport->addResponse($expectedResponse); - $response = $gapicClient->generateRandomBytes(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/GenerateRandomBytes', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateRandomBytesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->generateRandomBytes(); - // 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 getCryptoKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $importOnly = true; - $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; - $expectedResponse = new CryptoKey(); - $expectedResponse->setName($name2); - $expectedResponse->setImportOnly($importOnly); - $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $response = $gapicClient->getCryptoKey($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.kms.v1.KeyManagementService/GetCryptoKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCryptoKeyExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - try { - $gapicClient->getCryptoKey($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 getCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $importJob = 'importJob2125587491'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name2); - $expectedResponse->setImportJob($importJob); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $response = $gapicClient->getCryptoKeyVersion($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.kms.v1.KeyManagementService/GetCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getCryptoKeyVersionExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - try { - $gapicClient->getCryptoKeyVersion($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 getImportJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new ImportJob(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->importJobName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[IMPORT_JOB]'); - $response = $gapicClient->getImportJob($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.kms.v1.KeyManagementService/GetImportJob', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getImportJobExceptionTest() - { - $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->importJobName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[IMPORT_JOB]'); - try { - $gapicClient->getImportJob($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 getKeyRingTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new KeyRing(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $response = $gapicClient->getKeyRing($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.kms.v1.KeyManagementService/GetKeyRing', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getKeyRingExceptionTest() - { - $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - try { - $gapicClient->getKeyRing($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 getPublicKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $pem = 'pem110872'; - $name2 = 'name2-1052831874'; - $expectedResponse = new PublicKey(); - $expectedResponse->setPem($pem); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $response = $gapicClient->getPublicKey($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.kms.v1.KeyManagementService/GetPublicKey', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getPublicKeyExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - try { - $gapicClient->getPublicKey($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 importCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $importJob2 = 'importJob2-1714851050'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name); - $expectedResponse->setImportJob($importJob2); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; - $importJob = 'importJob2125587491'; - $response = $gapicClient->importCryptoKeyVersion($formattedParent, $algorithm, $importJob); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ImportCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getAlgorithm(); - $this->assertProtobufEquals($algorithm, $actualValue); - $actualValue = $actualRequestObject->getImportJob(); - $this->assertProtobufEquals($importJob, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function importCryptoKeyVersionExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $algorithm = CryptoKeyVersionAlgorithm::CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; - $importJob = 'importJob2125587491'; - try { - $gapicClient->importCryptoKeyVersion($formattedParent, $algorithm, $importJob); - // 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 listCryptoKeyVersionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $cryptoKeyVersionsElement = new CryptoKeyVersion(); - $cryptoKeyVersions = [ - $cryptoKeyVersionsElement, - ]; - $expectedResponse = new ListCryptoKeyVersionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setCryptoKeyVersions($cryptoKeyVersions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $response = $gapicClient->listCryptoKeyVersions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCryptoKeyVersions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListCryptoKeyVersions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCryptoKeyVersionsExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - try { - $gapicClient->listCryptoKeyVersions($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 listCryptoKeysTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $cryptoKeysElement = new CryptoKey(); - $cryptoKeys = [ - $cryptoKeysElement, - ]; - $expectedResponse = new ListCryptoKeysResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setCryptoKeys($cryptoKeys); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $response = $gapicClient->listCryptoKeys($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCryptoKeys()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListCryptoKeys', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCryptoKeysExceptionTest() - { - $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - try { - $gapicClient->listCryptoKeys($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 listImportJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $importJobsElement = new ImportJob(); - $importJobs = [ - $importJobsElement, - ]; - $expectedResponse = new ListImportJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setImportJobs($importJobs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - $response = $gapicClient->listImportJobs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getImportJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListImportJobs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listImportJobsExceptionTest() - { - $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->keyRingName('[PROJECT]', '[LOCATION]', '[KEY_RING]'); - try { - $gapicClient->listImportJobs($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 listKeyRingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $keyRingsElement = new KeyRing(); - $keyRings = [ - $keyRingsElement, - ]; - $expectedResponse = new ListKeyRingsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setKeyRings($keyRings); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listKeyRings($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getKeyRings()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/ListKeyRings', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listKeyRingsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listKeyRings($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 macSignTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $mac = '79'; - $verifiedDataCrc32c = true; - $expectedResponse = new MacSignResponse(); - $expectedResponse->setName($name2); - $expectedResponse->setMac($mac); - $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $data = '-86'; - $response = $gapicClient->macSign($formattedName, $data); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/MacSign', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getData(); - $this->assertProtobufEquals($data, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function macSignExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $data = '-86'; - try { - $gapicClient->macSign($formattedName, $data); - // 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 macVerifyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $success = false; - $verifiedDataCrc32c = true; - $verifiedMacCrc32c = false; - $verifiedSuccessIntegrity = true; - $expectedResponse = new MacVerifyResponse(); - $expectedResponse->setName($name2); - $expectedResponse->setSuccess($success); - $expectedResponse->setVerifiedDataCrc32c($verifiedDataCrc32c); - $expectedResponse->setVerifiedMacCrc32c($verifiedMacCrc32c); - $expectedResponse->setVerifiedSuccessIntegrity($verifiedSuccessIntegrity); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $data = '-86'; - $mac = '79'; - $response = $gapicClient->macVerify($formattedName, $data, $mac); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/MacVerify', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getData(); - $this->assertProtobufEquals($data, $actualValue); - $actualValue = $actualRequestObject->getMac(); - $this->assertProtobufEquals($mac, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function macVerifyExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $data = '-86'; - $mac = '79'; - try { - $gapicClient->macVerify($formattedName, $data, $mac); - // 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 rawDecryptTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $plaintext = '-9'; - $verifiedCiphertextCrc32c = true; - $verifiedAdditionalAuthenticatedDataCrc32c = true; - $verifiedInitializationVectorCrc32c = true; - $expectedResponse = new RawDecryptResponse(); - $expectedResponse->setPlaintext($plaintext); - $expectedResponse->setVerifiedCiphertextCrc32c($verifiedCiphertextCrc32c); - $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); - $expectedResponse->setVerifiedInitializationVectorCrc32c($verifiedInitializationVectorCrc32c); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $ciphertext = '-72'; - $initializationVector = '-62'; - $response = $gapicClient->rawDecrypt($name, $ciphertext, $initializationVector); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/RawDecrypt', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getCiphertext(); - $this->assertProtobufEquals($ciphertext, $actualValue); - $actualValue = $actualRequestObject->getInitializationVector(); - $this->assertProtobufEquals($initializationVector, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rawDecryptExceptionTest() - { - $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 - $name = 'name3373707'; - $ciphertext = '-72'; - $initializationVector = '-62'; - try { - $gapicClient->rawDecrypt($name, $ciphertext, $initializationVector); - // 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 rawEncryptTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $ciphertext = '-72'; - $initializationVector2 = '-11'; - $tagLength = 172791595; - $verifiedPlaintextCrc32c = false; - $verifiedAdditionalAuthenticatedDataCrc32c = true; - $verifiedInitializationVectorCrc32c = true; - $name2 = 'name2-1052831874'; - $expectedResponse = new RawEncryptResponse(); - $expectedResponse->setCiphertext($ciphertext); - $expectedResponse->setInitializationVector($initializationVector2); - $expectedResponse->setTagLength($tagLength); - $expectedResponse->setVerifiedPlaintextCrc32c($verifiedPlaintextCrc32c); - $expectedResponse->setVerifiedAdditionalAuthenticatedDataCrc32c($verifiedAdditionalAuthenticatedDataCrc32c); - $expectedResponse->setVerifiedInitializationVectorCrc32c($verifiedInitializationVectorCrc32c); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $plaintext = '-9'; - $response = $gapicClient->rawEncrypt($name, $plaintext); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/RawEncrypt', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getPlaintext(); - $this->assertProtobufEquals($plaintext, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rawEncryptExceptionTest() - { - $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 - $name = 'name3373707'; - $plaintext = '-9'; - try { - $gapicClient->rawEncrypt($name, $plaintext); - // 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 restoreCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $importJob = 'importJob2125587491'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name2); - $expectedResponse->setImportJob($importJob); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - $response = $gapicClient->restoreCryptoKeyVersion($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.kms.v1.KeyManagementService/RestoreCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function restoreCryptoKeyVersionExceptionTest() - { - $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->cryptoKeyVersionName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]'); - try { - $gapicClient->restoreCryptoKeyVersion($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 updateCryptoKeyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $importOnly = true; - $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; - $expectedResponse = new CryptoKey(); - $expectedResponse->setName($name); - $expectedResponse->setImportOnly($importOnly); - $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); - $transport->addResponse($expectedResponse); - // Mock request - $cryptoKey = new CryptoKey(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateCryptoKey($cryptoKey, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKey', $actualFuncCall); - $actualValue = $actualRequestObject->getCryptoKey(); - $this->assertProtobufEquals($cryptoKey, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateCryptoKeyExceptionTest() - { - $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 - $cryptoKey = new CryptoKey(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateCryptoKey($cryptoKey, $updateMask); - // 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 updateCryptoKeyPrimaryVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $importOnly = true; - $cryptoKeyBackend = 'cryptoKeyBackend-1526615498'; - $expectedResponse = new CryptoKey(); - $expectedResponse->setName($name2); - $expectedResponse->setImportOnly($importOnly); - $expectedResponse->setCryptoKeyBackend($cryptoKeyBackend); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $cryptoKeyVersionId = 'cryptoKeyVersionId729489152'; - $response = $gapicClient->updateCryptoKeyPrimaryVersion($formattedName, $cryptoKeyVersionId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKeyPrimaryVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getCryptoKeyVersionId(); - $this->assertProtobufEquals($cryptoKeyVersionId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateCryptoKeyPrimaryVersionExceptionTest() - { - $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->cryptoKeyName('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]'); - $cryptoKeyVersionId = 'cryptoKeyVersionId729489152'; - try { - $gapicClient->updateCryptoKeyPrimaryVersion($formattedName, $cryptoKeyVersionId); - // 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 updateCryptoKeyVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $importJob = 'importJob2125587491'; - $importFailureReason = 'importFailureReason-494073229'; - $generationFailureReason = 'generationFailureReason1749803168'; - $externalDestructionFailureReason = 'externalDestructionFailureReason-2122384710'; - $reimportEligible = true; - $expectedResponse = new CryptoKeyVersion(); - $expectedResponse->setName($name); - $expectedResponse->setImportJob($importJob); - $expectedResponse->setImportFailureReason($importFailureReason); - $expectedResponse->setGenerationFailureReason($generationFailureReason); - $expectedResponse->setExternalDestructionFailureReason($externalDestructionFailureReason); - $expectedResponse->setReimportEligible($reimportEligible); - $transport->addResponse($expectedResponse); - // Mock request - $cryptoKeyVersion = new CryptoKeyVersion(); - $updateMask = new FieldMask(); - $response = $gapicClient->updateCryptoKeyVersion($cryptoKeyVersion, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKeyVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getCryptoKeyVersion(); - $this->assertProtobufEquals($cryptoKeyVersion, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateCryptoKeyVersionExceptionTest() - { - $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 - $cryptoKeyVersion = new CryptoKeyVersion(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateCryptoKeyVersion($cryptoKeyVersion, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}