From 734dc5f91c3335869ab570231255cac26675fdc3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 11 Feb 2026 18:06:21 +0000 Subject: [PATCH 1/2] feat: Added DeleteCryptoKey and DeleteCryptoKeyVersion RPCs to permanently remove resources feat: Introduced the RetiredResource resource to track records of deleted keys and prevent the reuse of their resource names feat: Added ListRetiredResources and GetRetiredResource RPCs to manage and view these records PiperOrigin-RevId: 868670725 Source-Link: https://github.com/googleapis/googleapis/commit/f248ed087ef9b822834de74c962d9ba67bb737d3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/78b317216a961e10f426487f10972804912b85ec Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWttcy12MS8uT3dsQm90LnlhbWwiLCJoIjoiNzhiMzE3MjE2YTk2MWUxMGY0MjY0ODdmMTA5NzI4MDQ5MTJiODVlYyJ9 --- .../google-cloud-kms-v1/.gitignore | 22 + .../google-cloud-kms-v1/.repo-metadata.json | 18 + .../google-cloud-kms-v1/.rubocop.yml | 33 + owl-bot-staging/google-cloud-kms-v1/.toys.rb | 28 + owl-bot-staging/google-cloud-kms-v1/.yardopts | 12 + .../google-cloud-kms-v1/AUTHENTICATION.md | 122 + .../google-cloud-kms-v1/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-kms-v1/Gemfile | 11 + .../google-cloud-kms-v1/LICENSE.md | 201 + owl-bot-staging/google-cloud-kms-v1/README.md | 153 + owl-bot-staging/google-cloud-kms-v1/Rakefile | 169 + .../google-cloud-kms-v1/gapic_metadata.json | 329 ++ .../google-cloud-kms-v1.gemspec | 30 + .../lib/google-cloud-kms-v1.rb | 21 + .../lib/google/cloud/kms/v1.rb | 49 + .../lib/google/cloud/kms/v1/autokey.rb | 73 + .../lib/google/cloud/kms/v1/autokey/client.rb | 782 +++ .../cloud/kms/v1/autokey/credentials.rb | 52 + .../google/cloud/kms/v1/autokey/operations.rb | 841 +++ .../lib/google/cloud/kms/v1/autokey/paths.rb | 90 + .../lib/google/cloud/kms/v1/autokey/rest.rb | 71 + .../cloud/kms/v1/autokey/rest/client.rb | 727 +++ .../cloud/kms/v1/autokey/rest/operations.rb | 925 ++++ .../cloud/kms/v1/autokey/rest/service_stub.rb | 265 + .../lib/google/cloud/kms/v1/autokey_admin.rb | 62 + .../cloud/kms/v1/autokey_admin/client.rb | 727 +++ .../cloud/kms/v1/autokey_admin/credentials.rb | 52 + .../cloud/kms/v1/autokey_admin/paths.rb | 61 + .../google/cloud/kms/v1/autokey_admin/rest.rb | 60 + .../cloud/kms/v1/autokey_admin/rest/client.rb | 672 +++ .../kms/v1/autokey_admin/rest/service_stub.rb | 265 + .../google/cloud/kms/v1/autokey_admin_pb.rb | 54 + .../cloud/kms/v1/autokey_admin_services_pb.rb | 63 + .../lib/google/cloud/kms/v1/autokey_pb.rb | 53 + .../cloud/kms/v1/autokey_services_pb.rb | 72 + .../google/cloud/kms/v1/bindings_override.rb | 204 + .../lib/google/cloud/kms/v1/ekm_service.rb | 59 + .../google/cloud/kms/v1/ekm_service/client.rb | 1135 +++++ .../cloud/kms/v1/ekm_service/credentials.rb | 52 + .../google/cloud/kms/v1/ekm_service/paths.rb | 107 + .../google/cloud/kms/v1/ekm_service/rest.rb | 57 + .../cloud/kms/v1/ekm_service/rest/client.rb | 1052 ++++ .../kms/v1/ekm_service/rest/service_stub.rb | 511 ++ .../lib/google/cloud/kms/v1/ekm_service_pb.rb | 64 + .../cloud/kms/v1/ekm_service_services_pb.rb | 69 + .../lib/google/cloud/kms/v1/hsm_management.rb | 62 + .../cloud/kms/v1/hsm_management/client.rb | 1477 ++++++ .../kms/v1/hsm_management/credentials.rb | 52 + .../cloud/kms/v1/hsm_management/operations.rb | 841 +++ .../cloud/kms/v1/hsm_management/paths.rb | 90 + .../cloud/kms/v1/hsm_management/rest.rb | 60 + .../kms/v1/hsm_management/rest/client.rb | 1380 +++++ .../kms/v1/hsm_management/rest/operations.rb | 925 ++++ .../v1/hsm_management/rest/service_stub.rb | 634 +++ .../google/cloud/kms/v1/hsm_management_pb.rb | 86 + .../kms/v1/hsm_management_services_pb.rb | 91 + .../cloud/kms/v1/key_management_service.rb | 67 + .../kms/v1/key_management_service/client.rb | 4498 +++++++++++++++++ .../v1/key_management_service/credentials.rb | 52 + .../v1/key_management_service/operations.rb | 841 +++ .../kms/v1/key_management_service/paths.rb | 153 + .../kms/v1/key_management_service/rest.rb | 65 + .../v1/key_management_service/rest/client.rb | 4233 ++++++++++++++++ .../key_management_service/rest/operations.rb | 925 ++++ .../rest/service_stub.rb | 2114 ++++++++ .../lib/google/cloud/kms/v1/resources_pb.rb | 73 + .../lib/google/cloud/kms/v1/rest.rb | 42 + .../lib/google/cloud/kms/v1/service_pb.rb | 106 + .../cloud/kms/v1/service_services_pb.rb | 245 + .../lib/google/cloud/kms/v1/version.rb | 28 + .../google-cloud-kms-v1/proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../proto_docs/google/cloud/kms/v1/autokey.rb | 142 + .../google/cloud/kms/v1/autokey_admin.rb | 125 + .../google/cloud/kms/v1/ekm_service.rb | 351 ++ .../google/cloud/kms/v1/hsm_management.rb | 877 ++++ .../google/cloud/kms/v1/resources.rb | 1148 +++++ .../proto_docs/google/cloud/kms/v1/service.rb | 1907 +++++++ .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/protobuf/wrappers.rb | 121 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../google-cloud-kms-v1/snippets/Gemfile | 32 + .../snippets/autokey/create_key_handle.rb | 54 + .../snippets/autokey/get_key_handle.rb | 47 + .../snippets/autokey/list_key_handles.rb | 51 + .../autokey_admin/get_autokey_config.rb | 47 + .../show_effective_autokey_config.rb | 47 + .../autokey_admin/update_autokey_config.rb | 47 + .../ekm_service/create_ekm_connection.rb | 47 + .../snippets/ekm_service/get_ekm_config.rb | 47 + .../ekm_service/get_ekm_connection.rb | 47 + .../ekm_service/list_ekm_connections.rb | 51 + .../snippets/ekm_service/update_ekm_config.rb | 47 + .../ekm_service/update_ekm_connection.rb | 47 + .../ekm_service/verify_connectivity.rb | 47 + ...ove_single_tenant_hsm_instance_proposal.rb | 47 + .../create_single_tenant_hsm_instance.rb | 54 + ...ate_single_tenant_hsm_instance_proposal.rb | 54 + ...ete_single_tenant_hsm_instance_proposal.rb | 47 + ...ute_single_tenant_hsm_instance_proposal.rb | 54 + .../get_single_tenant_hsm_instance.rb | 47 + ...get_single_tenant_hsm_instance_proposal.rb | 47 + ...st_single_tenant_hsm_instance_proposals.rb | 51 + .../list_single_tenant_hsm_instances.rb | 51 + .../asymmetric_decrypt.rb | 47 + .../key_management_service/asymmetric_sign.rb | 47 + .../create_crypto_key.rb | 47 + .../create_crypto_key_version.rb | 47 + .../create_import_job.rb | 47 + .../key_management_service/create_key_ring.rb | 47 + .../key_management_service/decapsulate.rb | 47 + .../key_management_service/decrypt.rb | 47 + .../delete_crypto_key.rb | 54 + .../delete_crypto_key_version.rb | 54 + .../destroy_crypto_key_version.rb | 47 + .../key_management_service/encrypt.rb | 47 + .../generate_random_bytes.rb | 47 + .../key_management_service/get_crypto_key.rb | 47 + .../get_crypto_key_version.rb | 47 + .../key_management_service/get_import_job.rb | 47 + .../key_management_service/get_key_ring.rb | 47 + .../key_management_service/get_public_key.rb | 47 + .../get_retired_resource.rb | 47 + .../import_crypto_key_version.rb | 47 + .../list_crypto_key_versions.rb | 51 + .../list_crypto_keys.rb | 51 + .../list_import_jobs.rb | 51 + .../key_management_service/list_key_rings.rb | 51 + .../list_retired_resources.rb | 51 + .../key_management_service/mac_sign.rb | 47 + .../key_management_service/mac_verify.rb | 47 + .../key_management_service/raw_decrypt.rb | 47 + .../key_management_service/raw_encrypt.rb | 47 + .../restore_crypto_key_version.rb | 47 + .../update_crypto_key.rb | 47 + .../update_crypto_key_primary_version.rb | 47 + .../update_crypto_key_version.rb | 47 + .../snippet_metadata_google.cloud.kms.v1.json | 2215 ++++++++ .../cloud/kms/v1/autokey_admin_paths_test.rb | 67 + .../cloud/kms/v1/autokey_admin_rest_test.rb | 262 + .../google/cloud/kms/v1/autokey_admin_test.rb | 280 + .../cloud/kms/v1/autokey_operations_test.rb | 400 ++ .../google/cloud/kms/v1/autokey_paths_test.rb | 79 + .../google/cloud/kms/v1/autokey_rest_test.rb | 266 + .../test/google/cloud/kms/v1/autokey_test.rb | 312 ++ .../cloud/kms/v1/ekm_service_paths_test.rb | 91 + .../cloud/kms/v1/ekm_service_rest_test.rb | 485 ++ .../google/cloud/kms/v1/ekm_service_test.rb | 531 ++ .../kms/v1/hsm_management_operations_test.rb | 400 ++ .../cloud/kms/v1/hsm_management_paths_test.rb | 79 + .../cloud/kms/v1/hsm_management_rest_test.rb | 600 +++ .../cloud/kms/v1/hsm_management_test.rb | 696 +++ .../key_management_service_operations_test.rb | 400 ++ .../v1/key_management_service_paths_test.rb | 115 + .../v1/key_management_service_rest_test.rb | 1955 +++++++ .../kms/v1/key_management_service_test.rb | 2216 ++++++++ .../google-cloud-kms-v1/test/helper.rb | 25 + 166 files changed, 50264 insertions(+) create mode 100644 owl-bot-staging/google-cloud-kms-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-kms-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-kms-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-kms-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-kms-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-kms-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-kms-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-kms-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-kms-v1/README.md create mode 100644 owl-bot-staging/google-cloud-kms-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-kms-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-kms-v1/google-cloud-kms-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google-cloud-kms-v1.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/client.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/credentials.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/operations.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/paths.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/client.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/credentials.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/paths.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_pb.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_pb.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/client.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/credentials.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/operations.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/paths.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_pb.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey_admin.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/ekm_service.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/hsm_management.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey/create_key_handle.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey/get_key_handle.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey/list_key_handles.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/get_autokey_config.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/show_effective_autokey_config.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/update_autokey_config.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_config.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_config.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/verify_connectivity.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/approve_single_tenant_hsm_instance_proposal.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance_proposal.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/delete_single_tenant_hsm_instance_proposal.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/execute_single_tenant_hsm_instance_proposal.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance_proposal.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instance_proposals.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instances.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decapsulate.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key_version.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_retired_resource.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_retired_resources.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_decrypt.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_encrypt.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb create mode 100644 owl-bot-staging/google-cloud-kms-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-kms-v1/.gitignore b/owl-bot-staging/google-cloud-kms-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-kms-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-kms-v1/.repo-metadata.json new file mode 100644 index 000000000000..d4b8f3bbfab4 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudkms.googleapis.com", + "api_shortname": "cloudkms", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-kms-v1/latest", + "distribution_name": "google-cloud-kms-v1", + "is_cloud": true, + "language": "ruby", + "name": "cloudkms", + "name_pretty": "Cloud Key Management Service (KMS) V1 API", + "product_documentation": "https://cloud.google.com/kms", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications. Note that google-cloud-kms-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-kms instead. See the readme for more details.", + "ruby-cloud-env-prefix": "KMS", + "ruby-cloud-product-url": "https://cloud.google.com/kms", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-kms-v1/.rubocop.yml b/owl-bot-staging/google-cloud-kms-v1/.rubocop.yml new file mode 100644 index 000000000000..7508e22a5467 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-kms-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-kms-v1.rb" diff --git a/owl-bot-staging/google-cloud-kms-v1/.toys.rb b/owl-bot-staging/google-cloud-kms-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-kms-v1/.yardopts b/owl-bot-staging/google-cloud-kms-v1/.yardopts new file mode 100644 index 000000000000..732be9f951a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Key Management Service (KMS) V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-kms-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-kms-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..8dc26289ab3d --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-kms-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-kms-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/kms/v1" + +client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/kms/v1" + +::Google::Cloud::Kms::V1::Autokey::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Kms::V1::Autokey::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-kms-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/kms/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Kms::V1::Autokey::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-kms-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-kms-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-kms-v1/Gemfile b/owl-bot-staging/google-cloud-kms-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-kms-v1/LICENSE.md b/owl-bot-staging/google-cloud-kms-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-kms-v1/README.md b/owl-bot-staging/google-cloud-kms-v1/README.md new file mode 100644 index 000000000000..a0be04ec409f --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Cloud Key Management Service (KMS) V1 API + +Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Cloud Key Management Service (KMS) V1 API. Most users should consider using +the main client gem, +[google-cloud-kms](https://rubygems.org/gems/google-cloud-kms). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-kms-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudkms.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/kms/v1" + +client = ::Google::Cloud::Kms::V1::Autokey::Client.new +request = ::Google::Cloud::Kms::V1::CreateKeyHandleRequest.new # (request fields as keyword arguments...) +response = client.create_key_handle request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-kms-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/kms) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/kms/v1" +require "logger" + +client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-kms`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-kms-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-kms`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-kms-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-kms-v1/Rakefile b/owl-bot-staging/google-cloud-kms-v1/Rakefile new file mode 100644 index 000000000000..74ec35fdc9bc --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-kms-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["KMS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["KMS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["KMS_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or KMS_TEST_PROJECT=test123 KMS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/kms/v1/autokey/credentials" + ::Google::Cloud::Kms::V1::Autokey::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["KMS_PROJECT"] = project + ENV["KMS_TEST_PROJECT"] = project + ENV["KMS_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-kms-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-kms-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-kms-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-kms-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-kms-v1" + header "google-cloud-kms-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-kms-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-kms-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-kms-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-kms-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-kms-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-kms-v1/gapic_metadata.json new file mode 100644 index 000000000000..ea6d2abb953b --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/gapic_metadata.json @@ -0,0 +1,329 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.kms.v1", + "libraryPackage": "::Google::Cloud::Kms::V1", + "services": { + "Autokey": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Kms::V1::Autokey::Client", + "rpcs": { + "CreateKeyHandle": { + "methods": [ + "create_key_handle" + ] + }, + "GetKeyHandle": { + "methods": [ + "get_key_handle" + ] + }, + "ListKeyHandles": { + "methods": [ + "list_key_handles" + ] + } + } + } + } + }, + "AutokeyAdmin": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client", + "rpcs": { + "UpdateAutokeyConfig": { + "methods": [ + "update_autokey_config" + ] + }, + "GetAutokeyConfig": { + "methods": [ + "get_autokey_config" + ] + }, + "ShowEffectiveAutokeyConfig": { + "methods": [ + "show_effective_autokey_config" + ] + } + } + } + } + }, + "EkmService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Kms::V1::EkmService::Client", + "rpcs": { + "ListEkmConnections": { + "methods": [ + "list_ekm_connections" + ] + }, + "GetEkmConnection": { + "methods": [ + "get_ekm_connection" + ] + }, + "CreateEkmConnection": { + "methods": [ + "create_ekm_connection" + ] + }, + "UpdateEkmConnection": { + "methods": [ + "update_ekm_connection" + ] + }, + "GetEkmConfig": { + "methods": [ + "get_ekm_config" + ] + }, + "UpdateEkmConfig": { + "methods": [ + "update_ekm_config" + ] + }, + "VerifyConnectivity": { + "methods": [ + "verify_connectivity" + ] + } + } + } + } + }, + "HsmManagement": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Kms::V1::HsmManagement::Client", + "rpcs": { + "ListSingleTenantHsmInstances": { + "methods": [ + "list_single_tenant_hsm_instances" + ] + }, + "GetSingleTenantHsmInstance": { + "methods": [ + "get_single_tenant_hsm_instance" + ] + }, + "CreateSingleTenantHsmInstance": { + "methods": [ + "create_single_tenant_hsm_instance" + ] + }, + "CreateSingleTenantHsmInstanceProposal": { + "methods": [ + "create_single_tenant_hsm_instance_proposal" + ] + }, + "ApproveSingleTenantHsmInstanceProposal": { + "methods": [ + "approve_single_tenant_hsm_instance_proposal" + ] + }, + "ExecuteSingleTenantHsmInstanceProposal": { + "methods": [ + "execute_single_tenant_hsm_instance_proposal" + ] + }, + "GetSingleTenantHsmInstanceProposal": { + "methods": [ + "get_single_tenant_hsm_instance_proposal" + ] + }, + "ListSingleTenantHsmInstanceProposals": { + "methods": [ + "list_single_tenant_hsm_instance_proposals" + ] + }, + "DeleteSingleTenantHsmInstanceProposal": { + "methods": [ + "delete_single_tenant_hsm_instance_proposal" + ] + } + } + } + } + }, + "KeyManagementService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Kms::V1::KeyManagementService::Client", + "rpcs": { + "ListKeyRings": { + "methods": [ + "list_key_rings" + ] + }, + "ListCryptoKeys": { + "methods": [ + "list_crypto_keys" + ] + }, + "ListCryptoKeyVersions": { + "methods": [ + "list_crypto_key_versions" + ] + }, + "ListImportJobs": { + "methods": [ + "list_import_jobs" + ] + }, + "ListRetiredResources": { + "methods": [ + "list_retired_resources" + ] + }, + "GetKeyRing": { + "methods": [ + "get_key_ring" + ] + }, + "GetCryptoKey": { + "methods": [ + "get_crypto_key" + ] + }, + "GetCryptoKeyVersion": { + "methods": [ + "get_crypto_key_version" + ] + }, + "GetPublicKey": { + "methods": [ + "get_public_key" + ] + }, + "GetImportJob": { + "methods": [ + "get_import_job" + ] + }, + "GetRetiredResource": { + "methods": [ + "get_retired_resource" + ] + }, + "CreateKeyRing": { + "methods": [ + "create_key_ring" + ] + }, + "CreateCryptoKey": { + "methods": [ + "create_crypto_key" + ] + }, + "CreateCryptoKeyVersion": { + "methods": [ + "create_crypto_key_version" + ] + }, + "DeleteCryptoKey": { + "methods": [ + "delete_crypto_key" + ] + }, + "DeleteCryptoKeyVersion": { + "methods": [ + "delete_crypto_key_version" + ] + }, + "ImportCryptoKeyVersion": { + "methods": [ + "import_crypto_key_version" + ] + }, + "CreateImportJob": { + "methods": [ + "create_import_job" + ] + }, + "UpdateCryptoKey": { + "methods": [ + "update_crypto_key" + ] + }, + "UpdateCryptoKeyVersion": { + "methods": [ + "update_crypto_key_version" + ] + }, + "UpdateCryptoKeyPrimaryVersion": { + "methods": [ + "update_crypto_key_primary_version" + ] + }, + "DestroyCryptoKeyVersion": { + "methods": [ + "destroy_crypto_key_version" + ] + }, + "RestoreCryptoKeyVersion": { + "methods": [ + "restore_crypto_key_version" + ] + }, + "Encrypt": { + "methods": [ + "encrypt" + ] + }, + "Decrypt": { + "methods": [ + "decrypt" + ] + }, + "RawEncrypt": { + "methods": [ + "raw_encrypt" + ] + }, + "RawDecrypt": { + "methods": [ + "raw_decrypt" + ] + }, + "AsymmetricSign": { + "methods": [ + "asymmetric_sign" + ] + }, + "AsymmetricDecrypt": { + "methods": [ + "asymmetric_decrypt" + ] + }, + "MacSign": { + "methods": [ + "mac_sign" + ] + }, + "MacVerify": { + "methods": [ + "mac_verify" + ] + }, + "Decapsulate": { + "methods": [ + "decapsulate" + ] + }, + "GenerateRandomBytes": { + "methods": [ + "generate_random_bytes" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-kms-v1/google-cloud-kms-v1.gemspec b/owl-bot-staging/google-cloud-kms-v1/google-cloud-kms-v1.gemspec new file mode 100644 index 000000000000..d06423433584 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/google-cloud-kms-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/kms/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-kms-v1" + gem.version = Google::Cloud::Kms::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications. Note that google-cloud-kms-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-kms instead. See the readme for more details." + gem.summary = "Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "google-iam-v1", "~> 1.3" +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google-cloud-kms-v1.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google-cloud-kms-v1.rb new file mode 100644 index 000000000000..b5a53b03e81a --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google-cloud-kms-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/kms/v1" diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1.rb new file mode 100644 index 000000000000..1f600fafd863 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/kms/v1/autokey" +require "google/cloud/kms/v1/autokey_admin" +require "google/cloud/kms/v1/ekm_service" +require "google/cloud/kms/v1/hsm_management" +require "google/cloud/kms/v1/key_management_service" +require "google/cloud/kms/v1/version" + +module Google + module Cloud + module Kms + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/kms/v1" + # client = ::Google::Cloud::Kms::V1::Autokey::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/kms/v1" + # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/kms/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey.rb new file mode 100644 index 000000000000..dfeee69aef4f --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/kms/v1/version" + +require "google/cloud/kms/v1/autokey/credentials" +require "google/cloud/kms/v1/autokey/paths" +require "google/cloud/kms/v1/autokey/operations" +require "google/cloud/kms/v1/autokey/client" +require "google/cloud/kms/v1/autokey/rest" + +module Google + module Cloud + module Kms + module V1 + ## + # Provides interfaces for using [Cloud KMS + # Autokey](https://cloud.google.com/kms/help/autokey) to provision new + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer Managed + # Encryption Key (CMEK) use, on-demand. To support certain client tooling, this + # feature is modeled around a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} + # resource: creating a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in a resource + # project and given location triggers Cloud KMS Autokey to provision a + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the configured key project and + # the same location. + # + # Prior to use in a given resource project, + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config UpdateAutokeyConfig} + # should have been called on an ancestor folder, setting the key project where + # Cloud KMS Autokey should create new + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. See documentation for additional + # prerequisites. To check what key project, if any, is currently configured on + # a resource project's ancestor folder, see + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/kms/v1/autokey" + # client = ::Google::Cloud::Kms::V1::Autokey::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/kms/v1/autokey/rest" + # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new + # + module Autokey + end + end + end + end +end + +helper_path = ::File.join __dir__, "autokey", "helpers.rb" +require "google/cloud/kms/v1/autokey/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/client.rb new file mode 100644 index 000000000000..ff375568d05e --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/client.rb @@ -0,0 +1,782 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/kms/v1/autokey_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module Kms + module V1 + module Autokey + ## + # Client for the Autokey service. + # + # Provides interfaces for using [Cloud KMS + # Autokey](https://cloud.google.com/kms/help/autokey) to provision new + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer Managed + # Encryption Key (CMEK) use, on-demand. To support certain client tooling, this + # feature is modeled around a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} + # resource: creating a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in a resource + # project and given location triggers Cloud KMS Autokey to provision a + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the configured key project and + # the same location. + # + # Prior to use in a given resource project, + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config UpdateAutokeyConfig} + # should have been called on an ancestor folder, setting the key project where + # Cloud KMS Autokey should create new + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. See documentation for additional + # prerequisites. To check what key project, if any, is currently configured on + # a resource project's ancestor folder, see + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :autokey_stub + + ## + # Configure the Autokey Client class. + # + # See {::Google::Cloud::Kms::V1::Autokey::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Autokey clients + # ::Google::Cloud::Kms::V1::Autokey::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Kms", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_key_handle.timeout = 60.0 + + default_config.rpcs.get_key_handle.timeout = 60.0 + default_config.rpcs.get_key_handle.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_key_handles.timeout = 60.0 + default_config.rpcs.list_key_handles.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Autokey Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Kms::V1::Autokey::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @autokey_stub.universe_domain + end + + ## + # Create a new Autokey client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Kms::V1::Autokey::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Autokey client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/kms/v1/autokey_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @autokey_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Kms::V1::Autokey::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @autokey_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @autokey_stub.endpoint + config.universe_domain = @autokey_stub.universe_domain + config.logger = @autokey_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @autokey_stub.endpoint + config.universe_domain = @autokey_stub.universe_domain + config.logger = @autokey_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Kms::V1::Autokey::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @autokey_stub.logger + end + + # Service calls + + ## + # Creates a new {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}, triggering the + # provisioning of a new {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} for CMEK + # use with the given resource type in the configured key project and the same + # location. GetOperation should + # be used to resolve the resulting long-running operation and get the + # resulting {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} and + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload create_key_handle(request, options = nil) + # Pass arguments to `create_key_handle` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateKeyHandleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateKeyHandleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_key_handle(parent: nil, key_handle_id: nil, key_handle: nil) + # Pass arguments to `create_key_handle` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the resource project and location to create the + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in, e.g. + # `projects/{PROJECT_ID}/locations/{LOCATION}`. + # @param key_handle_id [::String] + # Optional. Id of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}. Must be + # unique to the resource project and location. If not provided by the caller, + # a new UUID is used. + # @param key_handle [::Google::Cloud::Kms::V1::KeyHandle, ::Hash] + # Required. {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::Autokey::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateKeyHandleRequest.new + # + # # Call the create_key_handle method. + # result = client.create_key_handle request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_key_handle request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateKeyHandleRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_key_handle.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_key_handle.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_key_handle.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_stub.call_rpc :create_key_handle, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}. + # + # @overload get_key_handle(request, options = nil) + # Pass arguments to `get_key_handle` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetKeyHandleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetKeyHandleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_key_handle(name: nil) + # Pass arguments to `get_key_handle` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} resource, + # e.g. + # `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::KeyHandle] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::KeyHandle] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::Autokey::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetKeyHandleRequest.new + # + # # Call the get_key_handle method. + # result = client.get_key_handle request + # + # # The returned object is of type Google::Cloud::Kms::V1::KeyHandle. + # p result + # + def get_key_handle request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetKeyHandleRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_key_handle.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_key_handle.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_key_handle.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_stub.call_rpc :get_key_handle, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}. + # + # @overload list_key_handles(request, options = nil) + # Pass arguments to `list_key_handles` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListKeyHandlesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListKeyHandlesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_key_handles(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_key_handles` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the resource project and location from which to list + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. + # `projects/{PROJECT_ID}/locations/{LOCATION}`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} to include in the response. The + # service may return fewer than this value. Further + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} can subsequently be obtained by + # including the + # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token} + # in a subsequent request. If unspecified, at most 100 + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} will be returned. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token}. + # @param filter [::String] + # Optional. Filter to apply when listing + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. + # `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::KeyHandle>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::KeyHandle>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::Autokey::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListKeyHandlesRequest.new + # + # # Call the list_key_handles method. + # result = client.list_key_handles request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::KeyHandle. + # p item + # end + # + def list_key_handles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListKeyHandlesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_key_handles.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_key_handles.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_key_handles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_stub.call_rpc :list_key_handles, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @autokey_stub, :list_key_handles, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Autokey API. + # + # This class represents the configuration for Autokey, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Kms::V1::Autokey::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_key_handle to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Kms::V1::Autokey::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_key_handle.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_key_handle.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Autokey API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_key_handle` + # @return [::Gapic::Config::Method] + # + attr_reader :create_key_handle + ## + # RPC-specific configuration for `get_key_handle` + # @return [::Gapic::Config::Method] + # + attr_reader :get_key_handle + ## + # RPC-specific configuration for `list_key_handles` + # @return [::Gapic::Config::Method] + # + attr_reader :list_key_handles + + # @private + def initialize parent_rpcs = nil + create_key_handle_config = parent_rpcs.create_key_handle if parent_rpcs.respond_to? :create_key_handle + @create_key_handle = ::Gapic::Config::Method.new create_key_handle_config + get_key_handle_config = parent_rpcs.get_key_handle if parent_rpcs.respond_to? :get_key_handle + @get_key_handle = ::Gapic::Config::Method.new get_key_handle_config + list_key_handles_config = parent_rpcs.list_key_handles if parent_rpcs.respond_to? :list_key_handles + @list_key_handles = ::Gapic::Config::Method.new list_key_handles_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/credentials.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/credentials.rb new file mode 100644 index 000000000000..ccc21283af92 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Kms + module V1 + module Autokey + # Credentials for the Autokey API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + self.env_vars = [ + "KMS_CREDENTIALS", + "KMS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "KMS_CREDENTIALS_JSON", + "KMS_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/operations.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/operations.rb new file mode 100644 index 000000000000..00d39d6e60f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Kms + module V1 + module Autokey + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Autokey Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the Autokey Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/paths.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/paths.rb new file mode 100644 index 000000000000..c003a9763469 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/paths.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + module Autokey + # Path helper methods for the Autokey API. + module Paths + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified KeyHandle resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyHandles/{key_handle}` + # + # @param project [String] + # @param location [String] + # @param key_handle [String] + # + # @return [::String] + def key_handle_path project:, location:, key_handle: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyHandles/#{key_handle}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest.rb new file mode 100644 index 000000000000..9bd8b68c5498 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/kms/v1/version" +require "google/cloud/kms/v1/bindings_override" + +require "google/cloud/kms/v1/autokey/credentials" +require "google/cloud/kms/v1/autokey/paths" +require "google/cloud/kms/v1/autokey/rest/operations" +require "google/cloud/kms/v1/autokey/rest/client" + +module Google + module Cloud + module Kms + module V1 + ## + # Provides interfaces for using [Cloud KMS + # Autokey](https://cloud.google.com/kms/help/autokey) to provision new + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer Managed + # Encryption Key (CMEK) use, on-demand. To support certain client tooling, this + # feature is modeled around a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} + # resource: creating a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in a resource + # project and given location triggers Cloud KMS Autokey to provision a + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the configured key project and + # the same location. + # + # Prior to use in a given resource project, + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config UpdateAutokeyConfig} + # should have been called on an ancestor folder, setting the key project where + # Cloud KMS Autokey should create new + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. See documentation for additional + # prerequisites. To check what key project, if any, is currently configured on + # a resource project's ancestor folder, see + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/kms/v1/autokey/rest" + # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new + # + module Autokey + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/kms/v1/autokey/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/client.rb new file mode 100644 index 000000000000..224f33b3ac5e --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/client.rb @@ -0,0 +1,727 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/kms/v1/autokey_pb" +require "google/cloud/kms/v1/autokey/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module Kms + module V1 + module Autokey + module Rest + ## + # REST client for the Autokey service. + # + # Provides interfaces for using [Cloud KMS + # Autokey](https://cloud.google.com/kms/help/autokey) to provision new + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer Managed + # Encryption Key (CMEK) use, on-demand. To support certain client tooling, this + # feature is modeled around a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} + # resource: creating a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in a resource + # project and given location triggers Cloud KMS Autokey to provision a + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the configured key project and + # the same location. + # + # Prior to use in a given resource project, + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client#update_autokey_config UpdateAutokeyConfig} + # should have been called on an ancestor folder, setting the key project where + # Cloud KMS Autokey should create new + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. See documentation for additional + # prerequisites. To check what key project, if any, is currently configured on + # a resource project's ancestor folder, see + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :autokey_stub + + ## + # Configure the Autokey Client class. + # + # See {::Google::Cloud::Kms::V1::Autokey::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Autokey clients + # ::Google::Cloud::Kms::V1::Autokey::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Kms", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_key_handle.timeout = 60.0 + + default_config.rpcs.get_key_handle.timeout = 60.0 + default_config.rpcs.get_key_handle.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_key_handles.timeout = 60.0 + default_config.rpcs.list_key_handles.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Autokey Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Kms::V1::Autokey::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @autokey_stub.universe_domain + end + + ## + # Create a new Autokey REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Autokey client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Kms::V1::Autokey::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @autokey_stub = ::Google::Cloud::Kms::V1::Autokey::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @autokey_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @autokey_stub.endpoint + config.universe_domain = @autokey_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @autokey_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @autokey_stub.endpoint + config.universe_domain = @autokey_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @autokey_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Kms::V1::Autokey::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @autokey_stub.logger + end + + # Service calls + + ## + # Creates a new {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}, triggering the + # provisioning of a new {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} for CMEK + # use with the given resource type in the configured key project and the same + # location. GetOperation should + # be used to resolve the resulting long-running operation and get the + # resulting {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} and + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload create_key_handle(request, options = nil) + # Pass arguments to `create_key_handle` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateKeyHandleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateKeyHandleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_key_handle(parent: nil, key_handle_id: nil, key_handle: nil) + # Pass arguments to `create_key_handle` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the resource project and location to create the + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in, e.g. + # `projects/{PROJECT_ID}/locations/{LOCATION}`. + # @param key_handle_id [::String] + # Optional. Id of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}. Must be + # unique to the resource project and location. If not provided by the caller, + # a new UUID is used. + # @param key_handle [::Google::Cloud::Kms::V1::KeyHandle, ::Hash] + # Required. {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::Autokey::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateKeyHandleRequest.new + # + # # Call the create_key_handle method. + # result = client.create_key_handle request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_key_handle request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateKeyHandleRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_key_handle.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_key_handle.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_key_handle.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_stub.create_key_handle request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}. + # + # @overload get_key_handle(request, options = nil) + # Pass arguments to `get_key_handle` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetKeyHandleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetKeyHandleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_key_handle(name: nil) + # Pass arguments to `get_key_handle` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} resource, + # e.g. + # `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::KeyHandle] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::KeyHandle] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::Autokey::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetKeyHandleRequest.new + # + # # Call the get_key_handle method. + # result = client.get_key_handle request + # + # # The returned object is of type Google::Cloud::Kms::V1::KeyHandle. + # p result + # + def get_key_handle request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetKeyHandleRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_key_handle.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_key_handle.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_key_handle.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_stub.get_key_handle request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}. + # + # @overload list_key_handles(request, options = nil) + # Pass arguments to `list_key_handles` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListKeyHandlesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListKeyHandlesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_key_handles(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_key_handles` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the resource project and location from which to list + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. + # `projects/{PROJECT_ID}/locations/{LOCATION}`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} to include in the response. The + # service may return fewer than this value. Further + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} can subsequently be obtained by + # including the + # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token} + # in a subsequent request. If unspecified, at most 100 + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} will be returned. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token}. + # @param filter [::String] + # Optional. Filter to apply when listing + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. + # `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyHandle>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyHandle>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::Autokey::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListKeyHandlesRequest.new + # + # # Call the list_key_handles method. + # result = client.list_key_handles request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::KeyHandle. + # p item + # end + # + def list_key_handles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListKeyHandlesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_key_handles.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_key_handles.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_key_handles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_stub.list_key_handles request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @autokey_stub, :list_key_handles, "key_handles", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Autokey REST API. + # + # This class represents the configuration for Autokey REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Kms::V1::Autokey::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_key_handle to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Kms::V1::Autokey::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_key_handle.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_key_handle.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Autokey API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_key_handle` + # @return [::Gapic::Config::Method] + # + attr_reader :create_key_handle + ## + # RPC-specific configuration for `get_key_handle` + # @return [::Gapic::Config::Method] + # + attr_reader :get_key_handle + ## + # RPC-specific configuration for `list_key_handles` + # @return [::Gapic::Config::Method] + # + attr_reader :list_key_handles + + # @private + def initialize parent_rpcs = nil + create_key_handle_config = parent_rpcs.create_key_handle if parent_rpcs.respond_to? :create_key_handle + @create_key_handle = ::Gapic::Config::Method.new create_key_handle_config + get_key_handle_config = parent_rpcs.get_key_handle if parent_rpcs.respond_to? :get_key_handle + @get_key_handle = ::Gapic::Config::Method.new get_key_handle_config + list_key_handles_config = parent_rpcs.list_key_handles if parent_rpcs.respond_to? :list_key_handles + @list_key_handles = ::Gapic::Config::Method.new list_key_handles_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/operations.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/operations.rb new file mode 100644 index 000000000000..c1f85cd9d4ea --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Kms + module V1 + module Autokey + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Autokey Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the Autokey Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/service_stub.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/service_stub.rb new file mode 100644 index 000000000000..7c6b2eb2a2bd --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/service_stub.rb @@ -0,0 +1,265 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/kms/v1/autokey_pb" + +module Google + module Cloud + module Kms + module V1 + module Autokey + module Rest + ## + # REST service stub for the Autokey service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_key_handle REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateKeyHandleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_key_handle request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_key_handle_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_key_handle", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_key_handle REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetKeyHandleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::KeyHandle] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::KeyHandle] + # A result object deserialized from the server's reply + def get_key_handle request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_key_handle_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_key_handle", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::KeyHandle.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_key_handles REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListKeyHandlesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ListKeyHandlesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ListKeyHandlesResponse] + # A result object deserialized from the server's reply + def list_key_handles request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_key_handles_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_key_handles", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ListKeyHandlesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_key_handle REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateKeyHandleRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_key_handle_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/keyHandles", + body: "key_handle", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_key_handle REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetKeyHandleRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_key_handle_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyHandles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_key_handles REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListKeyHandlesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_key_handles_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/keyHandles", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin.rb new file mode 100644 index 000000000000..45bdc8bdd205 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/kms/v1/version" + +require "google/cloud/kms/v1/autokey_admin/credentials" +require "google/cloud/kms/v1/autokey_admin/paths" +require "google/cloud/kms/v1/autokey_admin/client" +require "google/cloud/kms/v1/autokey_admin/rest" + +module Google + module Cloud + module Kms + module V1 + ## + # Provides interfaces for managing [Cloud KMS + # Autokey](https://cloud.google.com/kms/help/autokey) folder-level + # configurations. A configuration is inherited by all descendent projects. A + # configuration at one folder overrides any other configurations in its + # ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS + # Autokey, so that users working in a descendant project can request + # provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer + # Managed Encryption Key (CMEK) use, on-demand. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/kms/v1/autokey_admin" + # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/kms/v1/autokey_admin/rest" + # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new + # + module AutokeyAdmin + end + end + end + end +end + +helper_path = ::File.join __dir__, "autokey_admin", "helpers.rb" +require "google/cloud/kms/v1/autokey_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/client.rb new file mode 100644 index 000000000000..ccd0510f171b --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/client.rb @@ -0,0 +1,727 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/kms/v1/autokey_admin_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module Kms + module V1 + module AutokeyAdmin + ## + # Client for the AutokeyAdmin service. + # + # Provides interfaces for managing [Cloud KMS + # Autokey](https://cloud.google.com/kms/help/autokey) folder-level + # configurations. A configuration is inherited by all descendent projects. A + # configuration at one folder overrides any other configurations in its + # ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS + # Autokey, so that users working in a descendant project can request + # provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer + # Managed Encryption Key (CMEK) use, on-demand. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :autokey_admin_stub + + ## + # Configure the AutokeyAdmin Client class. + # + # See {::Google::Cloud::Kms::V1::AutokeyAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AutokeyAdmin clients + # ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Kms", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.update_autokey_config.timeout = 60.0 + default_config.rpcs.update_autokey_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_autokey_config.timeout = 60.0 + default_config.rpcs.get_autokey_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.show_effective_autokey_config.timeout = 60.0 + default_config.rpcs.show_effective_autokey_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AutokeyAdmin Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Kms::V1::AutokeyAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @autokey_admin_stub.universe_domain + end + + ## + # Create a new AutokeyAdmin client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AutokeyAdmin client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/kms/v1/autokey_admin_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @autokey_admin_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Kms::V1::AutokeyAdmin::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @autokey_admin_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @autokey_admin_stub.endpoint + config.universe_domain = @autokey_admin_stub.universe_domain + config.logger = @autokey_admin_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @autokey_admin_stub.endpoint + config.universe_domain = @autokey_admin_stub.universe_domain + config.logger = @autokey_admin_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @autokey_admin_stub.logger + end + + # Service calls + + ## + # Updates the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a + # folder. The caller must have both `cloudkms.autokeyConfigs.update` + # permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` + # permission on the provided key project. A + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} creation in the folder's + # descendant projects will use this configuration to determine where to + # create the resulting {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload update_autokey_config(request, options = nil) + # Pass arguments to `update_autokey_config` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_autokey_config(autokey_config: nil, update_mask: nil) + # Pass arguments to `update_autokey_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param autokey_config [::Google::Cloud::Kms::V1::AutokeyConfig, ::Hash] + # Required. {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} with values to + # update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Masks which fields of the + # {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} to update, e.g. + # `keyProject`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::AutokeyConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::AutokeyConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new + # + # # Call the update_autokey_config method. + # result = client.update_autokey_config request + # + # # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. + # p result + # + def update_autokey_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_autokey_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.autokey_config&.name + header_params["autokey_config.name"] = request.autokey_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_autokey_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_autokey_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_admin_stub.call_rpc :update_autokey_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a + # folder. + # + # @overload get_autokey_config(request, options = nil) + # Pass arguments to `get_autokey_config` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetAutokeyConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetAutokeyConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_autokey_config(name: nil) + # Pass arguments to `get_autokey_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} + # resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::AutokeyConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::AutokeyConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new + # + # # Call the get_autokey_config method. + # result = client.get_autokey_config request + # + # # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. + # p result + # + def get_autokey_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_autokey_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_autokey_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_autokey_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_admin_stub.call_rpc :get_autokey_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the effective Cloud KMS Autokey configuration for a given project. + # + # @overload show_effective_autokey_config(request, options = nil) + # Pass arguments to `show_effective_autokey_config` via a request object, either of type + # {::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload show_effective_autokey_config(parent: nil) + # Pass arguments to `show_effective_autokey_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the resource project to the show effective Cloud KMS + # Autokey configuration for. This may be helpful for interrogating the effect + # of nested folder configurations on a given resource project. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new + # + # # Call the show_effective_autokey_config method. + # result = client.show_effective_autokey_config request + # + # # The returned object is of type Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse. + # p result + # + def show_effective_autokey_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.show_effective_autokey_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.show_effective_autokey_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.show_effective_autokey_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_admin_stub.call_rpc :show_effective_autokey_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the AutokeyAdmin API. + # + # This class represents the configuration for AutokeyAdmin, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # update_autokey_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.update_autokey_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.update_autokey_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AutokeyAdmin API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `update_autokey_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_autokey_config + ## + # RPC-specific configuration for `get_autokey_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_autokey_config + ## + # RPC-specific configuration for `show_effective_autokey_config` + # @return [::Gapic::Config::Method] + # + attr_reader :show_effective_autokey_config + + # @private + def initialize parent_rpcs = nil + update_autokey_config_config = parent_rpcs.update_autokey_config if parent_rpcs.respond_to? :update_autokey_config + @update_autokey_config = ::Gapic::Config::Method.new update_autokey_config_config + get_autokey_config_config = parent_rpcs.get_autokey_config if parent_rpcs.respond_to? :get_autokey_config + @get_autokey_config = ::Gapic::Config::Method.new get_autokey_config_config + show_effective_autokey_config_config = parent_rpcs.show_effective_autokey_config if parent_rpcs.respond_to? :show_effective_autokey_config + @show_effective_autokey_config = ::Gapic::Config::Method.new show_effective_autokey_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/credentials.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/credentials.rb new file mode 100644 index 000000000000..3abc17b0de30 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Kms + module V1 + module AutokeyAdmin + # Credentials for the AutokeyAdmin API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + self.env_vars = [ + "KMS_CREDENTIALS", + "KMS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "KMS_CREDENTIALS_JSON", + "KMS_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/paths.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/paths.rb new file mode 100644 index 000000000000..dda918e24dfb --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/paths.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + module AutokeyAdmin + # Path helper methods for the AutokeyAdmin API. + module Paths + ## + # Create a fully-qualified AutokeyConfig resource string. + # + # The resource will be in the following format: + # + # `folders/{folder}/autokeyConfig` + # + # @param folder [String] + # + # @return [::String] + def autokey_config_path folder: + "folders/#{folder}/autokeyConfig" + end + + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest.rb new file mode 100644 index 000000000000..0c3a78fbdad6 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/kms/v1/version" +require "google/cloud/kms/v1/bindings_override" + +require "google/cloud/kms/v1/autokey_admin/credentials" +require "google/cloud/kms/v1/autokey_admin/paths" +require "google/cloud/kms/v1/autokey_admin/rest/client" + +module Google + module Cloud + module Kms + module V1 + ## + # Provides interfaces for managing [Cloud KMS + # Autokey](https://cloud.google.com/kms/help/autokey) folder-level + # configurations. A configuration is inherited by all descendent projects. A + # configuration at one folder overrides any other configurations in its + # ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS + # Autokey, so that users working in a descendant project can request + # provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer + # Managed Encryption Key (CMEK) use, on-demand. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/kms/v1/autokey_admin/rest" + # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new + # + module AutokeyAdmin + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/kms/v1/autokey_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/client.rb new file mode 100644 index 000000000000..328bb34b6385 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/client.rb @@ -0,0 +1,672 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/kms/v1/autokey_admin_pb" +require "google/cloud/kms/v1/autokey_admin/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module Kms + module V1 + module AutokeyAdmin + module Rest + ## + # REST client for the AutokeyAdmin service. + # + # Provides interfaces for managing [Cloud KMS + # Autokey](https://cloud.google.com/kms/help/autokey) folder-level + # configurations. A configuration is inherited by all descendent projects. A + # configuration at one folder overrides any other configurations in its + # ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS + # Autokey, so that users working in a descendant project can request + # provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer + # Managed Encryption Key (CMEK) use, on-demand. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :autokey_admin_stub + + ## + # Configure the AutokeyAdmin Client class. + # + # See {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AutokeyAdmin clients + # ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Kms", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.update_autokey_config.timeout = 60.0 + default_config.rpcs.update_autokey_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_autokey_config.timeout = 60.0 + default_config.rpcs.get_autokey_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.show_effective_autokey_config.timeout = 60.0 + default_config.rpcs.show_effective_autokey_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AutokeyAdmin Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @autokey_admin_stub.universe_domain + end + + ## + # Create a new AutokeyAdmin REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AutokeyAdmin client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @autokey_admin_stub = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @autokey_admin_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @autokey_admin_stub.endpoint + config.universe_domain = @autokey_admin_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @autokey_admin_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @autokey_admin_stub.endpoint + config.universe_domain = @autokey_admin_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @autokey_admin_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @autokey_admin_stub.logger + end + + # Service calls + + ## + # Updates the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a + # folder. The caller must have both `cloudkms.autokeyConfigs.update` + # permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` + # permission on the provided key project. A + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} creation in the folder's + # descendant projects will use this configuration to determine where to + # create the resulting {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload update_autokey_config(request, options = nil) + # Pass arguments to `update_autokey_config` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_autokey_config(autokey_config: nil, update_mask: nil) + # Pass arguments to `update_autokey_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param autokey_config [::Google::Cloud::Kms::V1::AutokeyConfig, ::Hash] + # Required. {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} with values to + # update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Masks which fields of the + # {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} to update, e.g. + # `keyProject`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::AutokeyConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::AutokeyConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new + # + # # Call the update_autokey_config method. + # result = client.update_autokey_config request + # + # # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. + # p result + # + def update_autokey_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_autokey_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_autokey_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_autokey_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_admin_stub.update_autokey_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a + # folder. + # + # @overload get_autokey_config(request, options = nil) + # Pass arguments to `get_autokey_config` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetAutokeyConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetAutokeyConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_autokey_config(name: nil) + # Pass arguments to `get_autokey_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} + # resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::AutokeyConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::AutokeyConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new + # + # # Call the get_autokey_config method. + # result = client.get_autokey_config request + # + # # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. + # p result + # + def get_autokey_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_autokey_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_autokey_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_autokey_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_admin_stub.get_autokey_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the effective Cloud KMS Autokey configuration for a given project. + # + # @overload show_effective_autokey_config(request, options = nil) + # Pass arguments to `show_effective_autokey_config` via a request object, either of type + # {::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload show_effective_autokey_config(parent: nil) + # Pass arguments to `show_effective_autokey_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the resource project to the show effective Cloud KMS + # Autokey configuration for. This may be helpful for interrogating the effect + # of nested folder configurations on a given resource project. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new + # + # # Call the show_effective_autokey_config method. + # result = client.show_effective_autokey_config request + # + # # The returned object is of type Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse. + # p result + # + def show_effective_autokey_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.show_effective_autokey_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.show_effective_autokey_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.show_effective_autokey_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autokey_admin_stub.show_effective_autokey_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the AutokeyAdmin REST API. + # + # This class represents the configuration for AutokeyAdmin REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # update_autokey_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.update_autokey_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.update_autokey_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the AutokeyAdmin API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `update_autokey_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_autokey_config + ## + # RPC-specific configuration for `get_autokey_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_autokey_config + ## + # RPC-specific configuration for `show_effective_autokey_config` + # @return [::Gapic::Config::Method] + # + attr_reader :show_effective_autokey_config + + # @private + def initialize parent_rpcs = nil + update_autokey_config_config = parent_rpcs.update_autokey_config if parent_rpcs.respond_to? :update_autokey_config + @update_autokey_config = ::Gapic::Config::Method.new update_autokey_config_config + get_autokey_config_config = parent_rpcs.get_autokey_config if parent_rpcs.respond_to? :get_autokey_config + @get_autokey_config = ::Gapic::Config::Method.new get_autokey_config_config + show_effective_autokey_config_config = parent_rpcs.show_effective_autokey_config if parent_rpcs.respond_to? :show_effective_autokey_config + @show_effective_autokey_config = ::Gapic::Config::Method.new show_effective_autokey_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/service_stub.rb new file mode 100644 index 000000000000..39ee0ffcfee9 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/service_stub.rb @@ -0,0 +1,265 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/kms/v1/autokey_admin_pb" + +module Google + module Cloud + module Kms + module V1 + module AutokeyAdmin + module Rest + ## + # REST service stub for the AutokeyAdmin service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the update_autokey_config REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::AutokeyConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::AutokeyConfig] + # A result object deserialized from the server's reply + def update_autokey_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_autokey_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_autokey_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::AutokeyConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_autokey_config REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetAutokeyConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::AutokeyConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::AutokeyConfig] + # A result object deserialized from the server's reply + def get_autokey_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_autokey_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_autokey_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::AutokeyConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the show_effective_autokey_config REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] + # A result object deserialized from the server's reply + def show_effective_autokey_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_show_effective_autokey_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "show_effective_autokey_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the update_autokey_config REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_autokey_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{autokey_config.name}", + body: "autokey_config", + matches: [ + ["autokey_config.name", %r{^folders/[^/]+/autokeyConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_autokey_config REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetAutokeyConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_autokey_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/autokeyConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the show_effective_autokey_config REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_show_effective_autokey_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}:showEffectiveAutokeyConfig", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_pb.rb new file mode 100644 index 000000000000..a0206e2b0b5b --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/kms/v1/autokey_admin.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n\'google/cloud/kms/v1/autokey_admin.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\x93\x01\n\x1aUpdateAutokeyConfigRequest\x12?\n\x0e\x61utokey_config\x18\x01 \x01(\x0b\x32\".google.cloud.kms.v1.AutokeyConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"V\n\x17GetAutokeyConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%cloudkms.googleapis.com/AutokeyConfig\"\xd0\x02\n\rAutokeyConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x0bkey_project\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12<\n\x05state\x18\x04 \x01(\x0e\x32(.google.cloud.kms.v1.AutokeyConfig.StateB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x01\"V\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x17\n\x13KEY_PROJECT_DELETED\x10\x02\x12\x11\n\rUNINITIALIZED\x10\x03:i\xea\x41\x66\n%cloudkms.googleapis.com/AutokeyConfig\x12\x1e\x66olders/{folder}/autokeyConfig*\x0e\x61utokeyConfigs2\rautokeyConfig\"h\n!ShowEffectiveAutokeyConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\"9\n\"ShowEffectiveAutokeyConfigResponse\x12\x13\n\x0bkey_project\x18\x01 \x01(\t2\xc8\x05\n\x0c\x41utokeyAdmin\x12\xd2\x01\n\x13UpdateAutokeyConfig\x12/.google.cloud.kms.v1.UpdateAutokeyConfigRequest\x1a\".google.cloud.kms.v1.AutokeyConfig\"f\xda\x41\x1a\x61utokey_config,update_mask\x82\xd3\xe4\x93\x02\x43\x32\x31/v1/{autokey_config.name=folders/*/autokeyConfig}:\x0e\x61utokey_config\x12\x97\x01\n\x10GetAutokeyConfig\x12,.google.cloud.kms.v1.GetAutokeyConfigRequest\x1a\".google.cloud.kms.v1.AutokeyConfig\"1\xda\x41\x04name\x82\xd3\xe4\x93\x02$\x12\"/v1/{name=folders/*/autokeyConfig}\x12\xd2\x01\n\x1aShowEffectiveAutokeyConfig\x12\x36.google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest\x1a\x37.google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*}:showEffectiveAutokeyConfig\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsBY\n\x17\x63om.google.cloud.kms.v1B\x11\x41utokeyAdminProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Kms + module V1 + UpdateAutokeyConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateAutokeyConfigRequest").msgclass + GetAutokeyConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetAutokeyConfigRequest").msgclass + AutokeyConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AutokeyConfig").msgclass + AutokeyConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AutokeyConfig.State").enummodule + ShowEffectiveAutokeyConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest").msgclass + ShowEffectiveAutokeyConfigResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_services_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_services_pb.rb new file mode 100644 index 000000000000..69def3e1b391 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_services_pb.rb @@ -0,0 +1,63 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/kms/v1/autokey_admin.proto for package 'google.cloud.kms.v1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/kms/v1/autokey_admin_pb' + +module Google + module Cloud + module Kms + module V1 + module AutokeyAdmin + # Provides interfaces for managing [Cloud KMS + # Autokey](https://cloud.google.com/kms/help/autokey) folder-level + # configurations. A configuration is inherited by all descendent projects. A + # configuration at one folder overrides any other configurations in its + # ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS + # Autokey, so that users working in a descendant project can request + # provisioned [CryptoKeys][google.cloud.kms.v1.CryptoKey], ready for Customer + # Managed Encryption Key (CMEK) use, on-demand. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.kms.v1.AutokeyAdmin' + + # Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a + # folder. The caller must have both `cloudkms.autokeyConfigs.update` + # permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` + # permission on the provided key project. A + # [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's + # descendant projects will use this configuration to determine where to + # create the resulting [CryptoKey][google.cloud.kms.v1.CryptoKey]. + rpc :UpdateAutokeyConfig, ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest, ::Google::Cloud::Kms::V1::AutokeyConfig + # Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a + # folder. + rpc :GetAutokeyConfig, ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest, ::Google::Cloud::Kms::V1::AutokeyConfig + # Returns the effective Cloud KMS Autokey configuration for a given project. + rpc :ShowEffectiveAutokeyConfig, ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest, ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_pb.rb new file mode 100644 index 000000000000..e7436313253e --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/kms/v1/autokey.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' + + +descriptor_data = "\n!google/cloud/kms/v1/autokey.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\"\xa8\x01\n\x16\x43reateKeyHandleRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x1a\n\rkey_handle_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x37\n\nkey_handle\x18\x03 \x01(\x0b\x32\x1e.google.cloud.kms.v1.KeyHandleB\x03\xe0\x41\x02\"N\n\x13GetKeyHandleRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/KeyHandle\"\xff\x01\n\tKeyHandle\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12:\n\x07kms_key\x18\x03 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12#\n\x16resource_type_selector\x18\x04 \x01(\tB\x03\xe0\x41\x02:~\xea\x41{\n!cloudkms.googleapis.com/KeyHandle\x12?projects/{project}/locations/{location}/keyHandles/{key_handle}*\nkeyHandles2\tkeyHandle\"\x19\n\x17\x43reateKeyHandleMetadata\"\x98\x01\n\x15ListKeyHandlesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"f\n\x16ListKeyHandlesResponse\x12\x33\n\x0bkey_handles\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.KeyHandle\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xb4\x05\n\x07\x41utokey\x12\xeb\x01\n\x0f\x43reateKeyHandle\x12+.google.cloud.kms.v1.CreateKeyHandleRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41$\n\tKeyHandle\x12\x17\x43reateKeyHandleMetadata\xda\x41\x1fparent,key_handle,key_handle_id\x82\xd3\xe4\x93\x02<\"./v1/{parent=projects/*/locations/*}/keyHandles:\nkey_handle\x12\x97\x01\n\x0cGetKeyHandle\x12(.google.cloud.kms.v1.GetKeyHandleRequest\x1a\x1e.google.cloud.kms.v1.KeyHandle\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/keyHandles/*}\x12\xaa\x01\n\x0eListKeyHandles\x12*.google.cloud.kms.v1.ListKeyHandlesRequest\x1a+.google.cloud.kms.v1.ListKeyHandlesResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/keyHandles\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsBT\n\x17\x63om.google.cloud.kms.v1B\x0c\x41utokeyProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Kms + module V1 + CreateKeyHandleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateKeyHandleRequest").msgclass + GetKeyHandleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetKeyHandleRequest").msgclass + KeyHandle = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyHandle").msgclass + CreateKeyHandleMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateKeyHandleMetadata").msgclass + ListKeyHandlesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListKeyHandlesRequest").msgclass + ListKeyHandlesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListKeyHandlesResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_services_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_services_pb.rb new file mode 100644 index 000000000000..ea3c5fa78db4 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_services_pb.rb @@ -0,0 +1,72 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/kms/v1/autokey.proto for package 'google.cloud.kms.v1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/kms/v1/autokey_pb' + +module Google + module Cloud + module Kms + module V1 + module Autokey + # Provides interfaces for using [Cloud KMS + # Autokey](https://cloud.google.com/kms/help/autokey) to provision new + # [CryptoKeys][google.cloud.kms.v1.CryptoKey], ready for Customer Managed + # Encryption Key (CMEK) use, on-demand. To support certain client tooling, this + # feature is modeled around a [KeyHandle][google.cloud.kms.v1.KeyHandle] + # resource: creating a [KeyHandle][google.cloud.kms.v1.KeyHandle] in a resource + # project and given location triggers Cloud KMS Autokey to provision a + # [CryptoKey][google.cloud.kms.v1.CryptoKey] in the configured key project and + # the same location. + # + # Prior to use in a given resource project, + # [UpdateAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig] + # should have been called on an ancestor folder, setting the key project where + # Cloud KMS Autokey should create new + # [CryptoKeys][google.cloud.kms.v1.CryptoKey]. See documentation for additional + # prerequisites. To check what key project, if any, is currently configured on + # a resource project's ancestor folder, see + # [ShowEffectiveAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.ShowEffectiveAutokeyConfig]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.kms.v1.Autokey' + + # Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the + # provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK + # use with the given resource type in the configured key project and the same + # location. [GetOperation][google.longrunning.Operations.GetOperation] should + # be used to resolve the resulting long-running operation and get the + # resulting [KeyHandle][google.cloud.kms.v1.KeyHandle] and + # [CryptoKey][google.cloud.kms.v1.CryptoKey]. + rpc :CreateKeyHandle, ::Google::Cloud::Kms::V1::CreateKeyHandleRequest, ::Google::Longrunning::Operation + # Returns the [KeyHandle][google.cloud.kms.v1.KeyHandle]. + rpc :GetKeyHandle, ::Google::Cloud::Kms::V1::GetKeyHandleRequest, ::Google::Cloud::Kms::V1::KeyHandle + # Lists [KeyHandles][google.cloud.kms.v1.KeyHandle]. + rpc :ListKeyHandles, ::Google::Cloud::Kms::V1::ListKeyHandlesRequest, ::Google::Cloud::Kms::V1::ListKeyHandlesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/bindings_override.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/bindings_override.rb new file mode 100644 index 000000000000..c2fbb5e8bbe9 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/bindings_override.rb @@ -0,0 +1,204 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module Kms + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/kms/v1/rest" + # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Kms"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/importJobs/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/importJobs/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/importJobs/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service.rb new file mode 100644 index 000000000000..1c6057f40df4 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/kms/v1/version" + +require "google/cloud/kms/v1/ekm_service/credentials" +require "google/cloud/kms/v1/ekm_service/paths" +require "google/cloud/kms/v1/ekm_service/client" +require "google/cloud/kms/v1/ekm_service/rest" + +module Google + module Cloud + module Kms + module V1 + ## + # Google Cloud Key Management EKM Service + # + # Manages external cryptographic keys and operations using those keys. + # Implements a REST model with the following objects: + # * {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/kms/v1/ekm_service" + # client = ::Google::Cloud::Kms::V1::EkmService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/kms/v1/ekm_service/rest" + # client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new + # + module EkmService + end + end + end + end +end + +helper_path = ::File.join __dir__, "ekm_service", "helpers.rb" +require "google/cloud/kms/v1/ekm_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb new file mode 100644 index 000000000000..42b2a512abe5 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb @@ -0,0 +1,1135 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/kms/v1/ekm_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module Kms + module V1 + module EkmService + ## + # Client for the EkmService service. + # + # Google Cloud Key Management EKM Service + # + # Manages external cryptographic keys and operations using those keys. + # Implements a REST model with the following objects: + # * {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ekm_service_stub + + ## + # Configure the EkmService Client class. + # + # See {::Google::Cloud::Kms::V1::EkmService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EkmService clients + # ::Google::Cloud::Kms::V1::EkmService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Kms", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_ekm_connections.timeout = 60.0 + default_config.rpcs.list_ekm_connections.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_ekm_connection.timeout = 60.0 + default_config.rpcs.get_ekm_connection.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_ekm_connection.timeout = 60.0 + default_config.rpcs.create_ekm_connection.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_ekm_connection.timeout = 60.0 + default_config.rpcs.update_ekm_connection.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EkmService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Kms::V1::EkmService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ekm_service_stub.universe_domain + end + + ## + # Create a new EkmService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Kms::V1::EkmService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EkmService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/kms/v1/ekm_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ekm_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Kms::V1::EkmService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @ekm_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @ekm_service_stub.endpoint + config.universe_domain = @ekm_service_stub.universe_domain + config.logger = @ekm_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @ekm_service_stub.endpoint + config.universe_domain = @ekm_service_stub.universe_domain + config.logger = @ekm_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @ekm_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::Kms::V1::EkmConnection EkmConnections}. + # + # @overload list_ekm_connections(request, options = nil) + # Pass arguments to `list_ekm_connections` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListEkmConnectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListEkmConnectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_ekm_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_ekm_connections` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to list, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to include in the + # response. Further {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} can + # subsequently be obtained by including the + # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token}. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new + # + # # Call the list_ekm_connections method. + # result = client.list_ekm_connections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::EkmConnection. + # p item + # end + # + def list_ekm_connections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_ekm_connections.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_ekm_connections.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_ekm_connections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.call_rpc :list_ekm_connections, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @ekm_service_stub, :list_ekm_connections, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. + # + # @overload get_ekm_connection(request, options = nil) + # Pass arguments to `get_ekm_connection` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetEkmConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetEkmConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_ekm_connection(name: nil) + # Pass arguments to `get_ekm_connection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::EkmConnection] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::EkmConnection] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetEkmConnectionRequest.new + # + # # Call the get_ekm_connection method. + # result = client.get_ekm_connection request + # + # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + # p result + # + def get_ekm_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetEkmConnectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_ekm_connection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_ekm_connection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_ekm_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.call_rpc :get_ekm_connection, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} in a given + # Project and Location. + # + # @overload create_ekm_connection(request, options = nil) + # Pass arguments to `create_ekm_connection` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateEkmConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateEkmConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_ekm_connection(parent: nil, ekm_connection_id: nil, ekm_connection: nil) + # Pass arguments to `create_ekm_connection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}, in the format + # `projects/*/locations/*`. + # @param ekm_connection_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. + # @param ekm_connection [::Google::Cloud::Kms::V1::EkmConnection, ::Hash] + # Required. An {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with + # initial field values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::EkmConnection] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::EkmConnection] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new + # + # # Call the create_ekm_connection method. + # result = client.create_ekm_connection request + # + # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + # p result + # + def create_ekm_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_ekm_connection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_ekm_connection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_ekm_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.call_rpc :create_ekm_connection, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}'s metadata. + # + # @overload update_ekm_connection(request, options = nil) + # Pass arguments to `update_ekm_connection` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_ekm_connection(ekm_connection: nil, update_mask: nil) + # Pass arguments to `update_ekm_connection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param ekm_connection [::Google::Cloud::Kms::V1::EkmConnection, ::Hash] + # Required. {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with updated + # values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::EkmConnection] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::EkmConnection] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new + # + # # Call the update_ekm_connection method. + # result = client.update_ekm_connection request + # + # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + # p result + # + def update_ekm_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_ekm_connection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.ekm_connection&.name + header_params["ekm_connection.name"] = request.ekm_connection.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_ekm_connection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_ekm_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.call_rpc :update_ekm_connection, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} singleton resource + # for a given project and location. + # + # @overload get_ekm_config(request, options = nil) + # Pass arguments to `get_ekm_config` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetEkmConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetEkmConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_ekm_config(name: nil) + # Pass arguments to `get_ekm_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::EkmConfig#name name} of the + # {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::EkmConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::EkmConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetEkmConfigRequest.new + # + # # Call the get_ekm_config method. + # result = client.get_ekm_config request + # + # # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. + # p result + # + def get_ekm_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetEkmConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_ekm_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_ekm_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_ekm_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.call_rpc :get_ekm_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} singleton resource + # for a given project and location. + # + # @overload update_ekm_config(request, options = nil) + # Pass arguments to `update_ekm_config` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateEkmConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateEkmConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_ekm_config(ekm_config: nil, update_mask: nil) + # Pass arguments to `update_ekm_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param ekm_config [::Google::Cloud::Kms::V1::EkmConfig, ::Hash] + # Required. {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::EkmConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::EkmConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new + # + # # Call the update_ekm_config method. + # result = client.update_ekm_config request + # + # # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. + # p result + # + def update_ekm_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_ekm_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.ekm_config&.name + header_params["ekm_config.name"] = request.ekm_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_ekm_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_ekm_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.call_rpc :update_ekm_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Verifies that Cloud KMS can successfully connect to the external key + # manager specified by an {::Google::Cloud::Kms::V1::EkmConnection 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. + # + # @overload verify_connectivity(request, options = nil) + # Pass arguments to `verify_connectivity` via a request object, either of type + # {::Google::Cloud::Kms::V1::VerifyConnectivityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::VerifyConnectivityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload verify_connectivity(name: nil) + # Pass arguments to `verify_connectivity` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to verify. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::VerifyConnectivityRequest.new + # + # # Call the verify_connectivity method. + # result = client.verify_connectivity request + # + # # The returned object is of type Google::Cloud::Kms::V1::VerifyConnectivityResponse. + # p result + # + def verify_connectivity request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::VerifyConnectivityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.verify_connectivity.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.verify_connectivity.timeout, + metadata: metadata, + retry_policy: @config.rpcs.verify_connectivity.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.call_rpc :verify_connectivity, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the EkmService API. + # + # This class represents the configuration for EkmService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Kms::V1::EkmService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_ekm_connections to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Kms::V1::EkmService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_ekm_connections.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_ekm_connections.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the EkmService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_ekm_connections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_ekm_connections + ## + # RPC-specific configuration for `get_ekm_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_ekm_connection + ## + # RPC-specific configuration for `create_ekm_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :create_ekm_connection + ## + # RPC-specific configuration for `update_ekm_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :update_ekm_connection + ## + # RPC-specific configuration for `get_ekm_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_ekm_config + ## + # RPC-specific configuration for `update_ekm_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_ekm_config + ## + # RPC-specific configuration for `verify_connectivity` + # @return [::Gapic::Config::Method] + # + attr_reader :verify_connectivity + + # @private + def initialize parent_rpcs = nil + list_ekm_connections_config = parent_rpcs.list_ekm_connections if parent_rpcs.respond_to? :list_ekm_connections + @list_ekm_connections = ::Gapic::Config::Method.new list_ekm_connections_config + get_ekm_connection_config = parent_rpcs.get_ekm_connection if parent_rpcs.respond_to? :get_ekm_connection + @get_ekm_connection = ::Gapic::Config::Method.new get_ekm_connection_config + create_ekm_connection_config = parent_rpcs.create_ekm_connection if parent_rpcs.respond_to? :create_ekm_connection + @create_ekm_connection = ::Gapic::Config::Method.new create_ekm_connection_config + update_ekm_connection_config = parent_rpcs.update_ekm_connection if parent_rpcs.respond_to? :update_ekm_connection + @update_ekm_connection = ::Gapic::Config::Method.new update_ekm_connection_config + get_ekm_config_config = parent_rpcs.get_ekm_config if parent_rpcs.respond_to? :get_ekm_config + @get_ekm_config = ::Gapic::Config::Method.new get_ekm_config_config + update_ekm_config_config = parent_rpcs.update_ekm_config if parent_rpcs.respond_to? :update_ekm_config + @update_ekm_config = ::Gapic::Config::Method.new update_ekm_config_config + verify_connectivity_config = parent_rpcs.verify_connectivity if parent_rpcs.respond_to? :verify_connectivity + @verify_connectivity = ::Gapic::Config::Method.new verify_connectivity_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/credentials.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/credentials.rb new file mode 100644 index 000000000000..f7ad3e219c05 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Kms + module V1 + module EkmService + # Credentials for the EkmService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + self.env_vars = [ + "KMS_CREDENTIALS", + "KMS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "KMS_CREDENTIALS_JSON", + "KMS_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/paths.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/paths.rb new file mode 100644 index 000000000000..de7196b5df1d --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/paths.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + module EkmService + # Path helper methods for the EkmService API. + module Paths + ## + # Create a fully-qualified EkmConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/ekmConfig` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def ekm_config_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/ekmConfig" + end + + ## + # Create a fully-qualified EkmConnection resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/ekmConnections/{ekm_connection}` + # + # @param project [String] + # @param location [String] + # @param ekm_connection [String] + # + # @return [::String] + def ekm_connection_path project:, location:, ekm_connection: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/ekmConnections/#{ekm_connection}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Service resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` + # + # @param project [String] + # @param location [String] + # @param namespace [String] + # @param service [String] + # + # @return [::String] + def service_path project:, location:, namespace:, service: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" + + "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest.rb new file mode 100644 index 000000000000..c7b2d679ce67 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/kms/v1/version" +require "google/cloud/kms/v1/bindings_override" + +require "google/cloud/kms/v1/ekm_service/credentials" +require "google/cloud/kms/v1/ekm_service/paths" +require "google/cloud/kms/v1/ekm_service/rest/client" + +module Google + module Cloud + module Kms + module V1 + ## + # Google Cloud Key Management EKM Service + # + # Manages external cryptographic keys and operations using those keys. + # Implements a REST model with the following objects: + # * {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/kms/v1/ekm_service/rest" + # client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new + # + module EkmService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/kms/v1/ekm_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb new file mode 100644 index 000000000000..961ea4ed64e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb @@ -0,0 +1,1052 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/kms/v1/ekm_service_pb" +require "google/cloud/kms/v1/ekm_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module Kms + module V1 + module EkmService + module Rest + ## + # REST client for the EkmService service. + # + # Google Cloud Key Management EKM Service + # + # Manages external cryptographic keys and operations using those keys. + # Implements a REST model with the following objects: + # * {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :ekm_service_stub + + ## + # Configure the EkmService Client class. + # + # See {::Google::Cloud::Kms::V1::EkmService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EkmService clients + # ::Google::Cloud::Kms::V1::EkmService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Kms", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_ekm_connections.timeout = 60.0 + default_config.rpcs.list_ekm_connections.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_ekm_connection.timeout = 60.0 + default_config.rpcs.get_ekm_connection.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_ekm_connection.timeout = 60.0 + default_config.rpcs.create_ekm_connection.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_ekm_connection.timeout = 60.0 + default_config.rpcs.update_ekm_connection.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EkmService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Kms::V1::EkmService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @ekm_service_stub.universe_domain + end + + ## + # Create a new EkmService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EkmService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @ekm_service_stub = ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @ekm_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @ekm_service_stub.endpoint + config.universe_domain = @ekm_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @ekm_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @ekm_service_stub.endpoint + config.universe_domain = @ekm_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @ekm_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @ekm_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::Kms::V1::EkmConnection EkmConnections}. + # + # @overload list_ekm_connections(request, options = nil) + # Pass arguments to `list_ekm_connections` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListEkmConnectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListEkmConnectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_ekm_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_ekm_connections` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to list, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to include in the + # response. Further {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} can + # subsequently be obtained by including the + # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token}. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new + # + # # Call the list_ekm_connections method. + # result = client.list_ekm_connections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::EkmConnection. + # p item + # end + # + def list_ekm_connections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_ekm_connections.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_ekm_connections.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_ekm_connections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.list_ekm_connections request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @ekm_service_stub, :list_ekm_connections, "ekm_connections", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. + # + # @overload get_ekm_connection(request, options = nil) + # Pass arguments to `get_ekm_connection` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetEkmConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetEkmConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_ekm_connection(name: nil) + # Pass arguments to `get_ekm_connection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EkmConnection] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetEkmConnectionRequest.new + # + # # Call the get_ekm_connection method. + # result = client.get_ekm_connection request + # + # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + # p result + # + def get_ekm_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetEkmConnectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_ekm_connection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_ekm_connection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_ekm_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.get_ekm_connection request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} in a given + # Project and Location. + # + # @overload create_ekm_connection(request, options = nil) + # Pass arguments to `create_ekm_connection` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateEkmConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateEkmConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_ekm_connection(parent: nil, ekm_connection_id: nil, ekm_connection: nil) + # Pass arguments to `create_ekm_connection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}, in the format + # `projects/*/locations/*`. + # @param ekm_connection_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. + # @param ekm_connection [::Google::Cloud::Kms::V1::EkmConnection, ::Hash] + # Required. An {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with + # initial field values. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EkmConnection] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new + # + # # Call the create_ekm_connection method. + # result = client.create_ekm_connection request + # + # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + # p result + # + def create_ekm_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_ekm_connection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_ekm_connection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_ekm_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.create_ekm_connection request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}'s metadata. + # + # @overload update_ekm_connection(request, options = nil) + # Pass arguments to `update_ekm_connection` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_ekm_connection(ekm_connection: nil, update_mask: nil) + # Pass arguments to `update_ekm_connection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param ekm_connection [::Google::Cloud::Kms::V1::EkmConnection, ::Hash] + # Required. {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with updated + # values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EkmConnection] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new + # + # # Call the update_ekm_connection method. + # result = client.update_ekm_connection request + # + # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + # p result + # + def update_ekm_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_ekm_connection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_ekm_connection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_ekm_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.update_ekm_connection request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} singleton resource + # for a given project and location. + # + # @overload get_ekm_config(request, options = nil) + # Pass arguments to `get_ekm_config` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetEkmConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetEkmConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_ekm_config(name: nil) + # Pass arguments to `get_ekm_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::EkmConfig#name name} of the + # {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EkmConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EkmConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetEkmConfigRequest.new + # + # # Call the get_ekm_config method. + # result = client.get_ekm_config request + # + # # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. + # p result + # + def get_ekm_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetEkmConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_ekm_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_ekm_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_ekm_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.get_ekm_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} singleton resource + # for a given project and location. + # + # @overload update_ekm_config(request, options = nil) + # Pass arguments to `update_ekm_config` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateEkmConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateEkmConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_ekm_config(ekm_config: nil, update_mask: nil) + # Pass arguments to `update_ekm_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param ekm_config [::Google::Cloud::Kms::V1::EkmConfig, ::Hash] + # Required. {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EkmConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EkmConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new + # + # # Call the update_ekm_config method. + # result = client.update_ekm_config request + # + # # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. + # p result + # + def update_ekm_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_ekm_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_ekm_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_ekm_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.update_ekm_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Verifies that Cloud KMS can successfully connect to the external key + # manager specified by an {::Google::Cloud::Kms::V1::EkmConnection 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. + # + # @overload verify_connectivity(request, options = nil) + # Pass arguments to `verify_connectivity` via a request object, either of type + # {::Google::Cloud::Kms::V1::VerifyConnectivityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::VerifyConnectivityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload verify_connectivity(name: nil) + # Pass arguments to `verify_connectivity` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to verify. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::VerifyConnectivityRequest.new + # + # # Call the verify_connectivity method. + # result = client.verify_connectivity request + # + # # The returned object is of type Google::Cloud::Kms::V1::VerifyConnectivityResponse. + # p result + # + def verify_connectivity request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::VerifyConnectivityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.verify_connectivity.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.verify_connectivity.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.verify_connectivity.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @ekm_service_stub.verify_connectivity request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the EkmService REST API. + # + # This class represents the configuration for EkmService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Kms::V1::EkmService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_ekm_connections to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Kms::V1::EkmService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_ekm_connections.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_ekm_connections.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the EkmService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_ekm_connections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_ekm_connections + ## + # RPC-specific configuration for `get_ekm_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_ekm_connection + ## + # RPC-specific configuration for `create_ekm_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :create_ekm_connection + ## + # RPC-specific configuration for `update_ekm_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :update_ekm_connection + ## + # RPC-specific configuration for `get_ekm_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_ekm_config + ## + # RPC-specific configuration for `update_ekm_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_ekm_config + ## + # RPC-specific configuration for `verify_connectivity` + # @return [::Gapic::Config::Method] + # + attr_reader :verify_connectivity + + # @private + def initialize parent_rpcs = nil + list_ekm_connections_config = parent_rpcs.list_ekm_connections if parent_rpcs.respond_to? :list_ekm_connections + @list_ekm_connections = ::Gapic::Config::Method.new list_ekm_connections_config + get_ekm_connection_config = parent_rpcs.get_ekm_connection if parent_rpcs.respond_to? :get_ekm_connection + @get_ekm_connection = ::Gapic::Config::Method.new get_ekm_connection_config + create_ekm_connection_config = parent_rpcs.create_ekm_connection if parent_rpcs.respond_to? :create_ekm_connection + @create_ekm_connection = ::Gapic::Config::Method.new create_ekm_connection_config + update_ekm_connection_config = parent_rpcs.update_ekm_connection if parent_rpcs.respond_to? :update_ekm_connection + @update_ekm_connection = ::Gapic::Config::Method.new update_ekm_connection_config + get_ekm_config_config = parent_rpcs.get_ekm_config if parent_rpcs.respond_to? :get_ekm_config + @get_ekm_config = ::Gapic::Config::Method.new get_ekm_config_config + update_ekm_config_config = parent_rpcs.update_ekm_config if parent_rpcs.respond_to? :update_ekm_config + @update_ekm_config = ::Gapic::Config::Method.new update_ekm_config_config + verify_connectivity_config = parent_rpcs.verify_connectivity if parent_rpcs.respond_to? :verify_connectivity + @verify_connectivity = ::Gapic::Config::Method.new verify_connectivity_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb new file mode 100644 index 000000000000..81e6c86bca0f --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb @@ -0,0 +1,511 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/kms/v1/ekm_service_pb" + +module Google + module Cloud + module Kms + module V1 + module EkmService + module Rest + ## + # REST service stub for the EkmService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_ekm_connections REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListEkmConnectionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ListEkmConnectionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ListEkmConnectionsResponse] + # A result object deserialized from the server's reply + def list_ekm_connections request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_ekm_connections_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_ekm_connections", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ListEkmConnectionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_ekm_connection REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetEkmConnectionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EkmConnection] + # A result object deserialized from the server's reply + def get_ekm_connection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_ekm_connection_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_ekm_connection", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::EkmConnection.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_ekm_connection REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateEkmConnectionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EkmConnection] + # A result object deserialized from the server's reply + def create_ekm_connection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_ekm_connection_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_ekm_connection", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::EkmConnection.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_ekm_connection REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EkmConnection] + # A result object deserialized from the server's reply + def update_ekm_connection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_ekm_connection_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_ekm_connection", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::EkmConnection.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_ekm_config REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetEkmConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EkmConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EkmConfig] + # A result object deserialized from the server's reply + def get_ekm_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_ekm_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_ekm_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::EkmConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_ekm_config REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateEkmConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EkmConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EkmConfig] + # A result object deserialized from the server's reply + def update_ekm_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_ekm_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_ekm_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::EkmConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the verify_connectivity REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::VerifyConnectivityRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] + # A result object deserialized from the server's reply + def verify_connectivity request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_verify_connectivity_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "verify_connectivity", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::VerifyConnectivityResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_ekm_connections REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListEkmConnectionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_ekm_connections_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/ekmConnections", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_ekm_connection REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetEkmConnectionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_ekm_connection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_ekm_connection REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateEkmConnectionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_ekm_connection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/ekmConnections", + body: "ekm_connection", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_ekm_connection REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_ekm_connection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{ekm_connection.name}", + body: "ekm_connection", + matches: [ + ["ekm_connection.name", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_ekm_config REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetEkmConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_ekm_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_ekm_config REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateEkmConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_ekm_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{ekm_config.name}", + body: "ekm_config", + matches: [ + ["ekm_config.name", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the verify_connectivity REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::VerifyConnectivityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_verify_connectivity_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:verifyConnectivity", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_pb.rb new file mode 100644 index 000000000000..b543f3cec3ad --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_pb.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/kms/v1/ekm_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n%google/cloud/kms/v1/ekm_service.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb3\x01\n\x19ListEkmConnectionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x86\x01\n\x1aListEkmConnectionsResponse\x12;\n\x0f\x65km_connections\x18\x01 \x03(\x0b\x32\".google.cloud.kms.v1.EkmConnection\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"V\n\x17GetEkmConnectionRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%cloudkms.googleapis.com/EkmConnection\"\xb8\x01\n\x1a\x43reateEkmConnectionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x1e\n\x11\x65km_connection_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x0e\x65km_connection\x18\x03 \x01(\x0b\x32\".google.cloud.kms.v1.EkmConnectionB\x03\xe0\x41\x02\"\x93\x01\n\x1aUpdateEkmConnectionRequest\x12?\n\x0e\x65km_connection\x18\x01 \x01(\x0b\x32\".google.cloud.kms.v1.EkmConnectionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"N\n\x13GetEkmConfigRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/EkmConfig\"\x87\x01\n\x16UpdateEkmConfigRequest\x12\x37\n\nekm_config\x18\x01 \x01(\x0b\x32\x1e.google.cloud.kms.v1.EkmConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xbf\x02\n\x0b\x43\x65rtificate\x12\x14\n\x07raw_der\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x13\n\x06parsed\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x12\x13\n\x06issuer\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07subject\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12*\n\x1dsubject_alternative_dns_names\x18\x05 \x03(\tB\x03\xe0\x41\x03\x12\x38\n\x0fnot_before_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x37\n\x0enot_after_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1a\n\rserial_number\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12sha256_fingerprint\x18\t \x01(\tB\x03\xe0\x41\x03\"\xe2\x05\n\rEkmConnection\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12R\n\x11service_resolvers\x18\x03 \x03(\x0b\x32\x32.google.cloud.kms.v1.EkmConnection.ServiceResolverB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12V\n\x13key_management_mode\x18\x06 \x01(\x0e\x32\x34.google.cloud.kms.v1.EkmConnection.KeyManagementModeB\x03\xe0\x41\x01\x12\x1e\n\x11\x63rypto_space_path\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xde\x01\n\x0fServiceResolver\x12R\n\x19service_directory_service\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12\x1c\n\x0f\x65ndpoint_filter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08hostname\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x42\n\x13server_certificates\x18\x04 \x03(\x0b\x32 .google.cloud.kms.v1.CertificateB\x03\xe0\x41\x02\"S\n\x11KeyManagementMode\x12#\n\x1fKEY_MANAGEMENT_MODE_UNSPECIFIED\x10\x00\x12\n\n\x06MANUAL\x10\x01\x12\r\n\tCLOUD_KMS\x10\x02:s\xea\x41p\n%cloudkms.googleapis.com/EkmConnection\x12Gprojects/{project}/locations/{location}/ekmConnections/{ekm_connection}\"\xc8\x01\n\tEkmConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12M\n\x16\x64\x65\x66\x61ult_ekm_connection\x18\x02 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%cloudkms.googleapis.com/EkmConnection:Y\xea\x41V\n!cloudkms.googleapis.com/EkmConfig\x12\x31projects/{project}/locations/{location}/ekmConfig\"X\n\x19VerifyConnectivityRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%cloudkms.googleapis.com/EkmConnection\"\x1c\n\x1aVerifyConnectivityResponse2\xdc\x0b\n\nEkmService\x12\xba\x01\n\x12ListEkmConnections\x12..google.cloud.kms.v1.ListEkmConnectionsRequest\x1a/.google.cloud.kms.v1.ListEkmConnectionsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/ekmConnections\x12\xa7\x01\n\x10GetEkmConnection\x12,.google.cloud.kms.v1.GetEkmConnectionRequest\x1a\".google.cloud.kms.v1.EkmConnection\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/ekmConnections/*}\x12\xe0\x01\n\x13\x43reateEkmConnection\x12/.google.cloud.kms.v1.CreateEkmConnectionRequest\x1a\".google.cloud.kms.v1.EkmConnection\"t\xda\x41\'parent,ekm_connection_id,ekm_connection\x82\xd3\xe4\x93\x02\x44\"2/v1/{parent=projects/*/locations/*}/ekmConnections:\x0e\x65km_connection\x12\xe2\x01\n\x13UpdateEkmConnection\x12/.google.cloud.kms.v1.UpdateEkmConnectionRequest\x1a\".google.cloud.kms.v1.EkmConnection\"v\xda\x41\x1a\x65km_connection,update_mask\x82\xd3\xe4\x93\x02S2A/v1/{ekm_connection.name=projects/*/locations/*/ekmConnections/*}:\x0e\x65km_connection\x12\x94\x01\n\x0cGetEkmConfig\x12(.google.cloud.kms.v1.GetEkmConfigRequest\x1a\x1e.google.cloud.kms.v1.EkmConfig\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/ekmConfig}\x12\xc3\x01\n\x0fUpdateEkmConfig\x12+.google.cloud.kms.v1.UpdateEkmConfigRequest\x1a\x1e.google.cloud.kms.v1.EkmConfig\"c\xda\x41\x16\x65km_config,update_mask\x82\xd3\xe4\x93\x02\x44\x32\x36/v1/{ekm_config.name=projects/*/locations/*/ekmConfig}:\nekm_config\x12\xcb\x01\n\x12VerifyConnectivity\x12..google.cloud.kms.v1.VerifyConnectivityRequest\x1a/.google.cloud.kms.v1.VerifyConnectivityResponse\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1/{name=projects/*/locations/*/ekmConnections/*}:verifyConnectivity\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsB\x82\x02\n\x17\x63om.google.cloud.kms.v1B\x0f\x45kmServiceProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Kms + module V1 + ListEkmConnectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListEkmConnectionsRequest").msgclass + ListEkmConnectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListEkmConnectionsResponse").msgclass + GetEkmConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetEkmConnectionRequest").msgclass + CreateEkmConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateEkmConnectionRequest").msgclass + UpdateEkmConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateEkmConnectionRequest").msgclass + GetEkmConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetEkmConfigRequest").msgclass + UpdateEkmConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateEkmConfigRequest").msgclass + Certificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.Certificate").msgclass + EkmConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EkmConnection").msgclass + EkmConnection::ServiceResolver = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EkmConnection.ServiceResolver").msgclass + EkmConnection::KeyManagementMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EkmConnection.KeyManagementMode").enummodule + EkmConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EkmConfig").msgclass + VerifyConnectivityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.VerifyConnectivityRequest").msgclass + VerifyConnectivityResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.VerifyConnectivityResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_services_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_services_pb.rb new file mode 100644 index 000000000000..cdb76dbd1f63 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_services_pb.rb @@ -0,0 +1,69 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/kms/v1/ekm_service.proto for package 'google.cloud.kms.v1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/kms/v1/ekm_service_pb' + +module Google + module Cloud + module Kms + module V1 + module EkmService + # Google Cloud Key Management EKM Service + # + # Manages external cryptographic keys and operations using those keys. + # Implements a REST model with the following objects: + # * [EkmConnection][google.cloud.kms.v1.EkmConnection] + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.kms.v1.EkmService' + + # Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. + rpc :ListEkmConnections, ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest, ::Google::Cloud::Kms::V1::ListEkmConnectionsResponse + # Returns metadata for a given + # [EkmConnection][google.cloud.kms.v1.EkmConnection]. + rpc :GetEkmConnection, ::Google::Cloud::Kms::V1::GetEkmConnectionRequest, ::Google::Cloud::Kms::V1::EkmConnection + # Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given + # Project and Location. + rpc :CreateEkmConnection, ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest, ::Google::Cloud::Kms::V1::EkmConnection + # Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata. + rpc :UpdateEkmConnection, ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest, ::Google::Cloud::Kms::V1::EkmConnection + # Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + # for a given project and location. + rpc :GetEkmConfig, ::Google::Cloud::Kms::V1::GetEkmConfigRequest, ::Google::Cloud::Kms::V1::EkmConfig + # Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + # for a given project and location. + rpc :UpdateEkmConfig, ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest, ::Google::Cloud::Kms::V1::EkmConfig + # 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. + rpc :VerifyConnectivity, ::Google::Cloud::Kms::V1::VerifyConnectivityRequest, ::Google::Cloud::Kms::V1::VerifyConnectivityResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management.rb new file mode 100644 index 000000000000..8b25b31605e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/kms/v1/version" + +require "google/cloud/kms/v1/hsm_management/credentials" +require "google/cloud/kms/v1/hsm_management/paths" +require "google/cloud/kms/v1/hsm_management/operations" +require "google/cloud/kms/v1/hsm_management/client" +require "google/cloud/kms/v1/hsm_management/rest" + +module Google + module Cloud + module Kms + module V1 + ## + # Google Cloud HSM Management Service + # + # Provides interfaces for managing HSM instances. + # + # Implements a REST model with the following objects: + # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/kms/v1/hsm_management" + # client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/kms/v1/hsm_management/rest" + # client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + module HsmManagement + end + end + end + end +end + +helper_path = ::File.join __dir__, "hsm_management", "helpers.rb" +require "google/cloud/kms/v1/hsm_management/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/client.rb new file mode 100644 index 000000000000..f5e81374e6e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/client.rb @@ -0,0 +1,1477 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/kms/v1/hsm_management_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module Kms + module V1 + module HsmManagement + ## + # Client for the HsmManagement service. + # + # Google Cloud HSM Management Service + # + # Provides interfaces for managing HSM instances. + # + # Implements a REST model with the following objects: + # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :hsm_management_stub + + ## + # Configure the HsmManagement Client class. + # + # See {::Google::Cloud::Kms::V1::HsmManagement::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all HsmManagement clients + # ::Google::Cloud::Kms::V1::HsmManagement::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Kms", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_single_tenant_hsm_instances.timeout = 60.0 + default_config.rpcs.list_single_tenant_hsm_instances.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_single_tenant_hsm_instance.timeout = 60.0 + default_config.rpcs.get_single_tenant_hsm_instance.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_single_tenant_hsm_instance.timeout = 60.0 + default_config.rpcs.create_single_tenant_hsm_instance.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_single_tenant_hsm_instance_proposal.timeout = 60.0 + default_config.rpcs.create_single_tenant_hsm_instance_proposal.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.approve_single_tenant_hsm_instance_proposal.timeout = 60.0 + default_config.rpcs.approve_single_tenant_hsm_instance_proposal.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.execute_single_tenant_hsm_instance_proposal.timeout = 60.0 + default_config.rpcs.execute_single_tenant_hsm_instance_proposal.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_single_tenant_hsm_instance_proposal.timeout = 60.0 + default_config.rpcs.get_single_tenant_hsm_instance_proposal.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_single_tenant_hsm_instance_proposals.timeout = 60.0 + default_config.rpcs.list_single_tenant_hsm_instance_proposals.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_single_tenant_hsm_instance_proposal.timeout = 60.0 + default_config.rpcs.delete_single_tenant_hsm_instance_proposal.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the HsmManagement Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Kms::V1::HsmManagement::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @hsm_management_stub.universe_domain + end + + ## + # Create a new HsmManagement client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the HsmManagement client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/kms/v1/hsm_management_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @hsm_management_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Kms::V1::HsmManagement::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @hsm_management_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @hsm_management_stub.endpoint + config.universe_domain = @hsm_management_stub.universe_domain + config.logger = @hsm_management_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @hsm_management_stub.endpoint + config.universe_domain = @hsm_management_stub.universe_domain + config.logger = @hsm_management_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Kms::V1::HsmManagement::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @hsm_management_stub.logger + end + + # Service calls + + ## + # Lists + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances}. + # + # @overload list_single_tenant_hsm_instances(request, options = nil) + # Pass arguments to `list_single_tenant_hsm_instances` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_single_tenant_hsm_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) + # Pass arguments to `list_single_tenant_hsm_instances` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to + # list, in the format `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to + # include in the response. Further + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} can + # subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token}. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # @param show_deleted [::Boolean] + # Optional. If set to true, + # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances HsmManagement.ListSingleTenantHsmInstances} + # will also return + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} in + # DELETED state. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new + # + # # Call the list_single_tenant_hsm_instances method. + # result = client.list_single_tenant_hsm_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstance. + # p item + # end + # + def list_single_tenant_hsm_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_single_tenant_hsm_instances.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_single_tenant_hsm_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_single_tenant_hsm_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.call_rpc :list_single_tenant_hsm_instances, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @hsm_management_stub, :list_single_tenant_hsm_instances, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # + # @overload get_single_tenant_hsm_instance(request, options = nil) + # Pass arguments to `get_single_tenant_hsm_instance` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_single_tenant_hsm_instance(name: nil) + # Pass arguments to `get_single_tenant_hsm_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of + # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new + # + # # Call the get_single_tenant_hsm_instance method. + # result = client.get_single_tenant_hsm_instance request + # + # # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstance. + # p result + # + def get_single_tenant_hsm_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_single_tenant_hsm_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_single_tenant_hsm_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_single_tenant_hsm_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.call_rpc :get_single_tenant_hsm_instance, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} in a + # given Project and Location. User must create a RegisterTwoFactorAuthKeys + # proposal with this single-tenant HSM instance to finish setup of the + # instance. + # + # @overload create_single_tenant_hsm_instance(request, options = nil) + # Pass arguments to `create_single_tenant_hsm_instance` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_single_tenant_hsm_instance(parent: nil, single_tenant_hsm_instance_id: nil, single_tenant_hsm_instance: nil) + # Pass arguments to `create_single_tenant_hsm_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}, in + # the format `projects/*/locations/*`. + # @param single_tenant_hsm_instance_id [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. + # @param single_tenant_hsm_instance [::Google::Cloud::Kms::V1::SingleTenantHsmInstance, ::Hash] + # Required. An + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} with + # initial field values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new + # + # # Call the create_single_tenant_hsm_instance method. + # result = client.create_single_tenant_hsm_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_single_tenant_hsm_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_single_tenant_hsm_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_single_tenant_hsm_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_single_tenant_hsm_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.call_rpc :create_single_tenant_hsm_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # for a given + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # + # @overload create_single_tenant_hsm_instance_proposal(request, options = nil) + # Pass arguments to `create_single_tenant_hsm_instance_proposal` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_single_tenant_hsm_instance_proposal(parent: nil, single_tenant_hsm_instance_proposal_id: nil, single_tenant_hsm_instance_proposal: nil) + # Pass arguments to `create_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of + # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # associated with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. + # @param single_tenant_hsm_instance_proposal_id [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. + # @param single_tenant_hsm_instance_proposal [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal, ::Hash] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new + # + # # Call the create_single_tenant_hsm_instance_proposal method. + # result = client.create_single_tenant_hsm_instance_proposal request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_single_tenant_hsm_instance_proposal request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_single_tenant_hsm_instance_proposal.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_single_tenant_hsm_instance_proposal.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_single_tenant_hsm_instance_proposal.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.call_rpc :create_single_tenant_hsm_instance_proposal, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Approves a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # for a given + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The + # proposal must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::State::PENDING PENDING} + # state. + # + # @overload approve_single_tenant_hsm_instance_proposal(request, options = nil) + # Pass arguments to `approve_single_tenant_hsm_instance_proposal` via a request object, either of type + # {::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload approve_single_tenant_hsm_instance_proposal(name: nil, quorum_reply: nil, required_action_quorum_reply: nil) + # Pass arguments to `approve_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to approve. + # @param quorum_reply [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::QuorumReply, ::Hash] + # Required. The reply to + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters QuorumParameters} + # for approving the proposal. + # + # Note: The following parameters are mutually exclusive: `quorum_reply`, `required_action_quorum_reply`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param required_action_quorum_reply [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::RequiredActionQuorumReply, ::Hash] + # Required. The reply to + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters RequiredActionQuorumParameters} + # for approving the proposal. + # + # Note: The following parameters are mutually exclusive: `required_action_quorum_reply`, `quorum_reply`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new + # + # # Call the approve_single_tenant_hsm_instance_proposal method. + # result = client.approve_single_tenant_hsm_instance_proposal request + # + # # The returned object is of type Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse. + # p result + # + def approve_single_tenant_hsm_instance_proposal request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.approve_single_tenant_hsm_instance_proposal.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.approve_single_tenant_hsm_instance_proposal.timeout, + metadata: metadata, + retry_policy: @config.rpcs.approve_single_tenant_hsm_instance_proposal.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.call_rpc :approve_single_tenant_hsm_instance_proposal, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Executes a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # for a given + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The + # proposal must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::State::APPROVED APPROVED} + # state. + # + # @overload execute_single_tenant_hsm_instance_proposal(request, options = nil) + # Pass arguments to `execute_single_tenant_hsm_instance_proposal` via a request object, either of type + # {::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload execute_single_tenant_hsm_instance_proposal(name: nil) + # Pass arguments to `execute_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to execute. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new + # + # # Call the execute_single_tenant_hsm_instance_proposal method. + # result = client.execute_single_tenant_hsm_instance_proposal request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def execute_single_tenant_hsm_instance_proposal request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.execute_single_tenant_hsm_instance_proposal.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.execute_single_tenant_hsm_instance_proposal.timeout, + metadata: metadata, + retry_policy: @config.rpcs.execute_single_tenant_hsm_instance_proposal.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.call_rpc :execute_single_tenant_hsm_instance_proposal, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. + # + # @overload get_single_tenant_hsm_instance_proposal(request, options = nil) + # Pass arguments to `get_single_tenant_hsm_instance_proposal` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_single_tenant_hsm_instance_proposal(name: nil) + # Pass arguments to `get_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new + # + # # Call the get_single_tenant_hsm_instance_proposal method. + # result = client.get_single_tenant_hsm_instance_proposal request + # + # # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. + # p result + # + def get_single_tenant_hsm_instance_proposal request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_single_tenant_hsm_instance_proposal.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_single_tenant_hsm_instance_proposal.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_single_tenant_hsm_instance_proposal.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.call_rpc :get_single_tenant_hsm_instance_proposal, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. + # + # @overload list_single_tenant_hsm_instance_proposals(request, options = nil) + # Pass arguments to `list_single_tenant_hsm_instance_proposals` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_single_tenant_hsm_instance_proposals(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) + # Pass arguments to `list_single_tenant_hsm_instance_proposals` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the single tenant HSM instance associated + # with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # to list, in the format `projects/*/locations/*/singleTenantHsmInstances/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # to include in the response. Further + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # can subsequently be obtained by including the + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token}. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # @param show_deleted [::Boolean] + # Optional. If set to true, + # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals HsmManagement.ListSingleTenantHsmInstanceProposals} + # will also return + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # in DELETED state. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new + # + # # Call the list_single_tenant_hsm_instance_proposals method. + # result = client.list_single_tenant_hsm_instance_proposals request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. + # p item + # end + # + def list_single_tenant_hsm_instance_proposals request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_single_tenant_hsm_instance_proposals.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_single_tenant_hsm_instance_proposals.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_single_tenant_hsm_instance_proposals.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.call_rpc :list_single_tenant_hsm_instance_proposals, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @hsm_management_stub, :list_single_tenant_hsm_instance_proposals, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. + # + # @overload delete_single_tenant_hsm_instance_proposal(request, options = nil) + # Pass arguments to `delete_single_tenant_hsm_instance_proposal` via a request object, either of type + # {::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_single_tenant_hsm_instance_proposal(name: nil) + # Pass arguments to `delete_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new + # + # # Call the delete_single_tenant_hsm_instance_proposal method. + # result = client.delete_single_tenant_hsm_instance_proposal request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_single_tenant_hsm_instance_proposal request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_single_tenant_hsm_instance_proposal.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_single_tenant_hsm_instance_proposal.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_single_tenant_hsm_instance_proposal.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.call_rpc :delete_single_tenant_hsm_instance_proposal, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the HsmManagement API. + # + # This class represents the configuration for HsmManagement, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Kms::V1::HsmManagement::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_single_tenant_hsm_instances to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Kms::V1::HsmManagement::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_single_tenant_hsm_instances.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_single_tenant_hsm_instances.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the HsmManagement API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_single_tenant_hsm_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_single_tenant_hsm_instances + ## + # RPC-specific configuration for `get_single_tenant_hsm_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_single_tenant_hsm_instance + ## + # RPC-specific configuration for `create_single_tenant_hsm_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_single_tenant_hsm_instance + ## + # RPC-specific configuration for `create_single_tenant_hsm_instance_proposal` + # @return [::Gapic::Config::Method] + # + attr_reader :create_single_tenant_hsm_instance_proposal + ## + # RPC-specific configuration for `approve_single_tenant_hsm_instance_proposal` + # @return [::Gapic::Config::Method] + # + attr_reader :approve_single_tenant_hsm_instance_proposal + ## + # RPC-specific configuration for `execute_single_tenant_hsm_instance_proposal` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_single_tenant_hsm_instance_proposal + ## + # RPC-specific configuration for `get_single_tenant_hsm_instance_proposal` + # @return [::Gapic::Config::Method] + # + attr_reader :get_single_tenant_hsm_instance_proposal + ## + # RPC-specific configuration for `list_single_tenant_hsm_instance_proposals` + # @return [::Gapic::Config::Method] + # + attr_reader :list_single_tenant_hsm_instance_proposals + ## + # RPC-specific configuration for `delete_single_tenant_hsm_instance_proposal` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_single_tenant_hsm_instance_proposal + + # @private + def initialize parent_rpcs = nil + list_single_tenant_hsm_instances_config = parent_rpcs.list_single_tenant_hsm_instances if parent_rpcs.respond_to? :list_single_tenant_hsm_instances + @list_single_tenant_hsm_instances = ::Gapic::Config::Method.new list_single_tenant_hsm_instances_config + get_single_tenant_hsm_instance_config = parent_rpcs.get_single_tenant_hsm_instance if parent_rpcs.respond_to? :get_single_tenant_hsm_instance + @get_single_tenant_hsm_instance = ::Gapic::Config::Method.new get_single_tenant_hsm_instance_config + create_single_tenant_hsm_instance_config = parent_rpcs.create_single_tenant_hsm_instance if parent_rpcs.respond_to? :create_single_tenant_hsm_instance + @create_single_tenant_hsm_instance = ::Gapic::Config::Method.new create_single_tenant_hsm_instance_config + create_single_tenant_hsm_instance_proposal_config = parent_rpcs.create_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :create_single_tenant_hsm_instance_proposal + @create_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new create_single_tenant_hsm_instance_proposal_config + approve_single_tenant_hsm_instance_proposal_config = parent_rpcs.approve_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :approve_single_tenant_hsm_instance_proposal + @approve_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new approve_single_tenant_hsm_instance_proposal_config + execute_single_tenant_hsm_instance_proposal_config = parent_rpcs.execute_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :execute_single_tenant_hsm_instance_proposal + @execute_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new execute_single_tenant_hsm_instance_proposal_config + get_single_tenant_hsm_instance_proposal_config = parent_rpcs.get_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :get_single_tenant_hsm_instance_proposal + @get_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new get_single_tenant_hsm_instance_proposal_config + list_single_tenant_hsm_instance_proposals_config = parent_rpcs.list_single_tenant_hsm_instance_proposals if parent_rpcs.respond_to? :list_single_tenant_hsm_instance_proposals + @list_single_tenant_hsm_instance_proposals = ::Gapic::Config::Method.new list_single_tenant_hsm_instance_proposals_config + delete_single_tenant_hsm_instance_proposal_config = parent_rpcs.delete_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :delete_single_tenant_hsm_instance_proposal + @delete_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new delete_single_tenant_hsm_instance_proposal_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/credentials.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/credentials.rb new file mode 100644 index 000000000000..e3f5b6f3339a --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Kms + module V1 + module HsmManagement + # Credentials for the HsmManagement API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + self.env_vars = [ + "KMS_CREDENTIALS", + "KMS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "KMS_CREDENTIALS_JSON", + "KMS_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/operations.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/operations.rb new file mode 100644 index 000000000000..09268949700c --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Kms + module V1 + module HsmManagement + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the HsmManagement Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the HsmManagement Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/paths.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/paths.rb new file mode 100644 index 000000000000..efa4231cc1e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/paths.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + module HsmManagement + # Path helper methods for the HsmManagement API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified SingleTenantHsmInstance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/singleTenantHsmInstances/{single_tenant_hsm_instance}` + # + # @param project [String] + # @param location [String] + # @param single_tenant_hsm_instance [String] + # + # @return [::String] + def single_tenant_hsm_instance_path project:, location:, single_tenant_hsm_instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/singleTenantHsmInstances/#{single_tenant_hsm_instance}" + end + + ## + # Create a fully-qualified SingleTenantHsmInstanceProposal resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/singleTenantHsmInstances/{single_tenant_hsm_instance}/proposals/{proposal}` + # + # @param project [String] + # @param location [String] + # @param single_tenant_hsm_instance [String] + # @param proposal [String] + # + # @return [::String] + def single_tenant_hsm_instance_proposal_path project:, location:, single_tenant_hsm_instance:, proposal: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "single_tenant_hsm_instance cannot contain /" if single_tenant_hsm_instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/singleTenantHsmInstances/#{single_tenant_hsm_instance}/proposals/#{proposal}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest.rb new file mode 100644 index 000000000000..a12ced4da408 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/kms/v1/version" +require "google/cloud/kms/v1/bindings_override" + +require "google/cloud/kms/v1/hsm_management/credentials" +require "google/cloud/kms/v1/hsm_management/paths" +require "google/cloud/kms/v1/hsm_management/rest/operations" +require "google/cloud/kms/v1/hsm_management/rest/client" + +module Google + module Cloud + module Kms + module V1 + ## + # Google Cloud HSM Management Service + # + # Provides interfaces for managing HSM instances. + # + # Implements a REST model with the following objects: + # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/kms/v1/hsm_management/rest" + # client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + module HsmManagement + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/kms/v1/hsm_management/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/client.rb new file mode 100644 index 000000000000..be33b81210c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/client.rb @@ -0,0 +1,1380 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/kms/v1/hsm_management_pb" +require "google/cloud/kms/v1/hsm_management/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module Kms + module V1 + module HsmManagement + module Rest + ## + # REST client for the HsmManagement service. + # + # Google Cloud HSM Management Service + # + # Provides interfaces for managing HSM instances. + # + # Implements a REST model with the following objects: + # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :hsm_management_stub + + ## + # Configure the HsmManagement Client class. + # + # See {::Google::Cloud::Kms::V1::HsmManagement::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all HsmManagement clients + # ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Kms", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_single_tenant_hsm_instances.timeout = 60.0 + default_config.rpcs.list_single_tenant_hsm_instances.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_single_tenant_hsm_instance.timeout = 60.0 + default_config.rpcs.get_single_tenant_hsm_instance.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_single_tenant_hsm_instance.timeout = 60.0 + default_config.rpcs.create_single_tenant_hsm_instance.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_single_tenant_hsm_instance_proposal.timeout = 60.0 + default_config.rpcs.create_single_tenant_hsm_instance_proposal.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.approve_single_tenant_hsm_instance_proposal.timeout = 60.0 + default_config.rpcs.approve_single_tenant_hsm_instance_proposal.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.execute_single_tenant_hsm_instance_proposal.timeout = 60.0 + default_config.rpcs.execute_single_tenant_hsm_instance_proposal.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_single_tenant_hsm_instance_proposal.timeout = 60.0 + default_config.rpcs.get_single_tenant_hsm_instance_proposal.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_single_tenant_hsm_instance_proposals.timeout = 60.0 + default_config.rpcs.list_single_tenant_hsm_instance_proposals.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_single_tenant_hsm_instance_proposal.timeout = 60.0 + default_config.rpcs.delete_single_tenant_hsm_instance_proposal.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the HsmManagement Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Kms::V1::HsmManagement::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @hsm_management_stub.universe_domain + end + + ## + # Create a new HsmManagement REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the HsmManagement client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @hsm_management_stub = ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @hsm_management_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @hsm_management_stub.endpoint + config.universe_domain = @hsm_management_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @hsm_management_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @hsm_management_stub.endpoint + config.universe_domain = @hsm_management_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @hsm_management_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Kms::V1::HsmManagement::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @hsm_management_stub.logger + end + + # Service calls + + ## + # Lists + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances}. + # + # @overload list_single_tenant_hsm_instances(request, options = nil) + # Pass arguments to `list_single_tenant_hsm_instances` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_single_tenant_hsm_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) + # Pass arguments to `list_single_tenant_hsm_instances` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to + # list, in the format `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to + # include in the response. Further + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} can + # subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token}. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # @param show_deleted [::Boolean] + # Optional. If set to true, + # {::Google::Cloud::Kms::V1::HsmManagement::Rest::Client#list_single_tenant_hsm_instances HsmManagement.ListSingleTenantHsmInstances} + # will also return + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} in + # DELETED state. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new + # + # # Call the list_single_tenant_hsm_instances method. + # result = client.list_single_tenant_hsm_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstance. + # p item + # end + # + def list_single_tenant_hsm_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_single_tenant_hsm_instances.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_single_tenant_hsm_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_single_tenant_hsm_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.list_single_tenant_hsm_instances request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @hsm_management_stub, :list_single_tenant_hsm_instances, "single_tenant_hsm_instances", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # + # @overload get_single_tenant_hsm_instance(request, options = nil) + # Pass arguments to `get_single_tenant_hsm_instance` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_single_tenant_hsm_instance(name: nil) + # Pass arguments to `get_single_tenant_hsm_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of + # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new + # + # # Call the get_single_tenant_hsm_instance method. + # result = client.get_single_tenant_hsm_instance request + # + # # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstance. + # p result + # + def get_single_tenant_hsm_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_single_tenant_hsm_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_single_tenant_hsm_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_single_tenant_hsm_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.get_single_tenant_hsm_instance request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} in a + # given Project and Location. User must create a RegisterTwoFactorAuthKeys + # proposal with this single-tenant HSM instance to finish setup of the + # instance. + # + # @overload create_single_tenant_hsm_instance(request, options = nil) + # Pass arguments to `create_single_tenant_hsm_instance` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_single_tenant_hsm_instance(parent: nil, single_tenant_hsm_instance_id: nil, single_tenant_hsm_instance: nil) + # Pass arguments to `create_single_tenant_hsm_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}, in + # the format `projects/*/locations/*`. + # @param single_tenant_hsm_instance_id [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. + # @param single_tenant_hsm_instance [::Google::Cloud::Kms::V1::SingleTenantHsmInstance, ::Hash] + # Required. An + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} with + # initial field values. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new + # + # # Call the create_single_tenant_hsm_instance method. + # result = client.create_single_tenant_hsm_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_single_tenant_hsm_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_single_tenant_hsm_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_single_tenant_hsm_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_single_tenant_hsm_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.create_single_tenant_hsm_instance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # for a given + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # + # @overload create_single_tenant_hsm_instance_proposal(request, options = nil) + # Pass arguments to `create_single_tenant_hsm_instance_proposal` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_single_tenant_hsm_instance_proposal(parent: nil, single_tenant_hsm_instance_proposal_id: nil, single_tenant_hsm_instance_proposal: nil) + # Pass arguments to `create_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of + # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # associated with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. + # @param single_tenant_hsm_instance_proposal_id [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. + # @param single_tenant_hsm_instance_proposal [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal, ::Hash] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new + # + # # Call the create_single_tenant_hsm_instance_proposal method. + # result = client.create_single_tenant_hsm_instance_proposal request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_single_tenant_hsm_instance_proposal request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_single_tenant_hsm_instance_proposal.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_single_tenant_hsm_instance_proposal.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_single_tenant_hsm_instance_proposal.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.create_single_tenant_hsm_instance_proposal request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Approves a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # for a given + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The + # proposal must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::State::PENDING PENDING} + # state. + # + # @overload approve_single_tenant_hsm_instance_proposal(request, options = nil) + # Pass arguments to `approve_single_tenant_hsm_instance_proposal` via a request object, either of type + # {::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload approve_single_tenant_hsm_instance_proposal(name: nil, quorum_reply: nil, required_action_quorum_reply: nil) + # Pass arguments to `approve_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to approve. + # @param quorum_reply [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::QuorumReply, ::Hash] + # Required. The reply to + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters QuorumParameters} + # for approving the proposal. + # + # Note: The following parameters are mutually exclusive: `quorum_reply`, `required_action_quorum_reply`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param required_action_quorum_reply [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::RequiredActionQuorumReply, ::Hash] + # Required. The reply to + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters RequiredActionQuorumParameters} + # for approving the proposal. + # + # Note: The following parameters are mutually exclusive: `required_action_quorum_reply`, `quorum_reply`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new + # + # # Call the approve_single_tenant_hsm_instance_proposal method. + # result = client.approve_single_tenant_hsm_instance_proposal request + # + # # The returned object is of type Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse. + # p result + # + def approve_single_tenant_hsm_instance_proposal request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.approve_single_tenant_hsm_instance_proposal.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.approve_single_tenant_hsm_instance_proposal.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.approve_single_tenant_hsm_instance_proposal.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.approve_single_tenant_hsm_instance_proposal request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Executes a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # for a given + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The + # proposal must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::State::APPROVED APPROVED} + # state. + # + # @overload execute_single_tenant_hsm_instance_proposal(request, options = nil) + # Pass arguments to `execute_single_tenant_hsm_instance_proposal` via a request object, either of type + # {::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload execute_single_tenant_hsm_instance_proposal(name: nil) + # Pass arguments to `execute_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to execute. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new + # + # # Call the execute_single_tenant_hsm_instance_proposal method. + # result = client.execute_single_tenant_hsm_instance_proposal request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def execute_single_tenant_hsm_instance_proposal request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.execute_single_tenant_hsm_instance_proposal.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.execute_single_tenant_hsm_instance_proposal.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.execute_single_tenant_hsm_instance_proposal.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.execute_single_tenant_hsm_instance_proposal request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. + # + # @overload get_single_tenant_hsm_instance_proposal(request, options = nil) + # Pass arguments to `get_single_tenant_hsm_instance_proposal` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_single_tenant_hsm_instance_proposal(name: nil) + # Pass arguments to `get_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new + # + # # Call the get_single_tenant_hsm_instance_proposal method. + # result = client.get_single_tenant_hsm_instance_proposal request + # + # # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. + # p result + # + def get_single_tenant_hsm_instance_proposal request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_single_tenant_hsm_instance_proposal.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_single_tenant_hsm_instance_proposal.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_single_tenant_hsm_instance_proposal.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.get_single_tenant_hsm_instance_proposal request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. + # + # @overload list_single_tenant_hsm_instance_proposals(request, options = nil) + # Pass arguments to `list_single_tenant_hsm_instance_proposals` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_single_tenant_hsm_instance_proposals(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) + # Pass arguments to `list_single_tenant_hsm_instance_proposals` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the single tenant HSM instance associated + # with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # to list, in the format `projects/*/locations/*/singleTenantHsmInstances/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # to include in the response. Further + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # can subsequently be obtained by including the + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token}. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # @param show_deleted [::Boolean] + # Optional. If set to true, + # {::Google::Cloud::Kms::V1::HsmManagement::Rest::Client#list_single_tenant_hsm_instance_proposals HsmManagement.ListSingleTenantHsmInstanceProposals} + # will also return + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # in DELETED state. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new + # + # # Call the list_single_tenant_hsm_instance_proposals method. + # result = client.list_single_tenant_hsm_instance_proposals request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. + # p item + # end + # + def list_single_tenant_hsm_instance_proposals request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_single_tenant_hsm_instance_proposals.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_single_tenant_hsm_instance_proposals.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_single_tenant_hsm_instance_proposals.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.list_single_tenant_hsm_instance_proposals request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @hsm_management_stub, :list_single_tenant_hsm_instance_proposals, "single_tenant_hsm_instance_proposals", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. + # + # @overload delete_single_tenant_hsm_instance_proposal(request, options = nil) + # Pass arguments to `delete_single_tenant_hsm_instance_proposal` via a request object, either of type + # {::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_single_tenant_hsm_instance_proposal(name: nil) + # Pass arguments to `delete_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new + # + # # Call the delete_single_tenant_hsm_instance_proposal method. + # result = client.delete_single_tenant_hsm_instance_proposal request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_single_tenant_hsm_instance_proposal request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_single_tenant_hsm_instance_proposal.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_single_tenant_hsm_instance_proposal.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_single_tenant_hsm_instance_proposal.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @hsm_management_stub.delete_single_tenant_hsm_instance_proposal request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the HsmManagement REST API. + # + # This class represents the configuration for HsmManagement REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Kms::V1::HsmManagement::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_single_tenant_hsm_instances to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_single_tenant_hsm_instances.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_single_tenant_hsm_instances.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the HsmManagement API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_single_tenant_hsm_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_single_tenant_hsm_instances + ## + # RPC-specific configuration for `get_single_tenant_hsm_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_single_tenant_hsm_instance + ## + # RPC-specific configuration for `create_single_tenant_hsm_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_single_tenant_hsm_instance + ## + # RPC-specific configuration for `create_single_tenant_hsm_instance_proposal` + # @return [::Gapic::Config::Method] + # + attr_reader :create_single_tenant_hsm_instance_proposal + ## + # RPC-specific configuration for `approve_single_tenant_hsm_instance_proposal` + # @return [::Gapic::Config::Method] + # + attr_reader :approve_single_tenant_hsm_instance_proposal + ## + # RPC-specific configuration for `execute_single_tenant_hsm_instance_proposal` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_single_tenant_hsm_instance_proposal + ## + # RPC-specific configuration for `get_single_tenant_hsm_instance_proposal` + # @return [::Gapic::Config::Method] + # + attr_reader :get_single_tenant_hsm_instance_proposal + ## + # RPC-specific configuration for `list_single_tenant_hsm_instance_proposals` + # @return [::Gapic::Config::Method] + # + attr_reader :list_single_tenant_hsm_instance_proposals + ## + # RPC-specific configuration for `delete_single_tenant_hsm_instance_proposal` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_single_tenant_hsm_instance_proposal + + # @private + def initialize parent_rpcs = nil + list_single_tenant_hsm_instances_config = parent_rpcs.list_single_tenant_hsm_instances if parent_rpcs.respond_to? :list_single_tenant_hsm_instances + @list_single_tenant_hsm_instances = ::Gapic::Config::Method.new list_single_tenant_hsm_instances_config + get_single_tenant_hsm_instance_config = parent_rpcs.get_single_tenant_hsm_instance if parent_rpcs.respond_to? :get_single_tenant_hsm_instance + @get_single_tenant_hsm_instance = ::Gapic::Config::Method.new get_single_tenant_hsm_instance_config + create_single_tenant_hsm_instance_config = parent_rpcs.create_single_tenant_hsm_instance if parent_rpcs.respond_to? :create_single_tenant_hsm_instance + @create_single_tenant_hsm_instance = ::Gapic::Config::Method.new create_single_tenant_hsm_instance_config + create_single_tenant_hsm_instance_proposal_config = parent_rpcs.create_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :create_single_tenant_hsm_instance_proposal + @create_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new create_single_tenant_hsm_instance_proposal_config + approve_single_tenant_hsm_instance_proposal_config = parent_rpcs.approve_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :approve_single_tenant_hsm_instance_proposal + @approve_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new approve_single_tenant_hsm_instance_proposal_config + execute_single_tenant_hsm_instance_proposal_config = parent_rpcs.execute_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :execute_single_tenant_hsm_instance_proposal + @execute_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new execute_single_tenant_hsm_instance_proposal_config + get_single_tenant_hsm_instance_proposal_config = parent_rpcs.get_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :get_single_tenant_hsm_instance_proposal + @get_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new get_single_tenant_hsm_instance_proposal_config + list_single_tenant_hsm_instance_proposals_config = parent_rpcs.list_single_tenant_hsm_instance_proposals if parent_rpcs.respond_to? :list_single_tenant_hsm_instance_proposals + @list_single_tenant_hsm_instance_proposals = ::Gapic::Config::Method.new list_single_tenant_hsm_instance_proposals_config + delete_single_tenant_hsm_instance_proposal_config = parent_rpcs.delete_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :delete_single_tenant_hsm_instance_proposal + @delete_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new delete_single_tenant_hsm_instance_proposal_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/operations.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/operations.rb new file mode 100644 index 000000000000..7d4e9ac3d2ea --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Kms + module V1 + module HsmManagement + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the HsmManagement Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the HsmManagement Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/service_stub.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/service_stub.rb new file mode 100644 index 000000000000..9fd2de9e936f --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/service_stub.rb @@ -0,0 +1,634 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/kms/v1/hsm_management_pb" + +module Google + module Cloud + module Kms + module V1 + module HsmManagement + module Rest + ## + # REST service stub for the HsmManagement service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_single_tenant_hsm_instances REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse] + # A result object deserialized from the server's reply + def list_single_tenant_hsm_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_single_tenant_hsm_instances_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_single_tenant_hsm_instances", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_single_tenant_hsm_instance REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] + # A result object deserialized from the server's reply + def get_single_tenant_hsm_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_single_tenant_hsm_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_single_tenant_hsm_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::SingleTenantHsmInstance.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_single_tenant_hsm_instance REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_single_tenant_hsm_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_single_tenant_hsm_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_single_tenant_hsm_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_single_tenant_hsm_instance_proposal REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_single_tenant_hsm_instance_proposal request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_single_tenant_hsm_instance_proposal_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_single_tenant_hsm_instance_proposal", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the approve_single_tenant_hsm_instance_proposal REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] + # A result object deserialized from the server's reply + def approve_single_tenant_hsm_instance_proposal request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_approve_single_tenant_hsm_instance_proposal_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "approve_single_tenant_hsm_instance_proposal", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the execute_single_tenant_hsm_instance_proposal REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def execute_single_tenant_hsm_instance_proposal request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_execute_single_tenant_hsm_instance_proposal_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "execute_single_tenant_hsm_instance_proposal", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_single_tenant_hsm_instance_proposal REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] + # A result object deserialized from the server's reply + def get_single_tenant_hsm_instance_proposal request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_single_tenant_hsm_instance_proposal_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_single_tenant_hsm_instance_proposal", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_single_tenant_hsm_instance_proposals REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse] + # A result object deserialized from the server's reply + def list_single_tenant_hsm_instance_proposals request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_single_tenant_hsm_instance_proposals_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_single_tenant_hsm_instance_proposals", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_single_tenant_hsm_instance_proposal REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_single_tenant_hsm_instance_proposal request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_single_tenant_hsm_instance_proposal_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_single_tenant_hsm_instance_proposal", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_single_tenant_hsm_instances REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_single_tenant_hsm_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/singleTenantHsmInstances", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_single_tenant_hsm_instance REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_single_tenant_hsm_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_single_tenant_hsm_instance REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_single_tenant_hsm_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/singleTenantHsmInstances", + body: "single_tenant_hsm_instance", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_single_tenant_hsm_instance_proposal REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_single_tenant_hsm_instance_proposal_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/proposals", + body: "single_tenant_hsm_instance_proposal", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the approve_single_tenant_hsm_instance_proposal REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_approve_single_tenant_hsm_instance_proposal_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:approve", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/proposals/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the execute_single_tenant_hsm_instance_proposal REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_execute_single_tenant_hsm_instance_proposal_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:execute", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/proposals/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_single_tenant_hsm_instance_proposal REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_single_tenant_hsm_instance_proposal_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/proposals/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_single_tenant_hsm_instance_proposals REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_single_tenant_hsm_instance_proposals_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/proposals", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_single_tenant_hsm_instance_proposal REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_single_tenant_hsm_instance_proposal_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/proposals/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_pb.rb new file mode 100644 index 000000000000..887f95ec2d0e --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_pb.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/kms/v1/hsm_management.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n(google/cloud/kms/v1/hsm_management.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa9\x07\n\x17SingleTenantHsmInstance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x05state\x18\x03 \x01(\x0e\x32\x32.google.cloud.kms.v1.SingleTenantHsmInstance.StateB\x03\xe0\x41\x03\x12Q\n\x0bquorum_auth\x18\x04 \x01(\x0b\x32\x37.google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuthB\x03\xe0\x41\x02\x12\x34\n\x0b\x64\x65lete_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12J\n\"unrefreshed_duration_until_disable\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12\x35\n\x0c\x64isable_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a~\n\nQuorumAuth\x12!\n\x14total_approver_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12$\n\x17required_approver_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\'\n\x1atwo_factor_public_key_pems\x18\x03 \x03(\tB\x03\xe0\x41\x03\"\xa6\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12(\n$PENDING_TWO_FACTOR_AUTH_REGISTRATION\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03\x12\r\n\tDISABLING\x10\x04\x12\x0c\n\x08\x44ISABLED\x10\x05\x12\x0c\n\x08\x44\x45LETING\x10\x06\x12\x0b\n\x07\x44\x45LETED\x10\x07\x12\n\n\x06\x46\x41ILED\x10\x08:\xc7\x01\xea\x41\xc3\x01\n/cloudkms.googleapis.com/SingleTenantHsmInstance\x12]projects/{project}/locations/{location}/singleTenantHsmInstances/{single_tenant_hsm_instance}*\x18singleTenantHsmInstances2\x17singleTenantHsmInstance\"\x99\x15\n\x1fSingleTenantHsmInstanceProposal\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x05state\x18\x03 \x01(\x0e\x32:.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.StateB\x03\xe0\x41\x03\x12\x1b\n\x0e\x66\x61ilure_reason\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12g\n\x11quorum_parameters\x18\x05 \x01(\x0b\x32\x45.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.QuorumParametersB\x03\xe0\x41\x03H\x00\x12\x85\x01\n!required_action_quorum_parameters\x18\x0e \x01(\x0b\x32S.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParametersB\x03\xe0\x41\x03H\x00\x12\x31\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12-\n\x03ttl\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x01\x12\x34\n\x0b\x64\x65lete_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\npurge_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12w\n\x1dregister_two_factor_auth_keys\x18\x08 \x01(\x0b\x32N.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RegisterTwoFactorAuthKeysH\x02\x12\x81\x01\n\"disable_single_tenant_hsm_instance\x18\t \x01(\x0b\x32S.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DisableSingleTenantHsmInstanceH\x02\x12\x7f\n!enable_single_tenant_hsm_instance\x18\n \x01(\x0b\x32R.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.EnableSingleTenantHsmInstanceH\x02\x12\x7f\n!delete_single_tenant_hsm_instance\x18\x0b \x01(\x0b\x32R.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DeleteSingleTenantHsmInstanceH\x02\x12\x61\n\x11\x61\x64\x64_quorum_member\x18\x0c \x01(\x0b\x32\x44.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.AddQuorumMemberH\x02\x12g\n\x14remove_quorum_member\x18\r \x01(\x0b\x32G.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RemoveQuorumMemberH\x02\x12\x81\x01\n\"refresh_single_tenant_hsm_instance\x18\x11 \x01(\x0b\x32S.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RefreshSingleTenantHsmInstanceH\x02\x1a\xa3\x01\n\x10QuorumParameters\x12$\n\x17required_approver_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x37\n\nchallenges\x18\x02 \x03(\x0b\x32\x1e.google.cloud.kms.v1.ChallengeB\x03\xe0\x41\x03\x12\x30\n#approved_two_factor_public_key_pems\x18\x03 \x03(\tB\x03\xe0\x41\x03\x1a\xfa\x01\n\x1eRequiredActionQuorumParameters\x12@\n\x13required_challenges\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.ChallengeB\x03\xe0\x41\x03\x12$\n\x17required_approver_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12>\n\x11quorum_challenges\x18\x03 \x03(\x0b\x32\x1e.google.cloud.kms.v1.ChallengeB\x03\xe0\x41\x03\x12\x30\n#approved_two_factor_public_key_pems\x18\x04 \x03(\tB\x03\xe0\x41\x03\x1aj\n\x19RegisterTwoFactorAuthKeys\x12$\n\x17required_approver_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\'\n\x1atwo_factor_public_key_pems\x18\x02 \x03(\tB\x03\xe0\x41\x02\x1a \n\x1e\x44isableSingleTenantHsmInstance\x1a\x1f\n\x1d\x45nableSingleTenantHsmInstance\x1a\x1f\n\x1d\x44\x65leteSingleTenantHsmInstance\x1a\x39\n\x0f\x41\x64\x64QuorumMember\x12&\n\x19two_factor_public_key_pem\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a<\n\x12RemoveQuorumMember\x12&\n\x19two_factor_public_key_pem\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a \n\x1eRefreshSingleTenantHsmInstance\"|\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\x0c\n\x08\x41PPROVED\x10\x03\x12\x0b\n\x07RUNNING\x10\x04\x12\r\n\tSUCCEEDED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x0b\n\x07\x44\x45LETED\x10\x07:\xf4\x01\xea\x41\xf0\x01\n7cloudkms.googleapis.com/SingleTenantHsmInstanceProposal\x12rprojects/{project}/locations/{location}/singleTenantHsmInstances/{single_tenant_hsm_instance}/proposals/{proposal}* singleTenantHsmInstanceProposals2\x1fsingleTenantHsmInstanceProposalB\x15\n\x13\x61pproval_parametersB\x0c\n\nexpirationB\x0b\n\toperation\"@\n\tChallenge\x12\x16\n\tchallenge\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x03\x12\x1b\n\x0epublic_key_pem\x18\x02 \x01(\tB\x03\xe0\x41\x03\"L\n\x0e\x43hallengeReply\x12\x1d\n\x10signed_challenge\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x1b\n\x0epublic_key_pem\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xd8\x01\n#ListSingleTenantHsmInstancesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cshow_deleted\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xa6\x01\n$ListSingleTenantHsmInstancesResponse\x12Q\n\x1bsingle_tenant_hsm_instances\x18\x01 \x03(\x0b\x32,.google.cloud.kms.v1.SingleTenantHsmInstance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"j\n!GetSingleTenantHsmInstanceRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/cloudkms.googleapis.com/SingleTenantHsmInstance\"\xe4\x01\n$CreateSingleTenantHsmInstanceRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12*\n\x1dsingle_tenant_hsm_instance_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12U\n\x1asingle_tenant_hsm_instance\x18\x03 \x01(\x0b\x32,.google.cloud.kms.v1.SingleTenantHsmInstanceB\x03\xe0\x41\x02\"\'\n%CreateSingleTenantHsmInstanceMetadata\"\x94\x02\n,CreateSingleTenantHsmInstanceProposalRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/cloudkms.googleapis.com/SingleTenantHsmInstance\x12\x33\n&single_tenant_hsm_instance_proposal_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x66\n#single_tenant_hsm_instance_proposal\x18\x03 \x01(\x0b\x32\x34.google.cloud.kms.v1.SingleTenantHsmInstanceProposalB\x03\xe0\x41\x02\"/\n-CreateSingleTenantHsmInstanceProposalMetadata\"z\n)GetSingleTenantHsmInstanceProposalRequest\x12M\n\x04name\x18\x01 \x01(\tB?\xe0\x41\x02\xfa\x41\x39\n7cloudkms.googleapis.com/SingleTenantHsmInstanceProposal\"\x97\x05\n-ApproveSingleTenantHsmInstanceProposalRequest\x12M\n\x04name\x18\x01 \x01(\tB?\xe0\x41\x02\xfa\x41\x39\n7cloudkms.googleapis.com/SingleTenantHsmInstanceProposal\x12k\n\x0cquorum_reply\x18\x02 \x01(\x0b\x32N.google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.QuorumReplyB\x03\xe0\x41\x02H\x00\x12\x89\x01\n\x1crequired_action_quorum_reply\x18\x03 \x01(\x0b\x32\\.google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.RequiredActionQuorumReplyB\x03\xe0\x41\x02H\x00\x1aR\n\x0bQuorumReply\x12\x43\n\x11\x63hallenge_replies\x18\x01 \x03(\x0b\x32#.google.cloud.kms.v1.ChallengeReplyB\x03\xe0\x41\x02\x1a\xb5\x01\n\x19RequiredActionQuorumReply\x12L\n\x1arequired_challenge_replies\x18\x01 \x03(\x0b\x32#.google.cloud.kms.v1.ChallengeReplyB\x03\xe0\x41\x02\x12J\n\x18quorum_challenge_replies\x18\x02 \x03(\x0b\x32#.google.cloud.kms.v1.ChallengeReplyB\x03\xe0\x41\x02\x42\x12\n\x10\x61pproval_payload\"0\n.ApproveSingleTenantHsmInstanceProposalResponse\"~\n-ExecuteSingleTenantHsmInstanceProposalRequest\x12M\n\x04name\x18\x01 \x01(\tB?\xe0\x41\x02\xfa\x41\x39\n7cloudkms.googleapis.com/SingleTenantHsmInstanceProposal\"0\n.ExecuteSingleTenantHsmInstanceProposalResponse\"0\n.ExecuteSingleTenantHsmInstanceProposalMetadata\"\xee\x01\n+ListSingleTenantHsmInstanceProposalsRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/cloudkms.googleapis.com/SingleTenantHsmInstance\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cshow_deleted\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xbf\x01\n,ListSingleTenantHsmInstanceProposalsResponse\x12\x62\n$single_tenant_hsm_instance_proposals\x18\x01 \x03(\x0b\x32\x34.google.cloud.kms.v1.SingleTenantHsmInstanceProposal\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"}\n,DeleteSingleTenantHsmInstanceProposalRequest\x12M\n\x04name\x18\x01 \x01(\tB?\xe0\x41\x02\xfa\x41\x39\n7cloudkms.googleapis.com/SingleTenantHsmInstanceProposal2\xa3\x15\n\rHsmManagement\x12\xe2\x01\n\x1cListSingleTenantHsmInstances\x12\x38.google.cloud.kms.v1.ListSingleTenantHsmInstancesRequest\x1a\x39.google.cloud.kms.v1.ListSingleTenantHsmInstancesResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12\x12.google.cloud.kms.v1.GetSingleTenantHsmInstanceProposalRequest\x1a\x34.google.cloud.kms.v1.SingleTenantHsmInstanceProposal\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J\x12H/v1/{name=projects/*/locations/*/singleTenantHsmInstances/*/proposals/*}\x12\x86\x02\n$ListSingleTenantHsmInstanceProposals\x12@.google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsRequest\x1a\x41.google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsResponse\"Y\xda\x41\x06parent\x82\xd3\xe4\x93\x02J\x12H/v1/{parent=projects/*/locations/*/singleTenantHsmInstances/*}/proposals\x12\xdb\x01\n%DeleteSingleTenantHsmInstanceProposal\x12\x41.google.cloud.kms.v1.DeleteSingleTenantHsmInstanceProposalRequest\x1a\x16.google.protobuf.Empty\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J*H/v1/{name=projects/*/locations/*/singleTenantHsmInstances/*/proposals/*}\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsB\x86\x01\n\x17\x63om.google.cloud.kms.v1B\x12HsmManagementProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Kms + module V1 + SingleTenantHsmInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstance").msgclass + SingleTenantHsmInstance::QuorumAuth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuth").msgclass + SingleTenantHsmInstance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstance.State").enummodule + SingleTenantHsmInstanceProposal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal").msgclass + SingleTenantHsmInstanceProposal::QuorumParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.QuorumParameters").msgclass + SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParameters").msgclass + SingleTenantHsmInstanceProposal::RegisterTwoFactorAuthKeys = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RegisterTwoFactorAuthKeys").msgclass + SingleTenantHsmInstanceProposal::DisableSingleTenantHsmInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DisableSingleTenantHsmInstance").msgclass + SingleTenantHsmInstanceProposal::EnableSingleTenantHsmInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.EnableSingleTenantHsmInstance").msgclass + SingleTenantHsmInstanceProposal::DeleteSingleTenantHsmInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DeleteSingleTenantHsmInstance").msgclass + SingleTenantHsmInstanceProposal::AddQuorumMember = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.AddQuorumMember").msgclass + SingleTenantHsmInstanceProposal::RemoveQuorumMember = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RemoveQuorumMember").msgclass + SingleTenantHsmInstanceProposal::RefreshSingleTenantHsmInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RefreshSingleTenantHsmInstance").msgclass + SingleTenantHsmInstanceProposal::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State").enummodule + Challenge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.Challenge").msgclass + ChallengeReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ChallengeReply").msgclass + ListSingleTenantHsmInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListSingleTenantHsmInstancesRequest").msgclass + ListSingleTenantHsmInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListSingleTenantHsmInstancesResponse").msgclass + GetSingleTenantHsmInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetSingleTenantHsmInstanceRequest").msgclass + CreateSingleTenantHsmInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateSingleTenantHsmInstanceRequest").msgclass + CreateSingleTenantHsmInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateSingleTenantHsmInstanceMetadata").msgclass + CreateSingleTenantHsmInstanceProposalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateSingleTenantHsmInstanceProposalRequest").msgclass + CreateSingleTenantHsmInstanceProposalMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateSingleTenantHsmInstanceProposalMetadata").msgclass + GetSingleTenantHsmInstanceProposalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetSingleTenantHsmInstanceProposalRequest").msgclass + ApproveSingleTenantHsmInstanceProposalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest").msgclass + ApproveSingleTenantHsmInstanceProposalRequest::QuorumReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.QuorumReply").msgclass + ApproveSingleTenantHsmInstanceProposalRequest::RequiredActionQuorumReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.RequiredActionQuorumReply").msgclass + ApproveSingleTenantHsmInstanceProposalResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalResponse").msgclass + ExecuteSingleTenantHsmInstanceProposalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalRequest").msgclass + ExecuteSingleTenantHsmInstanceProposalResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalResponse").msgclass + ExecuteSingleTenantHsmInstanceProposalMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalMetadata").msgclass + ListSingleTenantHsmInstanceProposalsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsRequest").msgclass + ListSingleTenantHsmInstanceProposalsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsResponse").msgclass + DeleteSingleTenantHsmInstanceProposalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteSingleTenantHsmInstanceProposalRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_services_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_services_pb.rb new file mode 100644 index 000000000000..06fadfb2ece2 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_services_pb.rb @@ -0,0 +1,91 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/kms/v1/hsm_management.proto for package 'google.cloud.kms.v1' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/kms/v1/hsm_management_pb' + +module Google + module Cloud + module Kms + module V1 + module HsmManagement + # Google Cloud HSM Management Service + # + # Provides interfaces for managing HSM instances. + # + # Implements a REST model with the following objects: + # * [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + # * [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.kms.v1.HsmManagement' + + # Lists + # [SingleTenantHsmInstances][google.cloud.kms.v1.SingleTenantHsmInstance]. + rpc :ListSingleTenantHsmInstances, ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest, ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse + # Returns metadata for a given + # [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + rpc :GetSingleTenantHsmInstance, ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest, ::Google::Cloud::Kms::V1::SingleTenantHsmInstance + # Creates a new + # [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] in a + # given Project and Location. User must create a RegisterTwoFactorAuthKeys + # proposal with this single-tenant HSM instance to finish setup of the + # instance. + rpc :CreateSingleTenantHsmInstance, ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest, ::Google::Longrunning::Operation + # Creates a new + # [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + # for a given + # [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + rpc :CreateSingleTenantHsmInstanceProposal, ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest, ::Google::Longrunning::Operation + # Approves a + # [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + # for a given + # [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. The + # proposal must be in the + # [PENDING][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State.PENDING] + # state. + rpc :ApproveSingleTenantHsmInstanceProposal, ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest, ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse + # Executes a + # [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + # for a given + # [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. The + # proposal must be in the + # [APPROVED][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State.APPROVED] + # state. + rpc :ExecuteSingleTenantHsmInstanceProposal, ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest, ::Google::Longrunning::Operation + # Returns metadata for a given + # [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + rpc :GetSingleTenantHsmInstanceProposal, ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest, ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal + # Lists + # [SingleTenantHsmInstanceProposals][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + rpc :ListSingleTenantHsmInstanceProposals, ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest, ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse + # Deletes a + # [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + rpc :DeleteSingleTenantHsmInstanceProposal, ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb new file mode 100644 index 000000000000..7880115892c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/kms/v1/version" + +require "google/cloud/kms/v1/key_management_service/credentials" +require "google/cloud/kms/v1/key_management_service/paths" +require "google/cloud/kms/v1/key_management_service/operations" +require "google/cloud/kms/v1/key_management_service/client" +require "google/cloud/kms/v1/key_management_service/rest" + +module Google + module Cloud + module Kms + module V1 + ## + # Google Cloud Key Management Service + # + # Manages cryptographic keys and operations using those keys. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::Kms::V1::KeyRing KeyRing} + # * {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} + # * {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # * {::Google::Cloud::Kms::V1::ImportJob ImportJob} + # + # If you are using manual gRPC libraries, see + # [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/kms/v1/key_management_service" + # client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/kms/v1/key_management_service/rest" + # client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + module KeyManagementService + end + end + end + end +end + +helper_path = ::File.join __dir__, "key_management_service", "helpers.rb" +require "google/cloud/kms/v1/key_management_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb new file mode 100644 index 000000000000..261bdad1b481 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb @@ -0,0 +1,4498 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/kms/v1/service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module Kms + module V1 + module KeyManagementService + ## + # Client for the KeyManagementService service. + # + # Google Cloud Key Management Service + # + # Manages cryptographic keys and operations using those keys. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::Kms::V1::KeyRing KeyRing} + # * {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} + # * {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # * {::Google::Cloud::Kms::V1::ImportJob ImportJob} + # + # If you are using manual gRPC libraries, see + # [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :key_management_service_stub + + ## + # Configure the KeyManagementService Client class. + # + # See {::Google::Cloud::Kms::V1::KeyManagementService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all KeyManagementService clients + # ::Google::Cloud::Kms::V1::KeyManagementService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Kms", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_key_rings.timeout = 60.0 + default_config.rpcs.list_key_rings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_crypto_keys.timeout = 60.0 + default_config.rpcs.list_crypto_keys.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_crypto_key_versions.timeout = 60.0 + default_config.rpcs.list_crypto_key_versions.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_import_jobs.timeout = 60.0 + default_config.rpcs.list_import_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_retired_resources.timeout = 60.0 + default_config.rpcs.list_retired_resources.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_key_ring.timeout = 60.0 + default_config.rpcs.get_key_ring.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_crypto_key.timeout = 60.0 + default_config.rpcs.get_crypto_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_crypto_key_version.timeout = 60.0 + default_config.rpcs.get_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_public_key.timeout = 60.0 + default_config.rpcs.get_public_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_import_job.timeout = 60.0 + default_config.rpcs.get_import_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_retired_resource.timeout = 60.0 + default_config.rpcs.get_retired_resource.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_key_ring.timeout = 60.0 + default_config.rpcs.create_key_ring.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_crypto_key.timeout = 60.0 + default_config.rpcs.create_crypto_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_crypto_key_version.timeout = 60.0 + + default_config.rpcs.delete_crypto_key.timeout = 60.0 + default_config.rpcs.delete_crypto_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_crypto_key_version.timeout = 60.0 + default_config.rpcs.delete_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.import_crypto_key_version.timeout = 60.0 + + default_config.rpcs.create_import_job.timeout = 60.0 + default_config.rpcs.create_import_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_crypto_key.timeout = 60.0 + default_config.rpcs.update_crypto_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_crypto_key_version.timeout = 60.0 + default_config.rpcs.update_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_crypto_key_primary_version.timeout = 60.0 + default_config.rpcs.update_crypto_key_primary_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.destroy_crypto_key_version.timeout = 60.0 + default_config.rpcs.destroy_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.restore_crypto_key_version.timeout = 60.0 + default_config.rpcs.restore_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.encrypt.timeout = 60.0 + default_config.rpcs.encrypt.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.decrypt.timeout = 60.0 + default_config.rpcs.decrypt.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.asymmetric_sign.timeout = 60.0 + default_config.rpcs.asymmetric_sign.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.asymmetric_decrypt.timeout = 60.0 + default_config.rpcs.asymmetric_decrypt.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.mac_sign.timeout = 60.0 + default_config.rpcs.mac_sign.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.mac_verify.timeout = 60.0 + default_config.rpcs.mac_verify.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.generate_random_bytes.timeout = 60.0 + default_config.rpcs.generate_random_bytes.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the KeyManagementService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Kms::V1::KeyManagementService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @key_management_service_stub.universe_domain + end + + ## + # Create a new KeyManagementService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the KeyManagementService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/kms/v1/service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @key_management_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Kms::V1::KeyManagementService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @key_management_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @key_management_service_stub.endpoint + config.universe_domain = @key_management_service_stub.universe_domain + config.logger = @key_management_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @key_management_service_stub.endpoint + config.universe_domain = @key_management_service_stub.universe_domain + config.logger = @key_management_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Kms::V1::KeyManagementService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @key_management_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::Kms::V1::KeyRing KeyRings}. + # + # @overload list_key_rings(request, options = nil) + # Pass arguments to `list_key_rings` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListKeyRingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListKeyRingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_key_rings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_key_rings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::KeyRing KeyRings} to include in the response. Further + # {::Google::Cloud::Kms::V1::KeyRing KeyRings} can subsequently be obtained by + # including the + # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token}. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListKeyRingsRequest.new + # + # # Call the list_key_rings method. + # result = client.list_key_rings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::KeyRing. + # p item + # end + # + def list_key_rings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListKeyRingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_key_rings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_key_rings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_key_rings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :list_key_rings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @key_management_service_stub, :list_key_rings, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # + # @overload list_crypto_keys(request, options = nil) + # Pass arguments to `list_crypto_keys` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListCryptoKeysRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListCryptoKeysRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_crypto_keys(parent: nil, page_size: nil, page_token: nil, version_view: nil, filter: nil, order_by: nil) + # Pass arguments to `list_crypto_keys` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} + # to list, in the format `projects/*/locations/*/keyRings/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} to include in the response. + # Further {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token}. + # @param version_view [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] + # The fields of the primary version to include in the response. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListCryptoKeysRequest.new + # + # # Call the list_crypto_keys method. + # result = client.list_crypto_keys request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::CryptoKey. + # p item + # end + # + def list_crypto_keys request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListCryptoKeysRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_crypto_keys.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_crypto_keys.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_crypto_keys.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :list_crypto_keys, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @key_management_service_stub, :list_crypto_keys, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. + # + # @overload list_crypto_key_versions(request, options = nil) + # Pass arguments to `list_crypto_key_versions` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_crypto_key_versions(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil, order_by: nil) + # Pass arguments to `list_crypto_key_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to list, in the format + # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} to include in the + # response. Further {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} + # can subsequently be obtained by including the + # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token}. + # @param view [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] + # The fields to include in the response. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new + # + # # Call the list_crypto_key_versions method. + # result = client.list_crypto_key_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::CryptoKeyVersion. + # p item + # end + # + def list_crypto_key_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_crypto_key_versions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_crypto_key_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_crypto_key_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :list_crypto_key_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @key_management_service_stub, :list_crypto_key_versions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. + # + # @overload list_import_jobs(request, options = nil) + # Pass arguments to `list_import_jobs` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListImportJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListImportJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_import_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_import_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} + # to list, in the format `projects/*/locations/*/keyRings/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::ImportJob ImportJobs} to include in the response. + # Further {::Google::Cloud::Kms::V1::ImportJob ImportJobs} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token}. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListImportJobsRequest.new + # + # # Call the list_import_jobs method. + # result = client.list_import_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::ImportJob. + # p item + # end + # + def list_import_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListImportJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_import_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_import_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_import_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :list_import_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @key_management_service_stub, :list_import_jobs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} which are + # the records of deleted {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # RetiredResources prevent the reuse of these resource names after deletion. + # + # @overload list_retired_resources(request, options = nil) + # Pass arguments to `list_retired_resources` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListRetiredResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_retired_resources(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_retired_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project-specific location holding the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} to be included in + # the response. Further + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new + # + # # Call the list_retired_resources method. + # result = client.list_retired_resources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::RetiredResource. + # p item + # end + # + def list_retired_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_retired_resources.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_retired_resources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_retired_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :list_retired_resources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @key_management_service_stub, :list_retired_resources, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given {::Google::Cloud::Kms::V1::KeyRing KeyRing}. + # + # @overload get_key_ring(request, options = nil) + # Pass arguments to `get_key_ring` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetKeyRingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetKeyRingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_key_ring(name: nil) + # Pass arguments to `get_key_ring` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the + # {::Google::Cloud::Kms::V1::KeyRing KeyRing} to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::KeyRing] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::KeyRing] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetKeyRingRequest.new + # + # # Call the get_key_ring method. + # result = client.get_key_ring request + # + # # The returned object is of type Google::Cloud::Kms::V1::KeyRing. + # p result + # + def get_key_ring request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetKeyRingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_key_ring.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_key_ring.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_key_ring.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :get_key_ring, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}, as + # well as its {::Google::Cloud::Kms::V1::CryptoKey#primary primary} + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. + # + # @overload get_crypto_key(request, options = nil) + # Pass arguments to `get_crypto_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetCryptoKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetCryptoKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_crypto_key(name: nil) + # Pass arguments to `get_crypto_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetCryptoKeyRequest.new + # + # # Call the get_crypto_key method. + # result = client.get_crypto_key request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + # p result + # + def get_crypto_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetCryptoKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_crypto_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_crypto_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_crypto_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :get_crypto_key, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. + # + # @overload get_crypto_key_version(request, options = nil) + # Pass arguments to `get_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_crypto_key_version(name: nil) + # Pass arguments to `get_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new + # + # # Call the get_crypto_key_version method. + # result = client.get_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def get_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_crypto_key_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :get_crypto_key_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the public key for the given + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. The + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_SIGN ASYMMETRIC_SIGN} + # or + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_DECRYPT ASYMMETRIC_DECRYPT}. + # + # @overload get_public_key(request, options = nil) + # Pass arguments to `get_public_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetPublicKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetPublicKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_public_key(name: nil, public_key_format: nil) + # Pass arguments to `get_public_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key to get. + # @param public_key_format [::Google::Cloud::Kms::V1::PublicKey::PublicKeyFormat] + # Optional. The {::Google::Cloud::Kms::V1::PublicKey PublicKey} format specified + # by the user. This field is required for PQC algorithms. If specified, the + # public key will be exported through the + # {::Google::Cloud::Kms::V1::PublicKey#public_key public_key} field in the + # requested format. Otherwise, the {::Google::Cloud::Kms::V1::PublicKey#pem pem} + # field will be populated for non-PQC algorithms, and an error will be + # returned for PQC algorithms. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::PublicKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::PublicKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetPublicKeyRequest.new + # + # # Call the get_public_key method. + # result = client.get_public_key request + # + # # The returned object is of type Google::Cloud::Kms::V1::PublicKey. + # p result + # + def get_public_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetPublicKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_public_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_public_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_public_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :get_public_key, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given {::Google::Cloud::Kms::V1::ImportJob ImportJob}. + # + # @overload get_import_job(request, options = nil) + # Pass arguments to `get_import_job` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetImportJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetImportJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_import_job(name: nil) + # Pass arguments to `get_import_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the + # {::Google::Cloud::Kms::V1::ImportJob ImportJob} to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::ImportJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::ImportJob] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetImportJobRequest.new + # + # # Call the get_import_job method. + # result = client.get_import_job request + # + # # The returned object is of type Google::Cloud::Kms::V1::ImportJob. + # p result + # + def get_import_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetImportJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_import_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_import_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_import_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :get_import_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a specific {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} + # resource, which represents the record of a deleted + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload get_retired_resource(request, options = nil) + # Pass arguments to `get_retired_resource` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetRetiredResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetRetiredResourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_retired_resource(name: nil) + # Pass arguments to `get_retired_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::RetiredResource#name name} of the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::RetiredResource] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::RetiredResource] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetRetiredResourceRequest.new + # + # # Call the get_retired_resource method. + # result = client.get_retired_resource request + # + # # The returned object is of type Google::Cloud::Kms::V1::RetiredResource. + # p result + # + def get_retired_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetRetiredResourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_retired_resource.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_retired_resource.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_retired_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :get_retired_resource, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a new {::Google::Cloud::Kms::V1::KeyRing KeyRing} in a given Project and + # Location. + # + # @overload create_key_ring(request, options = nil) + # Pass arguments to `create_key_ring` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateKeyRingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateKeyRingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_key_ring(parent: nil, key_ring_id: nil, key_ring: nil) + # Pass arguments to `create_key_ring` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format + # `projects/*/locations/*`. + # @param key_ring_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param key_ring [::Google::Cloud::Kms::V1::KeyRing, ::Hash] + # Required. A {::Google::Cloud::Kms::V1::KeyRing KeyRing} with initial field + # values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::KeyRing] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::KeyRing] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateKeyRingRequest.new + # + # # Call the create_key_ring method. + # result = client.create_key_ring request + # + # # The returned object is of type Google::Cloud::Kms::V1::KeyRing. + # p result + # + def create_key_ring request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateKeyRingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_key_ring.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_key_ring.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_key_ring.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :create_key_ring, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a new {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} within a + # {::Google::Cloud::Kms::V1::KeyRing KeyRing}. + # + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} and + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#algorithm CryptoKey.version_template.algorithm} + # are required. + # + # @overload create_crypto_key(request, options = nil) + # Pass arguments to `create_crypto_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateCryptoKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateCryptoKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_crypto_key(parent: nil, crypto_key_id: nil, crypto_key: nil, skip_initial_version_creation: nil) + # Pass arguments to `create_crypto_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the KeyRing + # associated with the {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # @param crypto_key_id [::String] + # Required. It must be unique within a KeyRing and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param crypto_key [::Google::Cloud::Kms::V1::CryptoKey, ::Hash] + # Required. A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with initial field + # values. + # @param skip_initial_version_creation [::Boolean] + # If set to true, the request will create a + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} without any + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. You must + # manually call + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} + # or + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version ImportCryptoKeyVersion} + # before you can use this {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new + # + # # Call the create_crypto_key method. + # result = client.create_crypto_key request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + # p result + # + def create_crypto_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_crypto_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_crypto_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_crypto_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :create_crypto_key, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a new {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in a + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # The server will assign the next sequential id. If unset, + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will be set to + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED}. + # + # @overload create_crypto_key_version(request, options = nil) + # Pass arguments to `create_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_crypto_key_version(parent: nil, crypto_key_version: nil) + # Pass arguments to `create_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} associated with the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. + # @param crypto_key_version [::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash] + # Required. A {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with + # initial field values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new + # + # # Call the create_crypto_key_version method. + # result = client.create_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def create_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_crypto_key_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :create_crypto_key_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes the given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # All child {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} must + # have been previously deleted using + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion}. + # The specified crypto key will be immediately and permanently deleted upon + # calling this method. This action cannot be undone. + # + # @overload delete_crypto_key(request, options = nil) + # Pass arguments to `delete_crypto_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_crypto_key(name: nil) + # Pass arguments to `delete_crypto_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new + # + # # Call the delete_crypto_key method. + # result = client.delete_crypto_key request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_crypto_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_crypto_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_crypto_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_crypto_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :delete_crypto_key, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes the given + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Only possible if + # the version has not been previously imported and if its + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is one of + # [DESTROYED][CryptoKeyVersionState.DESTROYED], + # [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or + # [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. + # Successfully imported + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} cannot be deleted + # at this time. The specified version will be immediately and permanently + # deleted upon calling this method. This action cannot be undone. + # + # @overload delete_crypto_key_version(request, options = nil) + # Pass arguments to `delete_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_crypto_key_version(name: nil) + # Pass arguments to `delete_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new + # + # # Call the delete_crypto_key_version method. + # result = client.delete_crypto_key_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_crypto_key_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :delete_crypto_key_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Import wrapped key material into a + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. + # + # All requests must specify a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. If + # a {::Google::Cloud::Kms::V1::CryptoKeyVersion 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 {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload import_crypto_key_version(request, options = nil) + # Pass arguments to `import_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_crypto_key_version(parent: nil, crypto_key_version: nil, algorithm: nil, import_job: nil, wrapped_key: nil, rsa_aes_wrapped_key: nil) + # Pass arguments to `import_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to be imported into. + # + # The create permission is only required on this key when creating a new + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. + # @param crypto_key_version [::String] + # Optional. The optional {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of + # an existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to + # target for an import operation. If this field is not present, a new + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} containing the + # supplied key material is created. + # + # If this field is present, the supplied key material is imported into + # the existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. To + # import into an existing + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} must be a child of + # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#parent ImportCryptoKeyVersionRequest.parent}, + # have been previously created via + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version ImportCryptoKeyVersion}, + # and be in + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED} + # or + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::IMPORT_FAILED IMPORT_FAILED} + # state. The key material and algorithm must match the previous + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} exactly if the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} has ever contained + # key material. + # @param algorithm [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] + # Required. The + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm algorithm} + # of the key being imported. This does not need to match the + # {::Google::Cloud::Kms::V1::CryptoKey#version_template version_template} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} this version imports into. + # @param import_job [::String] + # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the + # {::Google::Cloud::Kms::V1::ImportJob ImportJob} that was used to wrap this key + # material. + # @param wrapped_key [::String] + # 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 + # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA1_AES_256 RSA_OAEP_3072_SHA1_AES_256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA1_AES_256 RSA_OAEP_4096_SHA1_AES_256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256_AES_256 RSA_OAEP_3072_SHA256_AES_256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256_AES_256 RSA_OAEP_4096_SHA256_AES_256}), + # + # this field must contain the concatenation of: + #
    + #
  1. An ephemeral AES-256 wrapping key wrapped with the + # {::Google::Cloud::Kms::V1::ImportJob#public_key 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 + # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256 RSA_OAEP_3072_SHA256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256 RSA_OAEP_4096_SHA256}), + # + # this field must contain the formatted key to be imported, wrapped with the + # {::Google::Cloud::Kms::V1::ImportJob#public_key public_key} using RSAES-OAEP + # with SHA-256, MGF1 with SHA-256, and an empty label. + # @param rsa_aes_wrapped_key [::String] + # Optional. This field has the same meaning as + # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#wrapped_key wrapped_key}. + # Prefer to use that field in new work. Either that field or this field + # (but not both) must be specified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new + # + # # Call the import_crypto_key_version method. + # result = client.import_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def import_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_crypto_key_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :import_crypto_key_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a new {::Google::Cloud::Kms::V1::ImportJob ImportJob} within a + # {::Google::Cloud::Kms::V1::KeyRing KeyRing}. + # + # {::Google::Cloud::Kms::V1::ImportJob#import_method ImportJob.import_method} is + # required. + # + # @overload create_import_job(request, options = nil) + # Pass arguments to `create_import_job` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateImportJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateImportJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_import_job(parent: nil, import_job_id: nil, import_job: nil) + # Pass arguments to `create_import_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the + # {::Google::Cloud::Kms::V1::KeyRing KeyRing} associated with the + # {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. + # @param import_job_id [::String] + # Required. It must be unique within a KeyRing and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param import_job [::Google::Cloud::Kms::V1::ImportJob, ::Hash] + # Required. An {::Google::Cloud::Kms::V1::ImportJob ImportJob} with initial field + # values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::ImportJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::ImportJob] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateImportJobRequest.new + # + # # Call the create_import_job method. + # result = client.create_import_job request + # + # # The returned object is of type Google::Cloud::Kms::V1::ImportJob. + # p result + # + def create_import_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateImportJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_import_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_import_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_import_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :create_import_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload update_crypto_key(request, options = nil) + # Pass arguments to `update_crypto_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_crypto_key(crypto_key: nil, update_mask: nil) + # Pass arguments to `update_crypto_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param crypto_key [::Google::Cloud::Kms::V1::CryptoKey, ::Hash] + # Required. {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new + # + # # Call the update_crypto_key method. + # result = client.update_crypto_key request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + # p result + # + def update_crypto_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_crypto_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.crypto_key&.name + header_params["crypto_key.name"] = request.crypto_key.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_crypto_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_crypto_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :update_crypto_key, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s + # metadata. + # + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} may be changed between + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} + # and + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED} + # using this method. See + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version DestroyCryptoKeyVersion} + # and + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version RestoreCryptoKeyVersion} + # to move between other states. + # + # @overload update_crypto_key_version(request, options = nil) + # Pass arguments to `update_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_crypto_key_version(crypto_key_version: nil, update_mask: nil) + # Pass arguments to `update_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param crypto_key_version [::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash] + # Required. {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with + # updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new + # + # # Call the update_crypto_key_version method. + # result = client.update_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def update_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.crypto_key_version&.name + header_params["crypto_key_version.name"] = request.crypto_key_version.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_crypto_key_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :update_crypto_key_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update the version of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that + # will be used in + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt}. + # + # Returns an error if called on a key whose purpose is not + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. + # + # @overload update_crypto_key_primary_version(request, options = nil) + # Pass arguments to `update_crypto_key_primary_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_crypto_key_primary_version(name: nil, crypto_key_version_id: nil) + # Pass arguments to `update_crypto_key_primary_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to update. + # @param crypto_key_version_id [::String] + # Required. The id of the child + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use as primary. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new + # + # # Call the update_crypto_key_primary_version method. + # result = client.update_crypto_key_primary_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + # p result + # + def update_crypto_key_primary_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_crypto_key_primary_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_crypto_key_primary_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_crypto_key_primary_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :update_crypto_key_primary_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Schedule a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} for + # destruction. + # + # Upon calling this method, + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state CryptoKeyVersion.state} will + # be set to + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED}, + # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will + # be set to the time + # {::Google::Cloud::Kms::V1::CryptoKey#destroy_scheduled_duration destroy_scheduled_duration} + # in the future. At that time, the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will automatically + # change to + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}, + # and the key material will be irrevocably destroyed. + # + # Before the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} is + # reached, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version RestoreCryptoKeyVersion} + # may be called to reverse the process. + # + # @overload destroy_crypto_key_version(request, options = nil) + # Pass arguments to `destroy_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload destroy_crypto_key_version(name: nil) + # Pass arguments to `destroy_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to destroy. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new + # + # # Call the destroy_crypto_key_version method. + # result = client.destroy_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def destroy_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.destroy_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.destroy_crypto_key_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.destroy_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :destroy_crypto_key_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Restore a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED} + # state. + # + # Upon restoration of the CryptoKeyVersion, + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will be set to + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED}, + # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will + # be cleared. + # + # @overload restore_crypto_key_version(request, options = nil) + # Pass arguments to `restore_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload restore_crypto_key_version(name: nil) + # Pass arguments to `restore_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to restore. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new + # + # # Call the restore_crypto_key_version method. + # result = client.restore_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def restore_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.restore_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.restore_crypto_key_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restore_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :restore_crypto_key_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Encrypts data, so that it can only be recovered by a call to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt Decrypt}. The + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. + # + # @overload encrypt(request, options = nil) + # Pass arguments to `encrypt` via a request object, either of type + # {::Google::Cloud::Kms::V1::EncryptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::EncryptRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil) + # Pass arguments to `encrypt` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} or + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # encryption. + # + # If a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is specified, the server + # will use its {::Google::Cloud::Kms::V1::CryptoKey#primary primary version}. + # @param plaintext [::String] + # Required. The data to encrypt. Must be no larger than 64KiB. + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys, the + # plaintext must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @param additional_authenticated_data [::String] + # Optional. Optional data that, if specified, must also be provided during + # decryption through + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys the + # AAD must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @param plaintext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}) + # is equal to + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c 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. + # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}) + # is equal to + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::EncryptResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::EncryptResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::EncryptRequest.new + # + # # Call the encrypt method. + # result = client.encrypt request + # + # # The returned object is of type Google::Cloud::Kms::V1::EncryptResponse. + # p result + # + def encrypt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::EncryptRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.encrypt.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.encrypt.timeout, + metadata: metadata, + retry_policy: @config.rpcs.encrypt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :encrypt, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Decrypts data that was protected by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt}. The + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. + # + # @overload decrypt(request, options = nil) + # Pass arguments to `decrypt` via a request object, either of type + # {::Google::Cloud::Kms::V1::DecryptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DecryptRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil) + # Pass arguments to `decrypt` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to use for decryption. The + # server will choose the appropriate version. + # @param ciphertext [::String] + # Required. The encrypted data originally returned in + # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext EncryptResponse.ciphertext}. + # @param additional_authenticated_data [::String] + # Optional. Optional data that must match the data originally supplied in + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. + # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}) + # is equal to + # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext_crc32c 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. + # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}) + # is equal to + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data_crc32c 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::DecryptResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::DecryptResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DecryptRequest.new + # + # # Call the decrypt method. + # result = client.decrypt request + # + # # The returned object is of type Google::Cloud::Kms::V1::DecryptResponse. + # p result + # + def decrypt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DecryptRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.decrypt.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.decrypt.timeout, + metadata: metadata, + retry_policy: @config.rpcs.decrypt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :decrypt, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Encrypts data using portable cryptographic primitives. Most users should + # choose {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt} and + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt Decrypt} rather than + # their raw counterparts. The + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::RAW_ENCRYPT_DECRYPT RAW_ENCRYPT_DECRYPT}. + # + # @overload raw_encrypt(request, options = nil) + # Pass arguments to `raw_encrypt` via a request object, either of type + # {::Google::Cloud::Kms::V1::RawEncryptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::RawEncryptRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload raw_encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector: nil, initialization_vector_crc32c: nil) + # Pass arguments to `raw_encrypt` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # encryption. + # @param plaintext [::String] + # Required. The data to encrypt. Must be no larger than 64KiB. + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the + # plaintext must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @param additional_authenticated_data [::String] + # Optional. Optional data that, if specified, must also be provided during + # decryption through + # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. + # + # This field may only be used in conjunction with an + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm} that accepts + # additional authenticated data (for example, AES-GCM). + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the + # plaintext must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @param plaintext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext RawEncryptRequest.plaintext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received plaintext using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received additional_authenticated_data using + # this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + # @param initialization_vector [::String] + # 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 + # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. + # @param initialization_vector_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector RawEncryptRequest.initialization_vector}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received initialization_vector using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::RawEncryptResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::RawEncryptResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::RawEncryptRequest.new + # + # # Call the raw_encrypt method. + # result = client.raw_encrypt request + # + # # The returned object is of type Google::Cloud::Kms::V1::RawEncryptResponse. + # p result + # + def raw_encrypt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RawEncryptRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.raw_encrypt.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.raw_encrypt.timeout, + metadata: metadata, + retry_policy: @config.rpcs.raw_encrypt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :raw_encrypt, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Decrypts data that was originally encrypted using a raw cryptographic + # mechanism. The {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # must be + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::RAW_ENCRYPT_DECRYPT RAW_ENCRYPT_DECRYPT}. + # + # @overload raw_decrypt(request, options = nil) + # Pass arguments to `raw_decrypt` via a request object, either of type + # {::Google::Cloud::Kms::V1::RawDecryptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::RawDecryptRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload raw_decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, initialization_vector: nil, tag_length: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector_crc32c: nil) + # Pass arguments to `raw_decrypt` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # decryption. + # @param ciphertext [::String] + # Required. The encrypted data originally returned in + # {::Google::Cloud::Kms::V1::RawEncryptResponse#ciphertext RawEncryptResponse.ciphertext}. + # @param additional_authenticated_data [::String] + # Optional. Optional data that must match the data originally supplied in + # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. + # @param initialization_vector [::String] + # Required. The initialization vector (IV) used during encryption, which must + # match the data originally provided in + # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. + # @param tag_length [::Integer] + # 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). + # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext RawDecryptRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received ciphertext using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received additional_authenticated_data using + # this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + # @param initialization_vector_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector RawDecryptRequest.initialization_vector}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received initialization_vector using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::RawDecryptResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::RawDecryptResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::RawDecryptRequest.new + # + # # Call the raw_decrypt method. + # result = client.raw_decrypt request + # + # # The returned object is of type Google::Cloud::Kms::V1::RawDecryptResponse. + # p result + # + def raw_decrypt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RawDecryptRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.raw_decrypt.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.raw_decrypt.timeout, + metadata: metadata, + retry_policy: @config.rpcs.raw_decrypt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :raw_decrypt, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # ASYMMETRIC_SIGN, producing a signature that can be verified with the public + # key retrieved from + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey}. + # + # @overload asymmetric_sign(request, options = nil) + # Pass arguments to `asymmetric_sign` via a request object, either of type + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::AsymmetricSignRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload asymmetric_sign(name: nil, digest: nil, digest_crc32c: nil, data: nil, data_crc32c: nil) + # Pass arguments to `asymmetric_sign` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # signing. + # @param digest [::Google::Cloud::Kms::V1::Digest, ::Hash] + # 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 + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm}. + # + # This field may not be supplied if + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} + # is supplied. + # @param digest_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}) + # is equal to + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c 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. + # @param data [::String] + # Optional. The data to sign. + # It can't be supplied if + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} + # is supplied. + # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}) + # is equal to + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::AsymmetricSignResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::AsymmetricSignResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::AsymmetricSignRequest.new + # + # # Call the asymmetric_sign method. + # result = client.asymmetric_sign request + # + # # The returned object is of type Google::Cloud::Kms::V1::AsymmetricSignResponse. + # p result + # + def asymmetric_sign request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::AsymmetricSignRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.asymmetric_sign.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.asymmetric_sign.timeout, + metadata: metadata, + retry_policy: @config.rpcs.asymmetric_sign.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :asymmetric_sign, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Decrypts data that was encrypted with a public key retrieved from + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey} + # corresponding to a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # ASYMMETRIC_DECRYPT. + # + # @overload asymmetric_decrypt(request, options = nil) + # Pass arguments to `asymmetric_decrypt` via a request object, either of type + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::AsymmetricDecryptRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload asymmetric_decrypt(name: nil, ciphertext: nil, ciphertext_crc32c: nil) + # Pass arguments to `asymmetric_decrypt` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # decryption. + # @param ciphertext [::String] + # Required. The data encrypted with the named + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s public key using + # OAEP. + # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}) + # is equal to + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new + # + # # Call the asymmetric_decrypt method. + # result = client.asymmetric_decrypt request + # + # # The returned object is of type Google::Cloud::Kms::V1::AsymmetricDecryptResponse. + # p result + # + def asymmetric_decrypt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.asymmetric_decrypt.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.asymmetric_decrypt.timeout, + metadata: metadata, + retry_policy: @config.rpcs.asymmetric_decrypt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :asymmetric_decrypt, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} MAC, + # producing a tag that can be verified by another source with the same key. + # + # @overload mac_sign(request, options = nil) + # Pass arguments to `mac_sign` via a request object, either of type + # {::Google::Cloud::Kms::V1::MacSignRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::MacSignRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mac_sign(name: nil, data: nil, data_crc32c: nil) + # Pass arguments to `mac_sign` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # signing. + # @param data [::String] + # Required. The data to sign. The MAC tag is computed over this data field + # based on the specific algorithm. + # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}. If + # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} + # will verify the integrity of the received + # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} + # will report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}) is + # equal to + # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::MacSignResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::MacSignResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::MacSignRequest.new + # + # # Call the mac_sign method. + # result = client.mac_sign request + # + # # The returned object is of type Google::Cloud::Kms::V1::MacSignResponse. + # p result + # + def mac_sign request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::MacSignRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mac_sign.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mac_sign.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mac_sign.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :mac_sign, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Verifies MAC tag using a + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} MAC, and returns + # a response that indicates whether or not the verification was successful. + # + # @overload mac_verify(request, options = nil) + # Pass arguments to `mac_verify` via a request object, either of type + # {::Google::Cloud::Kms::V1::MacVerifyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::MacVerifyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mac_verify(name: nil, data: nil, data_crc32c: nil, mac: nil, mac_crc32c: nil) + # Pass arguments to `mac_verify` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # verification. + # @param data [::String] + # Required. The data used previously as a + # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} to generate + # the MAC tag. + # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}. If + # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} + # will verify the integrity of the received + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data} using + # this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}) + # is equal to + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c 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. + # @param mac [::String] + # Required. The signature to verify. + # @param mac_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}. If + # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} + # will verify the integrity of the received + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac} using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} + # will report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}) is + # equal to + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::MacVerifyResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::MacVerifyResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::MacVerifyRequest.new + # + # # Call the mac_verify method. + # result = client.mac_verify request + # + # # The returned object is of type Google::Cloud::Kms::V1::MacVerifyResponse. + # p result + # + def mac_verify request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::MacVerifyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mac_verify.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mac_verify.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mac_verify.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :mac_verify, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Decapsulates data that was encapsulated with a public key retrieved from + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey} + # corresponding to a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # KEY_ENCAPSULATION. + # + # @overload decapsulate(request, options = nil) + # Pass arguments to `decapsulate` via a request object, either of type + # {::Google::Cloud::Kms::V1::DecapsulateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DecapsulateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload decapsulate(name: nil, ciphertext: nil, ciphertext_crc32c: nil) + # Pass arguments to `decapsulate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # decapsulation. + # @param ciphertext [::String] + # Required. The ciphertext produced from encapsulation with the + # named {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public + # key(s). + # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. A CRC32C checksum of the + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}) + # is equal to + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::DecapsulateResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::DecapsulateResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DecapsulateRequest.new + # + # # Call the decapsulate method. + # result = client.decapsulate request + # + # # The returned object is of type Google::Cloud::Kms::V1::DecapsulateResponse. + # p result + # + def decapsulate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DecapsulateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.decapsulate.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.decapsulate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.decapsulate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :decapsulate, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Generate random bytes using the Cloud KMS randomness source in the provided + # location. + # + # @overload generate_random_bytes(request, options = nil) + # Pass arguments to `generate_random_bytes` via a request object, either of type + # {::Google::Cloud::Kms::V1::GenerateRandomBytesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GenerateRandomBytesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_random_bytes(location: nil, length_bytes: nil, protection_level: nil) + # Pass arguments to `generate_random_bytes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param location [::String] + # The project-specific location in which to generate random bytes. + # For example, "projects/my-project/locations/us-central1". + # @param length_bytes [::Integer] + # The length in bytes of the amount of randomness to retrieve. Minimum 8 + # bytes, maximum 1024 bytes. + # @param protection_level [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} to use when + # generating the random data. Currently, only + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} protection level is + # supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new + # + # # Call the generate_random_bytes method. + # result = client.generate_random_bytes request + # + # # The returned object is of type Google::Cloud::Kms::V1::GenerateRandomBytesResponse. + # p result + # + def generate_random_bytes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_random_bytes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.location + header_params["location"] = request.location + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_random_bytes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_random_bytes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :generate_random_bytes, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the KeyManagementService API. + # + # This class represents the configuration for KeyManagementService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Kms::V1::KeyManagementService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_key_rings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Kms::V1::KeyManagementService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_key_rings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_key_rings.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the KeyManagementService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_key_rings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_key_rings + ## + # RPC-specific configuration for `list_crypto_keys` + # @return [::Gapic::Config::Method] + # + attr_reader :list_crypto_keys + ## + # RPC-specific configuration for `list_crypto_key_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_crypto_key_versions + ## + # RPC-specific configuration for `list_import_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_import_jobs + ## + # RPC-specific configuration for `list_retired_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_retired_resources + ## + # RPC-specific configuration for `get_key_ring` + # @return [::Gapic::Config::Method] + # + attr_reader :get_key_ring + ## + # RPC-specific configuration for `get_crypto_key` + # @return [::Gapic::Config::Method] + # + attr_reader :get_crypto_key + ## + # RPC-specific configuration for `get_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_crypto_key_version + ## + # RPC-specific configuration for `get_public_key` + # @return [::Gapic::Config::Method] + # + attr_reader :get_public_key + ## + # RPC-specific configuration for `get_import_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_import_job + ## + # RPC-specific configuration for `get_retired_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_retired_resource + ## + # RPC-specific configuration for `create_key_ring` + # @return [::Gapic::Config::Method] + # + attr_reader :create_key_ring + ## + # RPC-specific configuration for `create_crypto_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_crypto_key + ## + # RPC-specific configuration for `create_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :create_crypto_key_version + ## + # RPC-specific configuration for `delete_crypto_key` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_crypto_key + ## + # RPC-specific configuration for `delete_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_crypto_key_version + ## + # RPC-specific configuration for `import_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :import_crypto_key_version + ## + # RPC-specific configuration for `create_import_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_import_job + ## + # RPC-specific configuration for `update_crypto_key` + # @return [::Gapic::Config::Method] + # + attr_reader :update_crypto_key + ## + # RPC-specific configuration for `update_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :update_crypto_key_version + ## + # RPC-specific configuration for `update_crypto_key_primary_version` + # @return [::Gapic::Config::Method] + # + attr_reader :update_crypto_key_primary_version + ## + # RPC-specific configuration for `destroy_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :destroy_crypto_key_version + ## + # RPC-specific configuration for `restore_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_crypto_key_version + ## + # RPC-specific configuration for `encrypt` + # @return [::Gapic::Config::Method] + # + attr_reader :encrypt + ## + # RPC-specific configuration for `decrypt` + # @return [::Gapic::Config::Method] + # + attr_reader :decrypt + ## + # RPC-specific configuration for `raw_encrypt` + # @return [::Gapic::Config::Method] + # + attr_reader :raw_encrypt + ## + # RPC-specific configuration for `raw_decrypt` + # @return [::Gapic::Config::Method] + # + attr_reader :raw_decrypt + ## + # RPC-specific configuration for `asymmetric_sign` + # @return [::Gapic::Config::Method] + # + attr_reader :asymmetric_sign + ## + # RPC-specific configuration for `asymmetric_decrypt` + # @return [::Gapic::Config::Method] + # + attr_reader :asymmetric_decrypt + ## + # RPC-specific configuration for `mac_sign` + # @return [::Gapic::Config::Method] + # + attr_reader :mac_sign + ## + # RPC-specific configuration for `mac_verify` + # @return [::Gapic::Config::Method] + # + attr_reader :mac_verify + ## + # RPC-specific configuration for `decapsulate` + # @return [::Gapic::Config::Method] + # + attr_reader :decapsulate + ## + # RPC-specific configuration for `generate_random_bytes` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_random_bytes + + # @private + def initialize parent_rpcs = nil + list_key_rings_config = parent_rpcs.list_key_rings if parent_rpcs.respond_to? :list_key_rings + @list_key_rings = ::Gapic::Config::Method.new list_key_rings_config + list_crypto_keys_config = parent_rpcs.list_crypto_keys if parent_rpcs.respond_to? :list_crypto_keys + @list_crypto_keys = ::Gapic::Config::Method.new list_crypto_keys_config + list_crypto_key_versions_config = parent_rpcs.list_crypto_key_versions if parent_rpcs.respond_to? :list_crypto_key_versions + @list_crypto_key_versions = ::Gapic::Config::Method.new list_crypto_key_versions_config + list_import_jobs_config = parent_rpcs.list_import_jobs if parent_rpcs.respond_to? :list_import_jobs + @list_import_jobs = ::Gapic::Config::Method.new list_import_jobs_config + list_retired_resources_config = parent_rpcs.list_retired_resources if parent_rpcs.respond_to? :list_retired_resources + @list_retired_resources = ::Gapic::Config::Method.new list_retired_resources_config + get_key_ring_config = parent_rpcs.get_key_ring if parent_rpcs.respond_to? :get_key_ring + @get_key_ring = ::Gapic::Config::Method.new get_key_ring_config + get_crypto_key_config = parent_rpcs.get_crypto_key if parent_rpcs.respond_to? :get_crypto_key + @get_crypto_key = ::Gapic::Config::Method.new get_crypto_key_config + get_crypto_key_version_config = parent_rpcs.get_crypto_key_version if parent_rpcs.respond_to? :get_crypto_key_version + @get_crypto_key_version = ::Gapic::Config::Method.new get_crypto_key_version_config + get_public_key_config = parent_rpcs.get_public_key if parent_rpcs.respond_to? :get_public_key + @get_public_key = ::Gapic::Config::Method.new get_public_key_config + get_import_job_config = parent_rpcs.get_import_job if parent_rpcs.respond_to? :get_import_job + @get_import_job = ::Gapic::Config::Method.new get_import_job_config + get_retired_resource_config = parent_rpcs.get_retired_resource if parent_rpcs.respond_to? :get_retired_resource + @get_retired_resource = ::Gapic::Config::Method.new get_retired_resource_config + create_key_ring_config = parent_rpcs.create_key_ring if parent_rpcs.respond_to? :create_key_ring + @create_key_ring = ::Gapic::Config::Method.new create_key_ring_config + create_crypto_key_config = parent_rpcs.create_crypto_key if parent_rpcs.respond_to? :create_crypto_key + @create_crypto_key = ::Gapic::Config::Method.new create_crypto_key_config + create_crypto_key_version_config = parent_rpcs.create_crypto_key_version if parent_rpcs.respond_to? :create_crypto_key_version + @create_crypto_key_version = ::Gapic::Config::Method.new create_crypto_key_version_config + delete_crypto_key_config = parent_rpcs.delete_crypto_key if parent_rpcs.respond_to? :delete_crypto_key + @delete_crypto_key = ::Gapic::Config::Method.new delete_crypto_key_config + delete_crypto_key_version_config = parent_rpcs.delete_crypto_key_version if parent_rpcs.respond_to? :delete_crypto_key_version + @delete_crypto_key_version = ::Gapic::Config::Method.new delete_crypto_key_version_config + import_crypto_key_version_config = parent_rpcs.import_crypto_key_version if parent_rpcs.respond_to? :import_crypto_key_version + @import_crypto_key_version = ::Gapic::Config::Method.new import_crypto_key_version_config + create_import_job_config = parent_rpcs.create_import_job if parent_rpcs.respond_to? :create_import_job + @create_import_job = ::Gapic::Config::Method.new create_import_job_config + update_crypto_key_config = parent_rpcs.update_crypto_key if parent_rpcs.respond_to? :update_crypto_key + @update_crypto_key = ::Gapic::Config::Method.new update_crypto_key_config + update_crypto_key_version_config = parent_rpcs.update_crypto_key_version if parent_rpcs.respond_to? :update_crypto_key_version + @update_crypto_key_version = ::Gapic::Config::Method.new update_crypto_key_version_config + update_crypto_key_primary_version_config = parent_rpcs.update_crypto_key_primary_version if parent_rpcs.respond_to? :update_crypto_key_primary_version + @update_crypto_key_primary_version = ::Gapic::Config::Method.new update_crypto_key_primary_version_config + destroy_crypto_key_version_config = parent_rpcs.destroy_crypto_key_version if parent_rpcs.respond_to? :destroy_crypto_key_version + @destroy_crypto_key_version = ::Gapic::Config::Method.new destroy_crypto_key_version_config + restore_crypto_key_version_config = parent_rpcs.restore_crypto_key_version if parent_rpcs.respond_to? :restore_crypto_key_version + @restore_crypto_key_version = ::Gapic::Config::Method.new restore_crypto_key_version_config + encrypt_config = parent_rpcs.encrypt if parent_rpcs.respond_to? :encrypt + @encrypt = ::Gapic::Config::Method.new encrypt_config + decrypt_config = parent_rpcs.decrypt if parent_rpcs.respond_to? :decrypt + @decrypt = ::Gapic::Config::Method.new decrypt_config + raw_encrypt_config = parent_rpcs.raw_encrypt if parent_rpcs.respond_to? :raw_encrypt + @raw_encrypt = ::Gapic::Config::Method.new raw_encrypt_config + raw_decrypt_config = parent_rpcs.raw_decrypt if parent_rpcs.respond_to? :raw_decrypt + @raw_decrypt = ::Gapic::Config::Method.new raw_decrypt_config + asymmetric_sign_config = parent_rpcs.asymmetric_sign if parent_rpcs.respond_to? :asymmetric_sign + @asymmetric_sign = ::Gapic::Config::Method.new asymmetric_sign_config + asymmetric_decrypt_config = parent_rpcs.asymmetric_decrypt if parent_rpcs.respond_to? :asymmetric_decrypt + @asymmetric_decrypt = ::Gapic::Config::Method.new asymmetric_decrypt_config + mac_sign_config = parent_rpcs.mac_sign if parent_rpcs.respond_to? :mac_sign + @mac_sign = ::Gapic::Config::Method.new mac_sign_config + mac_verify_config = parent_rpcs.mac_verify if parent_rpcs.respond_to? :mac_verify + @mac_verify = ::Gapic::Config::Method.new mac_verify_config + decapsulate_config = parent_rpcs.decapsulate if parent_rpcs.respond_to? :decapsulate + @decapsulate = ::Gapic::Config::Method.new decapsulate_config + generate_random_bytes_config = parent_rpcs.generate_random_bytes if parent_rpcs.respond_to? :generate_random_bytes + @generate_random_bytes = ::Gapic::Config::Method.new generate_random_bytes_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/credentials.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/credentials.rb new file mode 100644 index 000000000000..0fe0b1bd5111 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Kms + module V1 + module KeyManagementService + # Credentials for the KeyManagementService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + self.env_vars = [ + "KMS_CREDENTIALS", + "KMS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "KMS_CREDENTIALS_JSON", + "KMS_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/operations.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/operations.rb new file mode 100644 index 000000000000..40522f1aa457 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Kms + module V1 + module KeyManagementService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the KeyManagementService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the KeyManagementService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb new file mode 100644 index 000000000000..33dc14edfdae --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + module KeyManagementService + # Path helper methods for the KeyManagementService API. + module Paths + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified CryptoKeyVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + + ## + # Create a fully-qualified ImportJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param import_job [String] + # + # @return [::String] + def import_job_path project:, location:, key_ring:, import_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/importJobs/#{import_job}" + end + + ## + # Create a fully-qualified KeyRing resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # + # @return [::String] + def key_ring_path project:, location:, key_ring: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified RetiredResource resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/retiredResources/{retired_resource}` + # + # @param project [String] + # @param location [String] + # @param retired_resource [String] + # + # @return [::String] + def retired_resource_path project:, location:, retired_resource: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/retiredResources/#{retired_resource}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb new file mode 100644 index 000000000000..4ee52fe12d2b --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/kms/v1/version" +require "google/cloud/kms/v1/bindings_override" + +require "google/cloud/kms/v1/key_management_service/credentials" +require "google/cloud/kms/v1/key_management_service/paths" +require "google/cloud/kms/v1/key_management_service/rest/operations" +require "google/cloud/kms/v1/key_management_service/rest/client" + +module Google + module Cloud + module Kms + module V1 + ## + # Google Cloud Key Management Service + # + # Manages cryptographic keys and operations using those keys. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::Kms::V1::KeyRing KeyRing} + # * {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} + # * {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # * {::Google::Cloud::Kms::V1::ImportJob ImportJob} + # + # If you are using manual gRPC libraries, see + # [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/kms/v1/key_management_service/rest" + # client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + module KeyManagementService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/kms/v1/key_management_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb new file mode 100644 index 000000000000..f24965a9fc89 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb @@ -0,0 +1,4233 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/kms/v1/service_pb" +require "google/cloud/kms/v1/key_management_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module Kms + module V1 + module KeyManagementService + module Rest + ## + # REST client for the KeyManagementService service. + # + # Google Cloud Key Management Service + # + # Manages cryptographic keys and operations using those keys. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::Kms::V1::KeyRing KeyRing} + # * {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} + # * {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # * {::Google::Cloud::Kms::V1::ImportJob ImportJob} + # + # If you are using manual gRPC libraries, see + # [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :key_management_service_stub + + ## + # Configure the KeyManagementService Client class. + # + # See {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all KeyManagementService clients + # ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Kms", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_key_rings.timeout = 60.0 + default_config.rpcs.list_key_rings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_crypto_keys.timeout = 60.0 + default_config.rpcs.list_crypto_keys.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_crypto_key_versions.timeout = 60.0 + default_config.rpcs.list_crypto_key_versions.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_import_jobs.timeout = 60.0 + default_config.rpcs.list_import_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_retired_resources.timeout = 60.0 + default_config.rpcs.list_retired_resources.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_key_ring.timeout = 60.0 + default_config.rpcs.get_key_ring.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_crypto_key.timeout = 60.0 + default_config.rpcs.get_crypto_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_crypto_key_version.timeout = 60.0 + default_config.rpcs.get_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_public_key.timeout = 60.0 + default_config.rpcs.get_public_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_import_job.timeout = 60.0 + default_config.rpcs.get_import_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_retired_resource.timeout = 60.0 + default_config.rpcs.get_retired_resource.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_key_ring.timeout = 60.0 + default_config.rpcs.create_key_ring.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_crypto_key.timeout = 60.0 + default_config.rpcs.create_crypto_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_crypto_key_version.timeout = 60.0 + + default_config.rpcs.delete_crypto_key.timeout = 60.0 + default_config.rpcs.delete_crypto_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_crypto_key_version.timeout = 60.0 + default_config.rpcs.delete_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.import_crypto_key_version.timeout = 60.0 + + default_config.rpcs.create_import_job.timeout = 60.0 + default_config.rpcs.create_import_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_crypto_key.timeout = 60.0 + default_config.rpcs.update_crypto_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_crypto_key_version.timeout = 60.0 + default_config.rpcs.update_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_crypto_key_primary_version.timeout = 60.0 + default_config.rpcs.update_crypto_key_primary_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.destroy_crypto_key_version.timeout = 60.0 + default_config.rpcs.destroy_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.restore_crypto_key_version.timeout = 60.0 + default_config.rpcs.restore_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.encrypt.timeout = 60.0 + default_config.rpcs.encrypt.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.decrypt.timeout = 60.0 + default_config.rpcs.decrypt.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.asymmetric_sign.timeout = 60.0 + default_config.rpcs.asymmetric_sign.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.asymmetric_decrypt.timeout = 60.0 + default_config.rpcs.asymmetric_decrypt.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.mac_sign.timeout = 60.0 + default_config.rpcs.mac_sign.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.mac_verify.timeout = 60.0 + default_config.rpcs.mac_verify.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.generate_random_bytes.timeout = 60.0 + default_config.rpcs.generate_random_bytes.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the KeyManagementService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @key_management_service_stub.universe_domain + end + + ## + # Create a new KeyManagementService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the KeyManagementService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @key_management_service_stub = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @key_management_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @key_management_service_stub.endpoint + config.universe_domain = @key_management_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @key_management_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @key_management_service_stub.endpoint + config.universe_domain = @key_management_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @key_management_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Kms::V1::KeyManagementService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @key_management_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::Kms::V1::KeyRing KeyRings}. + # + # @overload list_key_rings(request, options = nil) + # Pass arguments to `list_key_rings` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListKeyRingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListKeyRingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_key_rings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_key_rings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::KeyRing KeyRings} to include in the response. Further + # {::Google::Cloud::Kms::V1::KeyRing KeyRings} can subsequently be obtained by + # including the + # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token}. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListKeyRingsRequest.new + # + # # Call the list_key_rings method. + # result = client.list_key_rings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::KeyRing. + # p item + # end + # + def list_key_rings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListKeyRingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_key_rings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_key_rings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_key_rings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.list_key_rings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @key_management_service_stub, :list_key_rings, "key_rings", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # + # @overload list_crypto_keys(request, options = nil) + # Pass arguments to `list_crypto_keys` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListCryptoKeysRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListCryptoKeysRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_crypto_keys(parent: nil, page_size: nil, page_token: nil, version_view: nil, filter: nil, order_by: nil) + # Pass arguments to `list_crypto_keys` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} + # to list, in the format `projects/*/locations/*/keyRings/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} to include in the response. + # Further {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token}. + # @param version_view [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] + # The fields of the primary version to include in the response. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListCryptoKeysRequest.new + # + # # Call the list_crypto_keys method. + # result = client.list_crypto_keys request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::CryptoKey. + # p item + # end + # + def list_crypto_keys request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListCryptoKeysRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_crypto_keys.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_crypto_keys.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_crypto_keys.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.list_crypto_keys request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @key_management_service_stub, :list_crypto_keys, "crypto_keys", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. + # + # @overload list_crypto_key_versions(request, options = nil) + # Pass arguments to `list_crypto_key_versions` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_crypto_key_versions(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil, order_by: nil) + # Pass arguments to `list_crypto_key_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to list, in the format + # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} to include in the + # response. Further {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} + # can subsequently be obtained by including the + # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token}. + # @param view [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] + # The fields to include in the response. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new + # + # # Call the list_crypto_key_versions method. + # result = client.list_crypto_key_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::CryptoKeyVersion. + # p item + # end + # + def list_crypto_key_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_crypto_key_versions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_crypto_key_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_crypto_key_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.list_crypto_key_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @key_management_service_stub, :list_crypto_key_versions, "crypto_key_versions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. + # + # @overload list_import_jobs(request, options = nil) + # Pass arguments to `list_import_jobs` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListImportJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListImportJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_import_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_import_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} + # to list, in the format `projects/*/locations/*/keyRings/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::ImportJob ImportJobs} to include in the response. + # Further {::Google::Cloud::Kms::V1::ImportJob ImportJobs} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token}. + # @param filter [::String] + # 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). + # @param order_by [::String] + # 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). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListImportJobsRequest.new + # + # # Call the list_import_jobs method. + # result = client.list_import_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::ImportJob. + # p item + # end + # + def list_import_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListImportJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_import_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_import_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_import_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.list_import_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @key_management_service_stub, :list_import_jobs, "import_jobs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} which are + # the records of deleted {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # RetiredResources prevent the reuse of these resource names after deletion. + # + # @overload list_retired_resources(request, options = nil) + # Pass arguments to `list_retired_resources` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListRetiredResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_retired_resources(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_retired_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project-specific location holding the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} to be included in + # the response. Further + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new + # + # # Call the list_retired_resources method. + # result = client.list_retired_resources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::RetiredResource. + # p item + # end + # + def list_retired_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_retired_resources.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_retired_resources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_retired_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.list_retired_resources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @key_management_service_stub, :list_retired_resources, "retired_resources", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given {::Google::Cloud::Kms::V1::KeyRing KeyRing}. + # + # @overload get_key_ring(request, options = nil) + # Pass arguments to `get_key_ring` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetKeyRingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetKeyRingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_key_ring(name: nil) + # Pass arguments to `get_key_ring` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the + # {::Google::Cloud::Kms::V1::KeyRing KeyRing} to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::KeyRing] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::KeyRing] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetKeyRingRequest.new + # + # # Call the get_key_ring method. + # result = client.get_key_ring request + # + # # The returned object is of type Google::Cloud::Kms::V1::KeyRing. + # p result + # + def get_key_ring request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetKeyRingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_key_ring.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_key_ring.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_key_ring.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.get_key_ring request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}, as + # well as its {::Google::Cloud::Kms::V1::CryptoKey#primary primary} + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. + # + # @overload get_crypto_key(request, options = nil) + # Pass arguments to `get_crypto_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetCryptoKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetCryptoKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_crypto_key(name: nil) + # Pass arguments to `get_crypto_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetCryptoKeyRequest.new + # + # # Call the get_crypto_key method. + # result = client.get_crypto_key request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + # p result + # + def get_crypto_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetCryptoKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_crypto_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_crypto_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_crypto_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.get_crypto_key request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. + # + # @overload get_crypto_key_version(request, options = nil) + # Pass arguments to `get_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_crypto_key_version(name: nil) + # Pass arguments to `get_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new + # + # # Call the get_crypto_key_version method. + # result = client.get_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def get_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_crypto_key_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.get_crypto_key_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the public key for the given + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. The + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_SIGN ASYMMETRIC_SIGN} + # or + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_DECRYPT ASYMMETRIC_DECRYPT}. + # + # @overload get_public_key(request, options = nil) + # Pass arguments to `get_public_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetPublicKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetPublicKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_public_key(name: nil, public_key_format: nil) + # Pass arguments to `get_public_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key to get. + # @param public_key_format [::Google::Cloud::Kms::V1::PublicKey::PublicKeyFormat] + # Optional. The {::Google::Cloud::Kms::V1::PublicKey PublicKey} format specified + # by the user. This field is required for PQC algorithms. If specified, the + # public key will be exported through the + # {::Google::Cloud::Kms::V1::PublicKey#public_key public_key} field in the + # requested format. Otherwise, the {::Google::Cloud::Kms::V1::PublicKey#pem pem} + # field will be populated for non-PQC algorithms, and an error will be + # returned for PQC algorithms. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::PublicKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::PublicKey] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetPublicKeyRequest.new + # + # # Call the get_public_key method. + # result = client.get_public_key request + # + # # The returned object is of type Google::Cloud::Kms::V1::PublicKey. + # p result + # + def get_public_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetPublicKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_public_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_public_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_public_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.get_public_key request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for a given {::Google::Cloud::Kms::V1::ImportJob ImportJob}. + # + # @overload get_import_job(request, options = nil) + # Pass arguments to `get_import_job` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetImportJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetImportJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_import_job(name: nil) + # Pass arguments to `get_import_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the + # {::Google::Cloud::Kms::V1::ImportJob ImportJob} to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ImportJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ImportJob] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetImportJobRequest.new + # + # # Call the get_import_job method. + # result = client.get_import_job request + # + # # The returned object is of type Google::Cloud::Kms::V1::ImportJob. + # p result + # + def get_import_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetImportJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_import_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_import_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_import_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.get_import_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a specific {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} + # resource, which represents the record of a deleted + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload get_retired_resource(request, options = nil) + # Pass arguments to `get_retired_resource` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetRetiredResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetRetiredResourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_retired_resource(name: nil) + # Pass arguments to `get_retired_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::RetiredResource#name name} of the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::RetiredResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::RetiredResource] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetRetiredResourceRequest.new + # + # # Call the get_retired_resource method. + # result = client.get_retired_resource request + # + # # The returned object is of type Google::Cloud::Kms::V1::RetiredResource. + # p result + # + def get_retired_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetRetiredResourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_retired_resource.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_retired_resource.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_retired_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.get_retired_resource request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a new {::Google::Cloud::Kms::V1::KeyRing KeyRing} in a given Project and + # Location. + # + # @overload create_key_ring(request, options = nil) + # Pass arguments to `create_key_ring` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateKeyRingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateKeyRingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_key_ring(parent: nil, key_ring_id: nil, key_ring: nil) + # Pass arguments to `create_key_ring` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format + # `projects/*/locations/*`. + # @param key_ring_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param key_ring [::Google::Cloud::Kms::V1::KeyRing, ::Hash] + # Required. A {::Google::Cloud::Kms::V1::KeyRing KeyRing} with initial field + # values. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::KeyRing] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::KeyRing] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateKeyRingRequest.new + # + # # Call the create_key_ring method. + # result = client.create_key_ring request + # + # # The returned object is of type Google::Cloud::Kms::V1::KeyRing. + # p result + # + def create_key_ring request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateKeyRingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_key_ring.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_key_ring.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_key_ring.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.create_key_ring request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a new {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} within a + # {::Google::Cloud::Kms::V1::KeyRing KeyRing}. + # + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} and + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#algorithm CryptoKey.version_template.algorithm} + # are required. + # + # @overload create_crypto_key(request, options = nil) + # Pass arguments to `create_crypto_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateCryptoKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateCryptoKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_crypto_key(parent: nil, crypto_key_id: nil, crypto_key: nil, skip_initial_version_creation: nil) + # Pass arguments to `create_crypto_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the KeyRing + # associated with the {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # @param crypto_key_id [::String] + # Required. It must be unique within a KeyRing and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param crypto_key [::Google::Cloud::Kms::V1::CryptoKey, ::Hash] + # Required. A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with initial field + # values. + # @param skip_initial_version_creation [::Boolean] + # If set to true, the request will create a + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} without any + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. You must + # manually call + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#create_crypto_key_version CreateCryptoKeyVersion} + # or + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#import_crypto_key_version ImportCryptoKeyVersion} + # before you can use this {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new + # + # # Call the create_crypto_key method. + # result = client.create_crypto_key request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + # p result + # + def create_crypto_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_crypto_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_crypto_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_crypto_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.create_crypto_key request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a new {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in a + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # The server will assign the next sequential id. If unset, + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will be set to + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED}. + # + # @overload create_crypto_key_version(request, options = nil) + # Pass arguments to `create_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_crypto_key_version(parent: nil, crypto_key_version: nil) + # Pass arguments to `create_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} associated with the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. + # @param crypto_key_version [::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash] + # Required. A {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with + # initial field values. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new + # + # # Call the create_crypto_key_version method. + # result = client.create_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def create_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_crypto_key_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.create_crypto_key_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes the given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # All child {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} must + # have been previously deleted using + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion}. + # The specified crypto key will be immediately and permanently deleted upon + # calling this method. This action cannot be undone. + # + # @overload delete_crypto_key(request, options = nil) + # Pass arguments to `delete_crypto_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_crypto_key(name: nil) + # Pass arguments to `delete_crypto_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new + # + # # Call the delete_crypto_key method. + # result = client.delete_crypto_key request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_crypto_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_crypto_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_crypto_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_crypto_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.delete_crypto_key request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes the given + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Only possible if + # the version has not been previously imported and if its + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is one of + # [DESTROYED][CryptoKeyVersionState.DESTROYED], + # [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or + # [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. + # Successfully imported + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} cannot be deleted + # at this time. The specified version will be immediately and permanently + # deleted upon calling this method. This action cannot be undone. + # + # @overload delete_crypto_key_version(request, options = nil) + # Pass arguments to `delete_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_crypto_key_version(name: nil) + # Pass arguments to `delete_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new + # + # # Call the delete_crypto_key_version method. + # result = client.delete_crypto_key_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_crypto_key_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.delete_crypto_key_version request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Import wrapped key material into a + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. + # + # All requests must specify a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. If + # a {::Google::Cloud::Kms::V1::CryptoKeyVersion 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 {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload import_crypto_key_version(request, options = nil) + # Pass arguments to `import_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_crypto_key_version(parent: nil, crypto_key_version: nil, algorithm: nil, import_job: nil, wrapped_key: nil, rsa_aes_wrapped_key: nil) + # Pass arguments to `import_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to be imported into. + # + # The create permission is only required on this key when creating a new + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. + # @param crypto_key_version [::String] + # Optional. The optional {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of + # an existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to + # target for an import operation. If this field is not present, a new + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} containing the + # supplied key material is created. + # + # If this field is present, the supplied key material is imported into + # the existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. To + # import into an existing + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} must be a child of + # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#parent ImportCryptoKeyVersionRequest.parent}, + # have been previously created via + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#import_crypto_key_version ImportCryptoKeyVersion}, + # and be in + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED} + # or + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::IMPORT_FAILED IMPORT_FAILED} + # state. The key material and algorithm must match the previous + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} exactly if the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} has ever contained + # key material. + # @param algorithm [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] + # Required. The + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm algorithm} + # of the key being imported. This does not need to match the + # {::Google::Cloud::Kms::V1::CryptoKey#version_template version_template} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} this version imports into. + # @param import_job [::String] + # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the + # {::Google::Cloud::Kms::V1::ImportJob ImportJob} that was used to wrap this key + # material. + # @param wrapped_key [::String] + # 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 + # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA1_AES_256 RSA_OAEP_3072_SHA1_AES_256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA1_AES_256 RSA_OAEP_4096_SHA1_AES_256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256_AES_256 RSA_OAEP_3072_SHA256_AES_256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256_AES_256 RSA_OAEP_4096_SHA256_AES_256}), + # + # this field must contain the concatenation of: + #
    + #
  1. An ephemeral AES-256 wrapping key wrapped with the + # {::Google::Cloud::Kms::V1::ImportJob#public_key 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 + # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256 RSA_OAEP_3072_SHA256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256 RSA_OAEP_4096_SHA256}), + # + # this field must contain the formatted key to be imported, wrapped with the + # {::Google::Cloud::Kms::V1::ImportJob#public_key public_key} using RSAES-OAEP + # with SHA-256, MGF1 with SHA-256, and an empty label. + # @param rsa_aes_wrapped_key [::String] + # Optional. This field has the same meaning as + # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#wrapped_key wrapped_key}. + # Prefer to use that field in new work. Either that field or this field + # (but not both) must be specified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new + # + # # Call the import_crypto_key_version method. + # result = client.import_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def import_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_crypto_key_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.import_crypto_key_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a new {::Google::Cloud::Kms::V1::ImportJob ImportJob} within a + # {::Google::Cloud::Kms::V1::KeyRing KeyRing}. + # + # {::Google::Cloud::Kms::V1::ImportJob#import_method ImportJob.import_method} is + # required. + # + # @overload create_import_job(request, options = nil) + # Pass arguments to `create_import_job` via a request object, either of type + # {::Google::Cloud::Kms::V1::CreateImportJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::CreateImportJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_import_job(parent: nil, import_job_id: nil, import_job: nil) + # Pass arguments to `create_import_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the + # {::Google::Cloud::Kms::V1::KeyRing KeyRing} associated with the + # {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. + # @param import_job_id [::String] + # Required. It must be unique within a KeyRing and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param import_job [::Google::Cloud::Kms::V1::ImportJob, ::Hash] + # Required. An {::Google::Cloud::Kms::V1::ImportJob ImportJob} with initial field + # values. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ImportJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ImportJob] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::CreateImportJobRequest.new + # + # # Call the create_import_job method. + # result = client.create_import_job request + # + # # The returned object is of type Google::Cloud::Kms::V1::ImportJob. + # p result + # + def create_import_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateImportJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_import_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_import_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_import_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.create_import_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload update_crypto_key(request, options = nil) + # Pass arguments to `update_crypto_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_crypto_key(crypto_key: nil, update_mask: nil) + # Pass arguments to `update_crypto_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param crypto_key [::Google::Cloud::Kms::V1::CryptoKey, ::Hash] + # Required. {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new + # + # # Call the update_crypto_key method. + # result = client.update_crypto_key request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + # p result + # + def update_crypto_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_crypto_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_crypto_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_crypto_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.update_crypto_key request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s + # metadata. + # + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} may be changed between + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} + # and + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED} + # using this method. See + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#destroy_crypto_key_version DestroyCryptoKeyVersion} + # and + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#restore_crypto_key_version RestoreCryptoKeyVersion} + # to move between other states. + # + # @overload update_crypto_key_version(request, options = nil) + # Pass arguments to `update_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_crypto_key_version(crypto_key_version: nil, update_mask: nil) + # Pass arguments to `update_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param crypto_key_version [::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash] + # Required. {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with + # updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new + # + # # Call the update_crypto_key_version method. + # result = client.update_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def update_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_crypto_key_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.update_crypto_key_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update the version of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that + # will be used in + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#encrypt Encrypt}. + # + # Returns an error if called on a key whose purpose is not + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. + # + # @overload update_crypto_key_primary_version(request, options = nil) + # Pass arguments to `update_crypto_key_primary_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_crypto_key_primary_version(name: nil, crypto_key_version_id: nil) + # Pass arguments to `update_crypto_key_primary_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to update. + # @param crypto_key_version_id [::String] + # Required. The id of the child + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use as primary. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new + # + # # Call the update_crypto_key_primary_version method. + # result = client.update_crypto_key_primary_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + # p result + # + def update_crypto_key_primary_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_crypto_key_primary_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_crypto_key_primary_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_crypto_key_primary_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.update_crypto_key_primary_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Schedule a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} for + # destruction. + # + # Upon calling this method, + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state CryptoKeyVersion.state} will + # be set to + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED}, + # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will + # be set to the time + # {::Google::Cloud::Kms::V1::CryptoKey#destroy_scheduled_duration destroy_scheduled_duration} + # in the future. At that time, the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will automatically + # change to + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}, + # and the key material will be irrevocably destroyed. + # + # Before the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} is + # reached, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#restore_crypto_key_version RestoreCryptoKeyVersion} + # may be called to reverse the process. + # + # @overload destroy_crypto_key_version(request, options = nil) + # Pass arguments to `destroy_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload destroy_crypto_key_version(name: nil) + # Pass arguments to `destroy_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to destroy. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new + # + # # Call the destroy_crypto_key_version method. + # result = client.destroy_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def destroy_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.destroy_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.destroy_crypto_key_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.destroy_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.destroy_crypto_key_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Restore a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED} + # state. + # + # Upon restoration of the CryptoKeyVersion, + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will be set to + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED}, + # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will + # be cleared. + # + # @overload restore_crypto_key_version(request, options = nil) + # Pass arguments to `restore_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload restore_crypto_key_version(name: nil) + # Pass arguments to `restore_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to restore. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new + # + # # Call the restore_crypto_key_version method. + # result = client.restore_crypto_key_version request + # + # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + # p result + # + def restore_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.restore_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.restore_crypto_key_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restore_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.restore_crypto_key_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Encrypts data, so that it can only be recovered by a call to + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#decrypt Decrypt}. The + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. + # + # @overload encrypt(request, options = nil) + # Pass arguments to `encrypt` via a request object, either of type + # {::Google::Cloud::Kms::V1::EncryptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::EncryptRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil) + # Pass arguments to `encrypt` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} or + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # encryption. + # + # If a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is specified, the server + # will use its {::Google::Cloud::Kms::V1::CryptoKey#primary primary version}. + # @param plaintext [::String] + # Required. The data to encrypt. Must be no larger than 64KiB. + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys, the + # plaintext must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @param additional_authenticated_data [::String] + # Optional. Optional data that, if specified, must also be provided during + # decryption through + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys the + # AAD must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @param plaintext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}) + # is equal to + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c 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. + # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}) + # is equal to + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EncryptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EncryptResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::EncryptRequest.new + # + # # Call the encrypt method. + # result = client.encrypt request + # + # # The returned object is of type Google::Cloud::Kms::V1::EncryptResponse. + # p result + # + def encrypt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::EncryptRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.encrypt.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.encrypt.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.encrypt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.encrypt request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Decrypts data that was protected by + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#encrypt Encrypt}. The + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. + # + # @overload decrypt(request, options = nil) + # Pass arguments to `decrypt` via a request object, either of type + # {::Google::Cloud::Kms::V1::DecryptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DecryptRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil) + # Pass arguments to `decrypt` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to use for decryption. The + # server will choose the appropriate version. + # @param ciphertext [::String] + # Required. The encrypted data originally returned in + # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext EncryptResponse.ciphertext}. + # @param additional_authenticated_data [::String] + # Optional. Optional data that must match the data originally supplied in + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. + # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}) + # is equal to + # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext_crc32c 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. + # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}) + # is equal to + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data_crc32c 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::DecryptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::DecryptResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DecryptRequest.new + # + # # Call the decrypt method. + # result = client.decrypt request + # + # # The returned object is of type Google::Cloud::Kms::V1::DecryptResponse. + # p result + # + def decrypt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DecryptRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.decrypt.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.decrypt.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.decrypt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.decrypt request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Encrypts data using portable cryptographic primitives. Most users should + # choose {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#encrypt Encrypt} and + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#decrypt Decrypt} rather than + # their raw counterparts. The + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::RAW_ENCRYPT_DECRYPT RAW_ENCRYPT_DECRYPT}. + # + # @overload raw_encrypt(request, options = nil) + # Pass arguments to `raw_encrypt` via a request object, either of type + # {::Google::Cloud::Kms::V1::RawEncryptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::RawEncryptRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload raw_encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector: nil, initialization_vector_crc32c: nil) + # Pass arguments to `raw_encrypt` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # encryption. + # @param plaintext [::String] + # Required. The data to encrypt. Must be no larger than 64KiB. + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the + # plaintext must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @param additional_authenticated_data [::String] + # Optional. Optional data that, if specified, must also be provided during + # decryption through + # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. + # + # This field may only be used in conjunction with an + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm} that accepts + # additional authenticated data (for example, AES-GCM). + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the + # plaintext must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @param plaintext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext RawEncryptRequest.plaintext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received plaintext using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. + # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received additional_authenticated_data using + # this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. + # @param initialization_vector [::String] + # 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 + # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. + # @param initialization_vector_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector RawEncryptRequest.initialization_vector}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received initialization_vector using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::RawEncryptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::RawEncryptResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::RawEncryptRequest.new + # + # # Call the raw_encrypt method. + # result = client.raw_encrypt request + # + # # The returned object is of type Google::Cloud::Kms::V1::RawEncryptResponse. + # p result + # + def raw_encrypt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RawEncryptRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.raw_encrypt.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.raw_encrypt.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.raw_encrypt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.raw_encrypt request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Decrypts data that was originally encrypted using a raw cryptographic + # mechanism. The {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # must be + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::RAW_ENCRYPT_DECRYPT RAW_ENCRYPT_DECRYPT}. + # + # @overload raw_decrypt(request, options = nil) + # Pass arguments to `raw_decrypt` via a request object, either of type + # {::Google::Cloud::Kms::V1::RawDecryptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::RawDecryptRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload raw_decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, initialization_vector: nil, tag_length: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector_crc32c: nil) + # Pass arguments to `raw_decrypt` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # decryption. + # @param ciphertext [::String] + # Required. The encrypted data originally returned in + # {::Google::Cloud::Kms::V1::RawEncryptResponse#ciphertext RawEncryptResponse.ciphertext}. + # @param additional_authenticated_data [::String] + # Optional. Optional data that must match the data originally supplied in + # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. + # @param initialization_vector [::String] + # Required. The initialization vector (IV) used during encryption, which must + # match the data originally provided in + # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. + # @param tag_length [::Integer] + # 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). + # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext RawDecryptRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received ciphertext using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. + # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received additional_authenticated_data using + # this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. + # @param initialization_vector_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector RawDecryptRequest.initialization_vector}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received initialization_vector using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::RawDecryptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::RawDecryptResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::RawDecryptRequest.new + # + # # Call the raw_decrypt method. + # result = client.raw_decrypt request + # + # # The returned object is of type Google::Cloud::Kms::V1::RawDecryptResponse. + # p result + # + def raw_decrypt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RawDecryptRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.raw_decrypt.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.raw_decrypt.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.raw_decrypt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.raw_decrypt request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # ASYMMETRIC_SIGN, producing a signature that can be verified with the public + # key retrieved from + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#get_public_key GetPublicKey}. + # + # @overload asymmetric_sign(request, options = nil) + # Pass arguments to `asymmetric_sign` via a request object, either of type + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::AsymmetricSignRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload asymmetric_sign(name: nil, digest: nil, digest_crc32c: nil, data: nil, data_crc32c: nil) + # Pass arguments to `asymmetric_sign` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # signing. + # @param digest [::Google::Cloud::Kms::V1::Digest, ::Hash] + # 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 + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm}. + # + # This field may not be supplied if + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} + # is supplied. + # @param digest_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}) + # is equal to + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c 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. + # @param data [::String] + # Optional. The data to sign. + # It can't be supplied if + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} + # is supplied. + # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}) + # is equal to + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::AsymmetricSignResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::AsymmetricSignResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::AsymmetricSignRequest.new + # + # # Call the asymmetric_sign method. + # result = client.asymmetric_sign request + # + # # The returned object is of type Google::Cloud::Kms::V1::AsymmetricSignResponse. + # p result + # + def asymmetric_sign request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::AsymmetricSignRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.asymmetric_sign.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.asymmetric_sign.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.asymmetric_sign.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.asymmetric_sign request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Decrypts data that was encrypted with a public key retrieved from + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#get_public_key GetPublicKey} + # corresponding to a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # ASYMMETRIC_DECRYPT. + # + # @overload asymmetric_decrypt(request, options = nil) + # Pass arguments to `asymmetric_decrypt` via a request object, either of type + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::AsymmetricDecryptRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload asymmetric_decrypt(name: nil, ciphertext: nil, ciphertext_crc32c: nil) + # Pass arguments to `asymmetric_decrypt` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # decryption. + # @param ciphertext [::String] + # Required. The data encrypted with the named + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s public key using + # OAEP. + # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}) + # is equal to + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new + # + # # Call the asymmetric_decrypt method. + # result = client.asymmetric_decrypt request + # + # # The returned object is of type Google::Cloud::Kms::V1::AsymmetricDecryptResponse. + # p result + # + def asymmetric_decrypt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.asymmetric_decrypt.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.asymmetric_decrypt.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.asymmetric_decrypt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.asymmetric_decrypt request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} MAC, + # producing a tag that can be verified by another source with the same key. + # + # @overload mac_sign(request, options = nil) + # Pass arguments to `mac_sign` via a request object, either of type + # {::Google::Cloud::Kms::V1::MacSignRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::MacSignRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload mac_sign(name: nil, data: nil, data_crc32c: nil) + # Pass arguments to `mac_sign` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # signing. + # @param data [::String] + # Required. The data to sign. The MAC tag is computed over this data field + # based on the specific algorithm. + # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}. If + # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} + # will verify the integrity of the received + # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} + # will report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}) is + # equal to + # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::MacSignResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::MacSignResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::MacSignRequest.new + # + # # Call the mac_sign method. + # result = client.mac_sign request + # + # # The returned object is of type Google::Cloud::Kms::V1::MacSignResponse. + # p result + # + def mac_sign request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::MacSignRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.mac_sign.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.mac_sign.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.mac_sign.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.mac_sign request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Verifies MAC tag using a + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} MAC, and returns + # a response that indicates whether or not the verification was successful. + # + # @overload mac_verify(request, options = nil) + # Pass arguments to `mac_verify` via a request object, either of type + # {::Google::Cloud::Kms::V1::MacVerifyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::MacVerifyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload mac_verify(name: nil, data: nil, data_crc32c: nil, mac: nil, mac_crc32c: nil) + # Pass arguments to `mac_verify` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # verification. + # @param data [::String] + # Required. The data used previously as a + # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} to generate + # the MAC tag. + # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}. If + # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} + # will verify the integrity of the received + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data} using + # this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}) + # is equal to + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c 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. + # @param mac [::String] + # Required. The signature to verify. + # @param mac_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}. If + # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} + # will verify the integrity of the received + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac} using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} + # will report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}) is + # equal to + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::MacVerifyResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::MacVerifyResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::MacVerifyRequest.new + # + # # Call the mac_verify method. + # result = client.mac_verify request + # + # # The returned object is of type Google::Cloud::Kms::V1::MacVerifyResponse. + # p result + # + def mac_verify request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::MacVerifyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.mac_verify.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.mac_verify.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.mac_verify.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.mac_verify request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Decapsulates data that was encapsulated with a public key retrieved from + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#get_public_key GetPublicKey} + # corresponding to a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # KEY_ENCAPSULATION. + # + # @overload decapsulate(request, options = nil) + # Pass arguments to `decapsulate` via a request object, either of type + # {::Google::Cloud::Kms::V1::DecapsulateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DecapsulateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload decapsulate(name: nil, ciphertext: nil, ciphertext_crc32c: nil) + # Pass arguments to `decapsulate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # decapsulation. + # @param ciphertext [::String] + # Required. The ciphertext produced from encapsulation with the + # named {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public + # key(s). + # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] + # Optional. A CRC32C checksum of the + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}) + # is equal to + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::DecapsulateResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::DecapsulateResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DecapsulateRequest.new + # + # # Call the decapsulate method. + # result = client.decapsulate request + # + # # The returned object is of type Google::Cloud::Kms::V1::DecapsulateResponse. + # p result + # + def decapsulate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DecapsulateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.decapsulate.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.decapsulate.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.decapsulate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.decapsulate request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Generate random bytes using the Cloud KMS randomness source in the provided + # location. + # + # @overload generate_random_bytes(request, options = nil) + # Pass arguments to `generate_random_bytes` via a request object, either of type + # {::Google::Cloud::Kms::V1::GenerateRandomBytesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GenerateRandomBytesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload generate_random_bytes(location: nil, length_bytes: nil, protection_level: nil) + # Pass arguments to `generate_random_bytes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param location [::String] + # The project-specific location in which to generate random bytes. + # For example, "projects/my-project/locations/us-central1". + # @param length_bytes [::Integer] + # The length in bytes of the amount of randomness to retrieve. Minimum 8 + # bytes, maximum 1024 bytes. + # @param protection_level [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} to use when + # generating the random data. Currently, only + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} protection level is + # supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new + # + # # Call the generate_random_bytes method. + # result = client.generate_random_bytes request + # + # # The returned object is of type Google::Cloud::Kms::V1::GenerateRandomBytesResponse. + # p result + # + def generate_random_bytes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.generate_random_bytes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.generate_random_bytes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_random_bytes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.generate_random_bytes request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the KeyManagementService REST API. + # + # This class represents the configuration for KeyManagementService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_key_rings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_key_rings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_key_rings.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the KeyManagementService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_key_rings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_key_rings + ## + # RPC-specific configuration for `list_crypto_keys` + # @return [::Gapic::Config::Method] + # + attr_reader :list_crypto_keys + ## + # RPC-specific configuration for `list_crypto_key_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_crypto_key_versions + ## + # RPC-specific configuration for `list_import_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_import_jobs + ## + # RPC-specific configuration for `list_retired_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_retired_resources + ## + # RPC-specific configuration for `get_key_ring` + # @return [::Gapic::Config::Method] + # + attr_reader :get_key_ring + ## + # RPC-specific configuration for `get_crypto_key` + # @return [::Gapic::Config::Method] + # + attr_reader :get_crypto_key + ## + # RPC-specific configuration for `get_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_crypto_key_version + ## + # RPC-specific configuration for `get_public_key` + # @return [::Gapic::Config::Method] + # + attr_reader :get_public_key + ## + # RPC-specific configuration for `get_import_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_import_job + ## + # RPC-specific configuration for `get_retired_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_retired_resource + ## + # RPC-specific configuration for `create_key_ring` + # @return [::Gapic::Config::Method] + # + attr_reader :create_key_ring + ## + # RPC-specific configuration for `create_crypto_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_crypto_key + ## + # RPC-specific configuration for `create_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :create_crypto_key_version + ## + # RPC-specific configuration for `delete_crypto_key` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_crypto_key + ## + # RPC-specific configuration for `delete_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_crypto_key_version + ## + # RPC-specific configuration for `import_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :import_crypto_key_version + ## + # RPC-specific configuration for `create_import_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_import_job + ## + # RPC-specific configuration for `update_crypto_key` + # @return [::Gapic::Config::Method] + # + attr_reader :update_crypto_key + ## + # RPC-specific configuration for `update_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :update_crypto_key_version + ## + # RPC-specific configuration for `update_crypto_key_primary_version` + # @return [::Gapic::Config::Method] + # + attr_reader :update_crypto_key_primary_version + ## + # RPC-specific configuration for `destroy_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :destroy_crypto_key_version + ## + # RPC-specific configuration for `restore_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_crypto_key_version + ## + # RPC-specific configuration for `encrypt` + # @return [::Gapic::Config::Method] + # + attr_reader :encrypt + ## + # RPC-specific configuration for `decrypt` + # @return [::Gapic::Config::Method] + # + attr_reader :decrypt + ## + # RPC-specific configuration for `raw_encrypt` + # @return [::Gapic::Config::Method] + # + attr_reader :raw_encrypt + ## + # RPC-specific configuration for `raw_decrypt` + # @return [::Gapic::Config::Method] + # + attr_reader :raw_decrypt + ## + # RPC-specific configuration for `asymmetric_sign` + # @return [::Gapic::Config::Method] + # + attr_reader :asymmetric_sign + ## + # RPC-specific configuration for `asymmetric_decrypt` + # @return [::Gapic::Config::Method] + # + attr_reader :asymmetric_decrypt + ## + # RPC-specific configuration for `mac_sign` + # @return [::Gapic::Config::Method] + # + attr_reader :mac_sign + ## + # RPC-specific configuration for `mac_verify` + # @return [::Gapic::Config::Method] + # + attr_reader :mac_verify + ## + # RPC-specific configuration for `decapsulate` + # @return [::Gapic::Config::Method] + # + attr_reader :decapsulate + ## + # RPC-specific configuration for `generate_random_bytes` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_random_bytes + + # @private + def initialize parent_rpcs = nil + list_key_rings_config = parent_rpcs.list_key_rings if parent_rpcs.respond_to? :list_key_rings + @list_key_rings = ::Gapic::Config::Method.new list_key_rings_config + list_crypto_keys_config = parent_rpcs.list_crypto_keys if parent_rpcs.respond_to? :list_crypto_keys + @list_crypto_keys = ::Gapic::Config::Method.new list_crypto_keys_config + list_crypto_key_versions_config = parent_rpcs.list_crypto_key_versions if parent_rpcs.respond_to? :list_crypto_key_versions + @list_crypto_key_versions = ::Gapic::Config::Method.new list_crypto_key_versions_config + list_import_jobs_config = parent_rpcs.list_import_jobs if parent_rpcs.respond_to? :list_import_jobs + @list_import_jobs = ::Gapic::Config::Method.new list_import_jobs_config + list_retired_resources_config = parent_rpcs.list_retired_resources if parent_rpcs.respond_to? :list_retired_resources + @list_retired_resources = ::Gapic::Config::Method.new list_retired_resources_config + get_key_ring_config = parent_rpcs.get_key_ring if parent_rpcs.respond_to? :get_key_ring + @get_key_ring = ::Gapic::Config::Method.new get_key_ring_config + get_crypto_key_config = parent_rpcs.get_crypto_key if parent_rpcs.respond_to? :get_crypto_key + @get_crypto_key = ::Gapic::Config::Method.new get_crypto_key_config + get_crypto_key_version_config = parent_rpcs.get_crypto_key_version if parent_rpcs.respond_to? :get_crypto_key_version + @get_crypto_key_version = ::Gapic::Config::Method.new get_crypto_key_version_config + get_public_key_config = parent_rpcs.get_public_key if parent_rpcs.respond_to? :get_public_key + @get_public_key = ::Gapic::Config::Method.new get_public_key_config + get_import_job_config = parent_rpcs.get_import_job if parent_rpcs.respond_to? :get_import_job + @get_import_job = ::Gapic::Config::Method.new get_import_job_config + get_retired_resource_config = parent_rpcs.get_retired_resource if parent_rpcs.respond_to? :get_retired_resource + @get_retired_resource = ::Gapic::Config::Method.new get_retired_resource_config + create_key_ring_config = parent_rpcs.create_key_ring if parent_rpcs.respond_to? :create_key_ring + @create_key_ring = ::Gapic::Config::Method.new create_key_ring_config + create_crypto_key_config = parent_rpcs.create_crypto_key if parent_rpcs.respond_to? :create_crypto_key + @create_crypto_key = ::Gapic::Config::Method.new create_crypto_key_config + create_crypto_key_version_config = parent_rpcs.create_crypto_key_version if parent_rpcs.respond_to? :create_crypto_key_version + @create_crypto_key_version = ::Gapic::Config::Method.new create_crypto_key_version_config + delete_crypto_key_config = parent_rpcs.delete_crypto_key if parent_rpcs.respond_to? :delete_crypto_key + @delete_crypto_key = ::Gapic::Config::Method.new delete_crypto_key_config + delete_crypto_key_version_config = parent_rpcs.delete_crypto_key_version if parent_rpcs.respond_to? :delete_crypto_key_version + @delete_crypto_key_version = ::Gapic::Config::Method.new delete_crypto_key_version_config + import_crypto_key_version_config = parent_rpcs.import_crypto_key_version if parent_rpcs.respond_to? :import_crypto_key_version + @import_crypto_key_version = ::Gapic::Config::Method.new import_crypto_key_version_config + create_import_job_config = parent_rpcs.create_import_job if parent_rpcs.respond_to? :create_import_job + @create_import_job = ::Gapic::Config::Method.new create_import_job_config + update_crypto_key_config = parent_rpcs.update_crypto_key if parent_rpcs.respond_to? :update_crypto_key + @update_crypto_key = ::Gapic::Config::Method.new update_crypto_key_config + update_crypto_key_version_config = parent_rpcs.update_crypto_key_version if parent_rpcs.respond_to? :update_crypto_key_version + @update_crypto_key_version = ::Gapic::Config::Method.new update_crypto_key_version_config + update_crypto_key_primary_version_config = parent_rpcs.update_crypto_key_primary_version if parent_rpcs.respond_to? :update_crypto_key_primary_version + @update_crypto_key_primary_version = ::Gapic::Config::Method.new update_crypto_key_primary_version_config + destroy_crypto_key_version_config = parent_rpcs.destroy_crypto_key_version if parent_rpcs.respond_to? :destroy_crypto_key_version + @destroy_crypto_key_version = ::Gapic::Config::Method.new destroy_crypto_key_version_config + restore_crypto_key_version_config = parent_rpcs.restore_crypto_key_version if parent_rpcs.respond_to? :restore_crypto_key_version + @restore_crypto_key_version = ::Gapic::Config::Method.new restore_crypto_key_version_config + encrypt_config = parent_rpcs.encrypt if parent_rpcs.respond_to? :encrypt + @encrypt = ::Gapic::Config::Method.new encrypt_config + decrypt_config = parent_rpcs.decrypt if parent_rpcs.respond_to? :decrypt + @decrypt = ::Gapic::Config::Method.new decrypt_config + raw_encrypt_config = parent_rpcs.raw_encrypt if parent_rpcs.respond_to? :raw_encrypt + @raw_encrypt = ::Gapic::Config::Method.new raw_encrypt_config + raw_decrypt_config = parent_rpcs.raw_decrypt if parent_rpcs.respond_to? :raw_decrypt + @raw_decrypt = ::Gapic::Config::Method.new raw_decrypt_config + asymmetric_sign_config = parent_rpcs.asymmetric_sign if parent_rpcs.respond_to? :asymmetric_sign + @asymmetric_sign = ::Gapic::Config::Method.new asymmetric_sign_config + asymmetric_decrypt_config = parent_rpcs.asymmetric_decrypt if parent_rpcs.respond_to? :asymmetric_decrypt + @asymmetric_decrypt = ::Gapic::Config::Method.new asymmetric_decrypt_config + mac_sign_config = parent_rpcs.mac_sign if parent_rpcs.respond_to? :mac_sign + @mac_sign = ::Gapic::Config::Method.new mac_sign_config + mac_verify_config = parent_rpcs.mac_verify if parent_rpcs.respond_to? :mac_verify + @mac_verify = ::Gapic::Config::Method.new mac_verify_config + decapsulate_config = parent_rpcs.decapsulate if parent_rpcs.respond_to? :decapsulate + @decapsulate = ::Gapic::Config::Method.new decapsulate_config + generate_random_bytes_config = parent_rpcs.generate_random_bytes if parent_rpcs.respond_to? :generate_random_bytes + @generate_random_bytes = ::Gapic::Config::Method.new generate_random_bytes_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/operations.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/operations.rb new file mode 100644 index 000000000000..55a816c571d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Kms + module V1 + module KeyManagementService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the KeyManagementService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the KeyManagementService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudkms.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb new file mode 100644 index 000000000000..ac7d160e574b --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb @@ -0,0 +1,2114 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/kms/v1/service_pb" + +module Google + module Cloud + module Kms + module V1 + module KeyManagementService + module Rest + ## + # REST service stub for the KeyManagementService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_key_rings REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListKeyRingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ListKeyRingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ListKeyRingsResponse] + # A result object deserialized from the server's reply + def list_key_rings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_key_rings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_key_rings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ListKeyRingsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_crypto_keys REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListCryptoKeysRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ListCryptoKeysResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ListCryptoKeysResponse] + # A result object deserialized from the server's reply + def list_crypto_keys request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_crypto_keys_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_crypto_keys", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ListCryptoKeysResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_crypto_key_versions REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse] + # A result object deserialized from the server's reply + def list_crypto_key_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_crypto_key_versions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_crypto_key_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_import_jobs REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListImportJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ListImportJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ListImportJobsResponse] + # A result object deserialized from the server's reply + def list_import_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_import_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_import_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ListImportJobsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_retired_resources REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ListRetiredResourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ListRetiredResourcesResponse] + # A result object deserialized from the server's reply + def list_retired_resources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_retired_resources_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_retired_resources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_key_ring REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetKeyRingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::KeyRing] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::KeyRing] + # A result object deserialized from the server's reply + def get_key_ring request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_key_ring_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_key_ring", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::KeyRing.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_crypto_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetCryptoKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # A result object deserialized from the server's reply + def get_crypto_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_crypto_key_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_crypto_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::CryptoKey.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # A result object deserialized from the server's reply + def get_crypto_key_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_crypto_key_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_crypto_key_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_public_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetPublicKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::PublicKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::PublicKey] + # A result object deserialized from the server's reply + def get_public_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_public_key_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_public_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::PublicKey.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_import_job REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetImportJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ImportJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ImportJob] + # A result object deserialized from the server's reply + def get_import_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_import_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_import_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ImportJob.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_retired_resource REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetRetiredResourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::RetiredResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::RetiredResource] + # A result object deserialized from the server's reply + def get_retired_resource request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_retired_resource_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_retired_resource", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::RetiredResource.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_key_ring REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateKeyRingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::KeyRing] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::KeyRing] + # A result object deserialized from the server's reply + def create_key_ring request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_key_ring_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_key_ring", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::KeyRing.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_crypto_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateCryptoKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # A result object deserialized from the server's reply + def create_crypto_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_crypto_key_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_crypto_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::CryptoKey.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # A result object deserialized from the server's reply + def create_crypto_key_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_crypto_key_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_crypto_key_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_crypto_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_crypto_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_crypto_key_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_crypto_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_crypto_key_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_crypto_key_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_crypto_key_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # A result object deserialized from the server's reply + def import_crypto_key_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_crypto_key_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "import_crypto_key_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_import_job REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateImportJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ImportJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ImportJob] + # A result object deserialized from the server's reply + def create_import_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_import_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_import_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ImportJob.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_crypto_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # A result object deserialized from the server's reply + def update_crypto_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_crypto_key_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_crypto_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::CryptoKey.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # A result object deserialized from the server's reply + def update_crypto_key_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_crypto_key_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_crypto_key_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_crypto_key_primary_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # A result object deserialized from the server's reply + def update_crypto_key_primary_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_crypto_key_primary_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_crypto_key_primary_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::CryptoKey.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the destroy_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # A result object deserialized from the server's reply + def destroy_crypto_key_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_destroy_crypto_key_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "destroy_crypto_key_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the restore_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # A result object deserialized from the server's reply + def restore_crypto_key_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restore_crypto_key_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "restore_crypto_key_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the encrypt REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::EncryptRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::EncryptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::EncryptResponse] + # A result object deserialized from the server's reply + def encrypt request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_encrypt_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "encrypt", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::EncryptResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the decrypt REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DecryptRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::DecryptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::DecryptResponse] + # A result object deserialized from the server's reply + def decrypt request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_decrypt_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "decrypt", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::DecryptResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the raw_encrypt REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::RawEncryptRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::RawEncryptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::RawEncryptResponse] + # A result object deserialized from the server's reply + def raw_encrypt request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_raw_encrypt_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "raw_encrypt", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::RawEncryptResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the raw_decrypt REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::RawDecryptRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::RawDecryptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::RawDecryptResponse] + # A result object deserialized from the server's reply + def raw_decrypt request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_raw_decrypt_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "raw_decrypt", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::RawDecryptResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the asymmetric_sign REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::AsymmetricSignRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::AsymmetricSignResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::AsymmetricSignResponse] + # A result object deserialized from the server's reply + def asymmetric_sign request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_asymmetric_sign_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "asymmetric_sign", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::AsymmetricSignResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the asymmetric_decrypt REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::AsymmetricDecryptRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] + # A result object deserialized from the server's reply + def asymmetric_decrypt request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_asymmetric_decrypt_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "asymmetric_decrypt", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the mac_sign REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::MacSignRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::MacSignResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::MacSignResponse] + # A result object deserialized from the server's reply + def mac_sign request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_mac_sign_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "mac_sign", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::MacSignResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the mac_verify REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::MacVerifyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::MacVerifyResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::MacVerifyResponse] + # A result object deserialized from the server's reply + def mac_verify request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_mac_verify_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "mac_verify", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::MacVerifyResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the decapsulate REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DecapsulateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::DecapsulateResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::DecapsulateResponse] + # A result object deserialized from the server's reply + def decapsulate request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_decapsulate_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "decapsulate", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::DecapsulateResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the generate_random_bytes REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GenerateRandomBytesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] + # A result object deserialized from the server's reply + def generate_random_bytes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_random_bytes_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "generate_random_bytes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_key_rings REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListKeyRingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_key_rings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/keyRings", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_crypto_keys REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListCryptoKeysRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_crypto_keys_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/cryptoKeys", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_crypto_key_versions REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_crypto_key_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/cryptoKeyVersions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_import_jobs REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListImportJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_import_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/importJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_retired_resources REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_retired_resources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/retiredResources", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_key_ring REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetKeyRingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_key_ring_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_crypto_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetCryptoKeyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_crypto_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_crypto_key_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_public_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetPublicKeyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_public_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/publicKey", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_import_job REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetImportJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_import_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/importJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_retired_resource REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetRetiredResourceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_retired_resource_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/retiredResources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_key_ring REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateKeyRingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_key_ring_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/keyRings", + body: "key_ring", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_crypto_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateCryptoKeyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_crypto_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/cryptoKeys", + body: "crypto_key", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_crypto_key_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/cryptoKeyVersions", + body: "crypto_key_version", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_crypto_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_crypto_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_crypto_key_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_crypto_key_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/cryptoKeyVersions:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_import_job REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::CreateImportJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_import_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/importJobs", + body: "import_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_crypto_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_crypto_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{crypto_key.name}", + body: "crypto_key", + matches: [ + ["crypto_key.name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_crypto_key_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{crypto_key_version.name}", + body: "crypto_key_version", + matches: [ + ["crypto_key_version.name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_crypto_key_primary_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_crypto_key_primary_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:updatePrimaryVersion", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the destroy_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_destroy_crypto_key_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:destroy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restore_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_restore_crypto_key_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:restore", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the encrypt REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::EncryptRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_encrypt_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:encrypt", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the decrypt REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DecryptRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_decrypt_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:decrypt", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the raw_encrypt REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::RawEncryptRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_raw_encrypt_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:rawEncrypt", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the raw_decrypt REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::RawDecryptRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_raw_decrypt_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:rawDecrypt", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the asymmetric_sign REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::AsymmetricSignRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_asymmetric_sign_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:asymmetricSign", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the asymmetric_decrypt REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::AsymmetricDecryptRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_asymmetric_decrypt_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:asymmetricDecrypt", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the mac_sign REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::MacSignRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_mac_sign_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:macSign", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the mac_verify REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::MacVerifyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_mac_verify_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:macVerify", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the decapsulate REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DecapsulateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_decapsulate_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:decapsulate", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_random_bytes REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GenerateRandomBytesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_generate_random_bytes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{location}:generateRandomBytes", + body: "*", + matches: [ + ["location", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb new file mode 100644 index 000000000000..3321840e9771 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/kms/v1/resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' + + +descriptor_data = "\n#google/cloud/kms/v1/resources.proto\x12\x13google.cloud.kms.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xb5\x01\n\x07KeyRing\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:a\xea\x41^\n\x1f\x63loudkms.googleapis.com/KeyRing\x12;projects/{project}/locations/{location}/keyRings/{key_ring}\"\xa8\x08\n\tCryptoKey\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12;\n\x07primary\x18\x02 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x03\x12\x45\n\x07purpose\x18\x03 \x01(\x0e\x32/.google.cloud.kms.v1.CryptoKey.CryptoKeyPurposeB\x03\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\x12next_rotation_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x0frotation_period\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12G\n\x10version_template\x18\x0b \x01(\x0b\x32-.google.cloud.kms.v1.CryptoKeyVersionTemplate\x12:\n\x06labels\x18\n \x03(\x0b\x32*.google.cloud.kms.v1.CryptoKey.LabelsEntry\x12\x18\n\x0bimport_only\x18\r \x01(\x08\x42\x03\xe0\x41\x05\x12\x42\n\x1a\x64\x65stroy_scheduled_duration\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x05\x12%\n\x12\x63rypto_key_backend\x18\x0f \x01(\tB\t\xe0\x41\x05\xfa\x41\x03\n\x01*\x12\x61\n key_access_justifications_policy\x18\x11 \x01(\x0b\x32\x32.google.cloud.kms.v1.KeyAccessJustificationsPolicyB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb1\x01\n\x10\x43ryptoKeyPurpose\x12\"\n\x1e\x43RYPTO_KEY_PURPOSE_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x45NCRYPT_DECRYPT\x10\x01\x12\x13\n\x0f\x41SYMMETRIC_SIGN\x10\x05\x12\x16\n\x12\x41SYMMETRIC_DECRYPT\x10\x06\x12\x17\n\x13RAW_ENCRYPT_DECRYPT\x10\x07\x12\x07\n\x03MAC\x10\t\x12\x15\n\x11KEY_ENCAPSULATION\x10\n:{\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}B\x13\n\x11rotation_schedule\"\xb3\x01\n\x18\x43ryptoKeyVersionTemplate\x12>\n\x10protection_level\x18\x01 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12W\n\talgorithm\x18\x03 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x02\"\xb1\x03\n\x17KeyOperationAttestation\x12S\n\x06\x66ormat\x18\x04 \x01(\x0e\x32>.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormatB\x03\xe0\x41\x03\x12\x14\n\x07\x63ontent\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x03\x12X\n\x0b\x63\x65rt_chains\x18\x06 \x01(\x0b\x32>.google.cloud.kms.v1.KeyOperationAttestation.CertificateChainsB\x03\xe0\x41\x03\x1a\x64\n\x11\x43\x65rtificateChains\x12\x14\n\x0c\x63\x61vium_certs\x18\x01 \x03(\t\x12\x19\n\x11google_card_certs\x18\x02 \x03(\t\x12\x1e\n\x16google_partition_certs\x18\x03 \x03(\t\"k\n\x11\x41ttestationFormat\x12\"\n\x1e\x41TTESTATION_FORMAT_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43\x41VIUM_V1_COMPRESSED\x10\x03\x12\x18\n\x14\x43\x41VIUM_V2_COMPRESSED\x10\x04\"\xe7\x13\n\x10\x43ryptoKeyVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12J\n\x05state\x18\x03 \x01(\x0e\x32;.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState\x12\x43\n\x10protection_level\x18\x07 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x03\xe0\x41\x03\x12W\n\talgorithm\x18\n \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x03\x12\x46\n\x0b\x61ttestation\x18\x08 \x01(\x0b\x32,.google.cloud.kms.v1.KeyOperationAttestationB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rgenerate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12;\n\x12\x64\x65stroy_event_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x17\n\nimport_job\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0bimport_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x15import_failure_reason\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12&\n\x19generation_failure_reason\x18\x13 \x01(\tB\x03\xe0\x41\x03\x12\x30\n#external_destruction_failure_reason\x18\x14 \x01(\tB\x03\xe0\x41\x03\x12^\n!external_protection_level_options\x18\x11 \x01(\x0b\x32\x33.google.cloud.kms.v1.ExternalProtectionLevelOptions\x12\x1e\n\x11reimport_eligible\x18\x12 \x01(\x08\x42\x03\xe0\x41\x03\"\xc8\x08\n\x19\x43ryptoKeyVersionAlgorithm\x12,\n(CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED\x10\x00\x12\x1f\n\x1bGOOGLE_SYMMETRIC_ENCRYPTION\x10\x01\x12\x0f\n\x0b\x41\x45S_128_GCM\x10)\x12\x0f\n\x0b\x41\x45S_256_GCM\x10\x13\x12\x0f\n\x0b\x41\x45S_128_CBC\x10*\x12\x0f\n\x0b\x41\x45S_256_CBC\x10+\x12\x0f\n\x0b\x41\x45S_128_CTR\x10,\x12\x0f\n\x0b\x41\x45S_256_CTR\x10-\x12\x1c\n\x18RSA_SIGN_PSS_2048_SHA256\x10\x02\x12\x1c\n\x18RSA_SIGN_PSS_3072_SHA256\x10\x03\x12\x1c\n\x18RSA_SIGN_PSS_4096_SHA256\x10\x04\x12\x1c\n\x18RSA_SIGN_PSS_4096_SHA512\x10\x0f\x12\x1e\n\x1aRSA_SIGN_PKCS1_2048_SHA256\x10\x05\x12\x1e\n\x1aRSA_SIGN_PKCS1_3072_SHA256\x10\x06\x12\x1e\n\x1aRSA_SIGN_PKCS1_4096_SHA256\x10\x07\x12\x1e\n\x1aRSA_SIGN_PKCS1_4096_SHA512\x10\x10\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_2048\x10\x1c\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_3072\x10\x1d\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_4096\x10\x1e\x12 \n\x1cRSA_DECRYPT_OAEP_2048_SHA256\x10\x08\x12 \n\x1cRSA_DECRYPT_OAEP_3072_SHA256\x10\t\x12 \n\x1cRSA_DECRYPT_OAEP_4096_SHA256\x10\n\x12 \n\x1cRSA_DECRYPT_OAEP_4096_SHA512\x10\x11\x12\x1e\n\x1aRSA_DECRYPT_OAEP_2048_SHA1\x10%\x12\x1e\n\x1aRSA_DECRYPT_OAEP_3072_SHA1\x10&\x12\x1e\n\x1aRSA_DECRYPT_OAEP_4096_SHA1\x10\'\x12\x17\n\x13\x45\x43_SIGN_P256_SHA256\x10\x0c\x12\x17\n\x13\x45\x43_SIGN_P384_SHA384\x10\r\x12\x1c\n\x18\x45\x43_SIGN_SECP256K1_SHA256\x10\x1f\x12\x13\n\x0f\x45\x43_SIGN_ED25519\x10(\x12\x0f\n\x0bHMAC_SHA256\x10 \x12\r\n\tHMAC_SHA1\x10!\x12\x0f\n\x0bHMAC_SHA384\x10\"\x12\x0f\n\x0bHMAC_SHA512\x10#\x12\x0f\n\x0bHMAC_SHA224\x10$\x12!\n\x1d\x45XTERNAL_SYMMETRIC_ENCRYPTION\x10\x12\x12\x0e\n\nML_KEM_768\x10/\x12\x0f\n\x0bML_KEM_1024\x10\x30\x12\r\n\tKEM_XWING\x10?\x12\x15\n\x11PQ_SIGN_ML_DSA_65\x10\x38\x12\x1d\n\x19PQ_SIGN_SLH_DSA_SHA2_128S\x10\x39\"\x9b\x02\n\x15\x43ryptoKeyVersionState\x12(\n$CRYPTO_KEY_VERSION_STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12PENDING_GENERATION\x10\x05\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03\x12\x15\n\x11\x44\x45STROY_SCHEDULED\x10\x04\x12\x12\n\x0ePENDING_IMPORT\x10\x06\x12\x11\n\rIMPORT_FAILED\x10\x07\x12\x15\n\x11GENERATION_FAILED\x10\x08\x12 \n\x1cPENDING_EXTERNAL_DESTRUCTION\x10\t\x12\x1f\n\x1b\x45XTERNAL_DESTRUCTION_FAILED\x10\n\"I\n\x14\x43ryptoKeyVersionView\x12\'\n#CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46ULL\x10\x01:\xaa\x01\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}\"U\n\x0f\x43hecksummedData\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x34\n\x0f\x63rc32c_checksum\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"\x8c\x05\n\tPublicKey\x12\x0b\n\x03pem\x18\x01 \x01(\t\x12R\n\talgorithm\x18\x02 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm\x12/\n\npem_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x0c\n\x04name\x18\x04 \x01(\t\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12I\n\x11public_key_format\x18\x07 \x01(\x0e\x32..google.cloud.kms.v1.PublicKey.PublicKeyFormat\x12\x38\n\npublic_key\x18\x08 \x01(\x0b\x32$.google.cloud.kms.v1.ChecksummedData\"i\n\x0fPublicKeyFormat\x12!\n\x1dPUBLIC_KEY_FORMAT_UNSPECIFIED\x10\x00\x12\x07\n\x03PEM\x10\x01\x12\x07\n\x03\x44\x45R\x10\x02\x12\x0c\n\x08NIST_PQC\x10\x03\x12\x13\n\x0fXWING_RAW_BYTES\x10\x04:\xae\x01\xea\x41\xaa\x01\n!cloudkms.googleapis.com/PublicKey\x12\x84\x01projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}/publicKey\"\xfb\x08\n\tImportJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12J\n\rimport_method\x18\x02 \x01(\x0e\x32+.google.cloud.kms.v1.ImportJob.ImportMethodB\x06\xe0\x41\x02\xe0\x41\x05\x12\x46\n\x10protection_level\x18\t \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x06\xe0\x41\x02\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rgenerate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12:\n\x11\x65xpire_event_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x05state\x18\x06 \x01(\x0e\x32-.google.cloud.kms.v1.ImportJob.ImportJobStateB\x03\xe0\x41\x03\x12I\n\npublic_key\x18\x07 \x01(\x0b\x32\x30.google.cloud.kms.v1.ImportJob.WrappingPublicKeyB\x03\xe0\x41\x03\x12\x46\n\x0b\x61ttestation\x18\x08 \x01(\x0b\x32,.google.cloud.kms.v1.KeyOperationAttestationB\x03\xe0\x41\x03\x12%\n\x12\x63rypto_key_backend\x18\x0b \x01(\tB\t\xe0\x41\x05\xfa\x41\x03\n\x01*\x1a \n\x11WrappingPublicKey\x12\x0b\n\x03pem\x18\x01 \x01(\t\"\xe5\x01\n\x0cImportMethod\x12\x1d\n\x19IMPORT_METHOD_UNSPECIFIED\x10\x00\x12\x1e\n\x1aRSA_OAEP_3072_SHA1_AES_256\x10\x01\x12\x1e\n\x1aRSA_OAEP_4096_SHA1_AES_256\x10\x02\x12 \n\x1cRSA_OAEP_3072_SHA256_AES_256\x10\x03\x12 \n\x1cRSA_OAEP_4096_SHA256_AES_256\x10\x04\x12\x18\n\x14RSA_OAEP_3072_SHA256\x10\x05\x12\x18\n\x14RSA_OAEP_4096_SHA256\x10\x06\"c\n\x0eImportJobState\x12 \n\x1cIMPORT_JOB_STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12PENDING_GENERATION\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x45XPIRED\x10\x03:{\xea\x41x\n!cloudkms.googleapis.com/ImportJob\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}\"[\n\x1e\x45xternalProtectionLevelOptions\x12\x18\n\x10\x65xternal_key_uri\x18\x01 \x01(\t\x12\x1f\n\x17\x65km_connection_key_path\x18\x02 \x01(\t\"b\n\x1dKeyAccessJustificationsPolicy\x12\x41\n\x16\x61llowed_access_reasons\x18\x01 \x03(\x0e\x32!.google.cloud.kms.v1.AccessReason\"\xb9\x02\n\x0fRetiredResource\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x1e\n\x11original_resource\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rresource_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\x9d\x01\xea\x41\x99\x01\n\'cloudkms.googleapis.com/RetiredResource\x12Kprojects/{project}/locations/{location}/retiredResources/{retired_resource}*\x10retiredResources2\x0fretiredResource*\x81\x01\n\x0fProtectionLevel\x12 \n\x1cPROTECTION_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08SOFTWARE\x10\x01\x12\x07\n\x03HSM\x10\x02\x12\x0c\n\x08\x45XTERNAL\x10\x03\x12\x10\n\x0c\x45XTERNAL_VPC\x10\x04\x12\x15\n\x11HSM_SINGLE_TENANT\x10\x05*\xb3\x03\n\x0c\x41\x63\x63\x65ssReason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x43USTOMER_INITIATED_SUPPORT\x10\x01\x12\x1c\n\x18GOOGLE_INITIATED_SERVICE\x10\x02\x12\x1c\n\x18THIRD_PARTY_DATA_REQUEST\x10\x03\x12\x1b\n\x17GOOGLE_INITIATED_REVIEW\x10\x04\x12\x1d\n\x19\x43USTOMER_INITIATED_ACCESS\x10\x05\x12%\n!GOOGLE_INITIATED_SYSTEM_OPERATION\x10\x06\x12\x17\n\x13REASON_NOT_EXPECTED\x10\x07\x12*\n\"MODIFIED_CUSTOMER_INITIATED_ACCESS\x10\x08\x1a\x02\x08\x01\x12\x32\n*MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION\x10\t\x1a\x02\x08\x01\x12\'\n#GOOGLE_RESPONSE_TO_PRODUCTION_ALERT\x10\n\x12*\n&CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING\x10\x0b\x42\x85\x01\n\x17\x63om.google.cloud.kms.v1B\x11KmsResourcesProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.Int64Value", "google/protobuf/wrappers.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Kms + module V1 + KeyRing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyRing").msgclass + CryptoKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKey").msgclass + CryptoKey::CryptoKeyPurpose = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose").enummodule + CryptoKeyVersionTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKeyVersionTemplate").msgclass + KeyOperationAttestation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyOperationAttestation").msgclass + KeyOperationAttestation::CertificateChains = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyOperationAttestation.CertificateChains").msgclass + KeyOperationAttestation::AttestationFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat").enummodule + CryptoKeyVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKeyVersion").msgclass + CryptoKeyVersion::CryptoKeyVersionAlgorithm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm").enummodule + CryptoKeyVersion::CryptoKeyVersionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState").enummodule + CryptoKeyVersion::CryptoKeyVersionView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView").enummodule + ChecksummedData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ChecksummedData").msgclass + PublicKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.PublicKey").msgclass + PublicKey::PublicKeyFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.PublicKey.PublicKeyFormat").enummodule + ImportJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportJob").msgclass + ImportJob::WrappingPublicKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportJob.WrappingPublicKey").msgclass + ImportJob::ImportMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportJob.ImportMethod").enummodule + ImportJob::ImportJobState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportJob.ImportJobState").enummodule + ExternalProtectionLevelOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ExternalProtectionLevelOptions").msgclass + KeyAccessJustificationsPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyAccessJustificationsPolicy").msgclass + RetiredResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RetiredResource").msgclass + ProtectionLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ProtectionLevel").enummodule + AccessReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AccessReason").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/rest.rb new file mode 100644 index 000000000000..37c974835abb --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/rest.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/kms/v1/autokey/rest" +require "google/cloud/kms/v1/autokey_admin/rest" +require "google/cloud/kms/v1/ekm_service/rest" +require "google/cloud/kms/v1/hsm_management/rest" +require "google/cloud/kms/v1/key_management_service/rest" +require "google/cloud/kms/v1/bindings_override" +require "google/cloud/kms/v1/version" + +module Google + module Cloud + module Kms + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/kms/v1/rest" + # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb new file mode 100644 index 000000000000..688dad631edd --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/kms/v1/service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/kms/v1/resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/wrappers_pb' + + +descriptor_data = "\n!google/cloud/kms/v1/service.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/kms/v1/resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xad\x01\n\x13ListKeyRingsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xff\x01\n\x15ListCryptoKeysRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12P\n\x0cversion_view\x18\x04 \x01(\x0e\x32:.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"\x80\x02\n\x1cListCryptoKeyVersionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12H\n\x04view\x18\x04 \x01(\x0e\x32:.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"\xad\x01\n\x15ListImportJobsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x8f\x01\n\x1bListRetiredResourcesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'cloudkms.googleapis.com/RetiredResource\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"t\n\x14ListKeyRingsResponse\x12/\n\tkey_rings\x18\x01 \x03(\x0b\x32\x1c.google.cloud.kms.v1.KeyRing\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"z\n\x16ListCryptoKeysResponse\x12\x33\n\x0b\x63rypto_keys\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKey\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x90\x01\n\x1dListCryptoKeyVersionsResponse\x12\x42\n\x13\x63rypto_key_versions\x18\x01 \x03(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"z\n\x16ListImportJobsResponse\x12\x33\n\x0bimport_jobs\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.ImportJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x8c\x01\n\x1cListRetiredResourcesResponse\x12?\n\x11retired_resources\x18\x01 \x03(\x0b\x32$.google.cloud.kms.v1.RetiredResource\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x03\"J\n\x11GetKeyRingRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\"N\n\x13GetCryptoKeyRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\\\n\x1aGetCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\xa5\x01\n\x13GetPublicKeyRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12N\n\x11public_key_format\x18\x02 \x01(\x0e\x32..google.cloud.kms.v1.PublicKey.PublicKeyFormatB\x03\xe0\x41\x01\"N\n\x13GetImportJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/ImportJob\"Z\n\x19GetRetiredResourceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'cloudkms.googleapis.com/RetiredResource\"\xa0\x01\n\x14\x43reateKeyRingRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x18\n\x0bkey_ring_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x08key_ring\x18\x03 \x01(\x0b\x32\x1c.google.cloud.kms.v1.KeyRingB\x03\xe0\x41\x02\"\xcd\x01\n\x16\x43reateCryptoKeyRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x1a\n\rcrypto_key_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\ncrypto_key\x18\x03 \x01(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKeyB\x03\xe0\x41\x02\x12%\n\x1dskip_initial_version_creation\x18\x05 \x01(\x08\"\xa2\x01\n\x1d\x43reateCryptoKeyVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x46\n\x12\x63rypto_key_version\x18\x02 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x02\"Q\n\x16\x44\x65leteCryptoKeyRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"_\n\x1d\x44\x65leteCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\xf0\x02\n\x1dImportCryptoKeyVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12L\n\x12\x63rypto_key_version\x18\x06 \x01(\tB0\xe0\x41\x01\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12W\n\talgorithm\x18\x02 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x02\x12\x17\n\nimport_job\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0bwrapped_key\x18\x08 \x01(\x0c\x42\x03\xe0\x41\x01\x12\"\n\x13rsa_aes_wrapped_key\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x01H\x00\x42\x16\n\x14wrapped_key_material\"\xa6\x01\n\x16\x43reateImportJobRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x1a\n\rimport_job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\nimport_job\x18\x03 \x01(\x0b\x32\x1e.google.cloud.kms.v1.ImportJobB\x03\xe0\x41\x02\"\x87\x01\n\x16UpdateCryptoKeyRequest\x12\x37\n\ncrypto_key\x18\x01 \x01(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKeyB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x9d\x01\n\x1dUpdateCryptoKeyVersionRequest\x12\x46\n\x12\x63rypto_key_version\x18\x01 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x83\x01\n$UpdateCryptoKeyPrimaryVersionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\"\n\x15\x63rypto_key_version_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"`\n\x1e\x44\x65stroyCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"`\n\x1eRestoreCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\xf9\x01\n\x0e\x45ncryptRequest\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x16\n\tplaintext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12:\n\x10plaintext_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x08 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x9b\x02\n\x0e\x44\x65\x63ryptRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12;\n\x11\x63iphertext_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x06 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xe2\x02\n\x11RawEncryptRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tplaintext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12:\n\x10plaintext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\"\n\x15initialization_vector\x18\x06 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x46\n\x1cinitialization_vector_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xf8\x02\n\x11RawDecryptRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12\"\n\x15initialization_vector\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x12\n\ntag_length\x18\x05 \x01(\x05\x12;\n\x11\x63iphertext_crc32c\x18\x06 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x46\n\x1cinitialization_vector_crc32c\x18\x08 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x8c\x02\n\x15\x41symmetricSignRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x30\n\x06\x64igest\x18\x03 \x01(\x0b\x32\x1b.google.cloud.kms.v1.DigestB\x03\xe0\x41\x01\x12\x37\n\rdigest_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x11\n\x04\x64\x61ta\x18\x06 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xb0\x01\n\x18\x41symmetricDecryptRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x17\n\nciphertext\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x02\x12;\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x9a\x01\n\x0eMacSignRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xe4\x01\n\x10MacVerifyRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x10\n\x03mac\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x34\n\nmac_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xaa\x01\n\x12\x44\x65\x63\x61psulateRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12;\n\x11\x63iphertext_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x84\x01\n\x1aGenerateRandomBytesRequest\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x14\n\x0clength_bytes\x18\x02 \x01(\x05\x12>\n\x10protection_level\x18\x03 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\x85\x02\n\x0f\x45ncryptResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nciphertext\x18\x02 \x01(\x0c\x12\x36\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12!\n\x19verified_plaintext_crc32c\x18\x05 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x06 \x01(\x08\x12>\n\x10protection_level\x18\x07 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xb1\x01\n\x0f\x44\x65\x63ryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x14\n\x0cused_primary\x18\x03 \x01(\x08\x12>\n\x10protection_level\x18\x04 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xad\x03\n\x12RawEncryptResponse\x12\x12\n\nciphertext\x18\x01 \x01(\x0c\x12\x1d\n\x15initialization_vector\x18\x02 \x01(\x0c\x12\x12\n\ntag_length\x18\x03 \x01(\x05\x12\x36\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x41\n\x1cinitialization_vector_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12!\n\x19verified_plaintext_crc32c\x18\x06 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x07 \x01(\x08\x12-\n%verified_initialization_vector_crc32c\x18\n \x01(\x08\x12\x0c\n\x04name\x18\x08 \x01(\t\x12>\n\x10protection_level\x18\t \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xa8\x02\n\x12RawDecryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12>\n\x10protection_level\x18\x03 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12\"\n\x1averified_ciphertext_crc32c\x18\x04 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x05 \x01(\x08\x12-\n%verified_initialization_vector_crc32c\x18\x06 \x01(\x08\"\xee\x01\n\x16\x41symmetricSignResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\x35\n\x10signature_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x1e\n\x16verified_digest_crc32c\x18\x03 \x01(\x08\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x1c\n\x14verified_data_crc32c\x18\x05 \x01(\x08\x12>\n\x10protection_level\x18\x06 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xc9\x01\n\x19\x41symmetricDecryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\"\n\x1averified_ciphertext_crc32c\x18\x03 \x01(\x08\x12>\n\x10protection_level\x18\x04 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xbb\x01\n\x0fMacSignResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03mac\x18\x02 \x01(\x0c\x12/\n\nmac_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x1c\n\x14verified_data_crc32c\x18\x04 \x01(\x08\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xd1\x01\n\x11MacVerifyResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x1c\n\x14verified_data_crc32c\x18\x03 \x01(\x08\x12\x1b\n\x13verified_mac_crc32c\x18\x04 \x01(\x08\x12\"\n\x1averified_success_integrity\x18\x05 \x01(\x08\x12>\n\x10protection_level\x18\x06 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xda\x01\n\x13\x44\x65\x63\x61psulateResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rshared_secret\x18\x02 \x01(\x0c\x12!\n\x14shared_secret_crc32c\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12\"\n\x1averified_ciphertext_crc32c\x18\x04 \x01(\x08\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x17\n\x15_shared_secret_crc32c\"]\n\x1bGenerateRandomBytesResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x30\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"H\n\x06\x44igest\x12\x10\n\x06sha256\x18\x01 \x01(\x0cH\x00\x12\x10\n\x06sha384\x18\x02 \x01(\x0cH\x00\x12\x10\n\x06sha512\x18\x03 \x01(\x0cH\x00\x42\x08\n\x06\x64igest\"e\n\x10LocationMetadata\x12\x15\n\rhsm_available\x18\x01 \x01(\x08\x12\x15\n\rekm_available\x18\x02 \x01(\x08\x12#\n\x1bhsm_single_tenant_available\x18\x03 \x01(\x08\"d\n\x17\x44\x65leteCryptoKeyMetadata\x12I\n\x10retired_resource\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'cloudkms.googleapis.com/RetiredResource\" \n\x1e\x44\x65leteCryptoKeyVersionMetadata2\xb4\x36\n\x14KeyManagementService\x12\xa2\x01\n\x0cListKeyRings\x12(.google.cloud.kms.v1.ListKeyRingsRequest\x1a).google.cloud.kms.v1.ListKeyRingsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/keyRings\x12\xb5\x01\n\x0eListCryptoKeys\x12*.google.cloud.kms.v1.ListCryptoKeysRequest\x1a+.google.cloud.kms.v1.ListCryptoKeysResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys\x12\xde\x01\n\x15ListCryptoKeyVersions\x12\x31.google.cloud.kms.v1.ListCryptoKeyVersionsRequest\x1a\x32.google.cloud.kms.v1.ListCryptoKeyVersionsResponse\"^\xda\x41\x06parent\x82\xd3\xe4\x93\x02O\x12M/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions\x12\xb5\x01\n\x0eListImportJobs\x12*.google.cloud.kms.v1.ListImportJobsRequest\x1a+.google.cloud.kms.v1.ListImportJobsResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs\x12\xc2\x01\n\x14ListRetiredResources\x12\x30.google.cloud.kms.v1.ListRetiredResourcesRequest\x1a\x31.google.cloud.kms.v1.ListRetiredResourcesResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/retiredResources\x12\x8f\x01\n\nGetKeyRing\x12&.google.cloud.kms.v1.GetKeyRingRequest\x1a\x1c.google.cloud.kms.v1.KeyRing\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/keyRings/*}\x12\xa2\x01\n\x0cGetCryptoKey\x12(.google.cloud.kms.v1.GetCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}\x12\xcb\x01\n\x13GetCryptoKeyVersion\x12/.google.cloud.kms.v1.GetCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\\\xda\x41\x04name\x82\xd3\xe4\x93\x02O\x12M/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}\x12\xc0\x01\n\x0cGetPublicKey\x12(.google.cloud.kms.v1.GetPublicKeyRequest\x1a\x1e.google.cloud.kms.v1.PublicKey\"f\xda\x41\x04name\x82\xd3\xe4\x93\x02Y\x12W/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}/publicKey\x12\xa2\x01\n\x0cGetImportJob\x12(.google.cloud.kms.v1.GetImportJobRequest\x1a\x1e.google.cloud.kms.v1.ImportJob\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/keyRings/*/importJobs/*}\x12\xaf\x01\n\x12GetRetiredResource\x12..google.cloud.kms.v1.GetRetiredResourceRequest\x1a$.google.cloud.kms.v1.RetiredResource\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/retiredResources/*}\x12\xb6\x01\n\rCreateKeyRing\x12).google.cloud.kms.v1.CreateKeyRingRequest\x1a\x1c.google.cloud.kms.v1.KeyRing\"\\\xda\x41\x1bparent,key_ring_id,key_ring\x82\xd3\xe4\x93\x02\x38\",/v1/{parent=projects/*/locations/*}/keyRings:\x08key_ring\x12\xcf\x01\n\x0f\x43reateCryptoKey\x12+.google.cloud.kms.v1.CreateCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"o\xda\x41\x1fparent,crypto_key_id,crypto_key\x82\xd3\xe4\x93\x02G\"9/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys:\ncrypto_key\x12\xfb\x01\n\x16\x43reateCryptoKeyVersion\x12\x32.google.cloud.kms.v1.CreateCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\x85\x01\xda\x41\x19parent,crypto_key_version\x82\xd3\xe4\x93\x02\x63\"M/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:\x12\x63rypto_key_version\x12\xda\x01\n\x0f\x44\x65leteCryptoKey\x12+.google.cloud.kms.v1.DeleteCryptoKeyRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteCryptoKeyMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}\x12\x84\x02\n\x16\x44\x65leteCryptoKeyVersion\x12\x32.google.cloud.kms.v1.DeleteCryptoKeyVersionRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41\x37\n\x15google.protobuf.Empty\x12\x1e\x44\x65leteCryptoKeyVersionMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02O*M/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}\x12\xd4\x01\n\x16ImportCryptoKeyVersion\x12\x32.google.cloud.kms.v1.ImportCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"_\x82\xd3\xe4\x93\x02Y\"T/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:import:\x01*\x12\xcf\x01\n\x0f\x43reateImportJob\x12+.google.cloud.kms.v1.CreateImportJobRequest\x1a\x1e.google.cloud.kms.v1.ImportJob\"o\xda\x41\x1fparent,import_job_id,import_job\x82\xd3\xe4\x93\x02G\"9/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs:\nimport_job\x12\xd1\x01\n\x0fUpdateCryptoKey\x12+.google.cloud.kms.v1.UpdateCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"q\xda\x41\x16\x63rypto_key,update_mask\x82\xd3\xe4\x93\x02R2D/v1/{crypto_key.name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:\ncrypto_key\x12\x93\x02\n\x16UpdateCryptoKeyVersion\x12\x32.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\x9d\x01\xda\x41\x1e\x63rypto_key_version,update_mask\x82\xd3\xe4\x93\x02v2`/v1/{crypto_key_version.name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:\x12\x63rypto_key_version\x12\xf2\x01\n\x1dUpdateCryptoKeyPrimaryVersion\x12\x39.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"v\xda\x41\x1aname,crypto_key_version_id\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:updatePrimaryVersion:\x01*\x12\xde\x01\n\x17\x44\x65stroyCryptoKeyVersion\x12\x33.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:destroy:\x01*\x12\xde\x01\n\x17RestoreCryptoKeyVersion\x12\x33.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:restore:\x01*\x12\xb4\x01\n\x07\x45ncrypt\x12#.google.cloud.kms.v1.EncryptRequest\x1a$.google.cloud.kms.v1.EncryptResponse\"^\xda\x41\x0ename,plaintext\x82\xd3\xe4\x93\x02G\"B/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/**}:encrypt:\x01*\x12\xb4\x01\n\x07\x44\x65\x63rypt\x12#.google.cloud.kms.v1.DecryptRequest\x1a$.google.cloud.kms.v1.DecryptResponse\"^\xda\x41\x0fname,ciphertext\x82\xd3\xe4\x93\x02\x46\"A/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:decrypt:\x01*\x12\xc2\x01\n\nRawEncrypt\x12&.google.cloud.kms.v1.RawEncryptRequest\x1a\'.google.cloud.kms.v1.RawEncryptResponse\"c\x82\xd3\xe4\x93\x02]\"X/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawEncrypt:\x01*\x12\xc2\x01\n\nRawDecrypt\x12&.google.cloud.kms.v1.RawDecryptRequest\x1a\'.google.cloud.kms.v1.RawDecryptResponse\"c\x82\xd3\xe4\x93\x02]\"X/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawDecrypt:\x01*\x12\xe0\x01\n\x0e\x41symmetricSign\x12*.google.cloud.kms.v1.AsymmetricSignRequest\x1a+.google.cloud.kms.v1.AsymmetricSignResponse\"u\xda\x41\x0bname,digest\x82\xd3\xe4\x93\x02\x61\"\\/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricSign:\x01*\x12\xf0\x01\n\x11\x41symmetricDecrypt\x12-.google.cloud.kms.v1.AsymmetricDecryptRequest\x1a..google.cloud.kms.v1.AsymmetricDecryptResponse\"|\xda\x41\x0fname,ciphertext\x82\xd3\xe4\x93\x02\x64\"_/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricDecrypt:\x01*\x12\xc2\x01\n\x07MacSign\x12#.google.cloud.kms.v1.MacSignRequest\x1a$.google.cloud.kms.v1.MacSignResponse\"l\xda\x41\tname,data\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macSign:\x01*\x12\xce\x01\n\tMacVerify\x12%.google.cloud.kms.v1.MacVerifyRequest\x1a&.google.cloud.kms.v1.MacVerifyResponse\"r\xda\x41\rname,data,mac\x82\xd3\xe4\x93\x02\\\"W/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macVerify:\x01*\x12\xc6\x01\n\x0b\x44\x65\x63\x61psulate\x12\'.google.cloud.kms.v1.DecapsulateRequest\x1a(.google.cloud.kms.v1.DecapsulateResponse\"d\x82\xd3\xe4\x93\x02^\"Y/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:decapsulate:\x01*\x12\xe7\x01\n\x13GenerateRandomBytes\x12/.google.cloud.kms.v1.GenerateRandomBytesRequest\x1a\x30.google.cloud.kms.v1.GenerateRandomBytesResponse\"m\xda\x41&location,length_bytes,protection_level\x82\xd3\xe4\x93\x02>\"9/v1/{location=projects/*/locations/*}:generateRandomBytes:\x01*\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsB|\n\x17\x63om.google.cloud.kms.v1B\x08KmsProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.kms.v1.KeyRing", "google/cloud/kms/v1/resources.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Int64Value", "google/protobuf/wrappers.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Kms + module V1 + ListKeyRingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListKeyRingsRequest").msgclass + ListCryptoKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeysRequest").msgclass + ListCryptoKeyVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeyVersionsRequest").msgclass + ListImportJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListImportJobsRequest").msgclass + ListRetiredResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListRetiredResourcesRequest").msgclass + ListKeyRingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListKeyRingsResponse").msgclass + ListCryptoKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeysResponse").msgclass + ListCryptoKeyVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeyVersionsResponse").msgclass + ListImportJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListImportJobsResponse").msgclass + ListRetiredResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListRetiredResourcesResponse").msgclass + GetKeyRingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetKeyRingRequest").msgclass + GetCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetCryptoKeyRequest").msgclass + GetCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetCryptoKeyVersionRequest").msgclass + GetPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetPublicKeyRequest").msgclass + GetImportJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetImportJobRequest").msgclass + GetRetiredResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetRetiredResourceRequest").msgclass + CreateKeyRingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateKeyRingRequest").msgclass + CreateCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateCryptoKeyRequest").msgclass + CreateCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateCryptoKeyVersionRequest").msgclass + DeleteCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyRequest").msgclass + DeleteCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyVersionRequest").msgclass + ImportCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportCryptoKeyVersionRequest").msgclass + CreateImportJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateImportJobRequest").msgclass + UpdateCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateCryptoKeyRequest").msgclass + UpdateCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateCryptoKeyVersionRequest").msgclass + UpdateCryptoKeyPrimaryVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest").msgclass + DestroyCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DestroyCryptoKeyVersionRequest").msgclass + RestoreCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RestoreCryptoKeyVersionRequest").msgclass + EncryptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EncryptRequest").msgclass + DecryptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DecryptRequest").msgclass + RawEncryptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RawEncryptRequest").msgclass + RawDecryptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RawDecryptRequest").msgclass + AsymmetricSignRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AsymmetricSignRequest").msgclass + AsymmetricDecryptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AsymmetricDecryptRequest").msgclass + MacSignRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.MacSignRequest").msgclass + MacVerifyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.MacVerifyRequest").msgclass + DecapsulateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DecapsulateRequest").msgclass + GenerateRandomBytesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GenerateRandomBytesRequest").msgclass + EncryptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EncryptResponse").msgclass + DecryptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DecryptResponse").msgclass + RawEncryptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RawEncryptResponse").msgclass + RawDecryptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RawDecryptResponse").msgclass + AsymmetricSignResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AsymmetricSignResponse").msgclass + AsymmetricDecryptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AsymmetricDecryptResponse").msgclass + MacSignResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.MacSignResponse").msgclass + MacVerifyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.MacVerifyResponse").msgclass + DecapsulateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DecapsulateResponse").msgclass + GenerateRandomBytesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GenerateRandomBytesResponse").msgclass + Digest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.Digest").msgclass + LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.LocationMetadata").msgclass + DeleteCryptoKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyMetadata").msgclass + DeleteCryptoKeyVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyVersionMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb new file mode 100644 index 000000000000..c9b285a31763 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb @@ -0,0 +1,245 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/kms/v1/service.proto for package 'google.cloud.kms.v1' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/kms/v1/service_pb' + +module Google + module Cloud + module Kms + module V1 + module KeyManagementService + # Google Cloud Key Management Service + # + # Manages cryptographic keys and operations using those keys. Implements a REST + # model with the following objects: + # + # * [KeyRing][google.cloud.kms.v1.KeyRing] + # * [CryptoKey][google.cloud.kms.v1.CryptoKey] + # * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + # * [ImportJob][google.cloud.kms.v1.ImportJob] + # + # If you are using manual gRPC libraries, see + # [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.kms.v1.KeyManagementService' + + # Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + rpc :ListKeyRings, ::Google::Cloud::Kms::V1::ListKeyRingsRequest, ::Google::Cloud::Kms::V1::ListKeyRingsResponse + # Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + rpc :ListCryptoKeys, ::Google::Cloud::Kms::V1::ListCryptoKeysRequest, ::Google::Cloud::Kms::V1::ListCryptoKeysResponse + # Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + rpc :ListCryptoKeyVersions, ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse + # Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. + rpc :ListImportJobs, ::Google::Cloud::Kms::V1::ListImportJobsRequest, ::Google::Cloud::Kms::V1::ListImportJobsResponse + # Lists the [RetiredResources][google.cloud.kms.v1.RetiredResource] which are + # the records of deleted [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + # RetiredResources prevent the reuse of these resource names after deletion. + rpc :ListRetiredResources, ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse + # Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. + rpc :GetKeyRing, ::Google::Cloud::Kms::V1::GetKeyRingRequest, ::Google::Cloud::Kms::V1::KeyRing + # 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]. + rpc :GetCryptoKey, ::Google::Cloud::Kms::V1::GetCryptoKeyRequest, ::Google::Cloud::Kms::V1::CryptoKey + # Returns metadata for a given + # [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + rpc :GetCryptoKeyVersion, ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion + # 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]. + rpc :GetPublicKey, ::Google::Cloud::Kms::V1::GetPublicKeyRequest, ::Google::Cloud::Kms::V1::PublicKey + # Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. + rpc :GetImportJob, ::Google::Cloud::Kms::V1::GetImportJobRequest, ::Google::Cloud::Kms::V1::ImportJob + # Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] + # resource, which represents the record of a deleted + # [CryptoKey][google.cloud.kms.v1.CryptoKey]. + rpc :GetRetiredResource, ::Google::Cloud::Kms::V1::GetRetiredResourceRequest, ::Google::Cloud::Kms::V1::RetiredResource + # Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and + # Location. + rpc :CreateKeyRing, ::Google::Cloud::Kms::V1::CreateKeyRingRequest, ::Google::Cloud::Kms::V1::KeyRing + # 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. + rpc :CreateCryptoKey, ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest, ::Google::Cloud::Kms::V1::CryptoKey + # 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]. + rpc :CreateCryptoKeyVersion, ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion + # Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. + # All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must + # have been previously deleted using + # [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. + # The specified crypto key will be immediately and permanently deleted upon + # calling this method. This action cannot be undone. + rpc :DeleteCryptoKey, ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, ::Google::Longrunning::Operation + # Permanently deletes the given + # [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if + # the version has not been previously imported and if its + # [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of + # [DESTROYED][CryptoKeyVersionState.DESTROYED], + # [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or + # [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. + # Successfully imported + # [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted + # at this time. The specified version will be immediately and permanently + # deleted upon calling this method. This action cannot be undone. + rpc :DeleteCryptoKeyVersion, ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, ::Google::Longrunning::Operation + # 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]. + rpc :ImportCryptoKeyVersion, ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion + # 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. + rpc :CreateImportJob, ::Google::Cloud::Kms::V1::CreateImportJobRequest, ::Google::Cloud::Kms::V1::ImportJob + # Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + rpc :UpdateCryptoKey, ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest, ::Google::Cloud::Kms::V1::CryptoKey + # 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. + rpc :UpdateCryptoKeyVersion, ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion + # 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]. + rpc :UpdateCryptoKeyPrimaryVersion, ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, ::Google::Cloud::Kms::V1::CryptoKey + # 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. + rpc :DestroyCryptoKeyVersion, ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion + # 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. + rpc :RestoreCryptoKeyVersion, ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion + # 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]. + rpc :Encrypt, ::Google::Cloud::Kms::V1::EncryptRequest, ::Google::Cloud::Kms::V1::EncryptResponse + # 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]. + rpc :Decrypt, ::Google::Cloud::Kms::V1::DecryptRequest, ::Google::Cloud::Kms::V1::DecryptResponse + # 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]. + rpc :RawEncrypt, ::Google::Cloud::Kms::V1::RawEncryptRequest, ::Google::Cloud::Kms::V1::RawEncryptResponse + # 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]. + rpc :RawDecrypt, ::Google::Cloud::Kms::V1::RawDecryptRequest, ::Google::Cloud::Kms::V1::RawDecryptResponse + # 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]. + rpc :AsymmetricSign, ::Google::Cloud::Kms::V1::AsymmetricSignRequest, ::Google::Cloud::Kms::V1::AsymmetricSignResponse + # 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. + rpc :AsymmetricDecrypt, ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest, ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse + # 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. + rpc :MacSign, ::Google::Cloud::Kms::V1::MacSignRequest, ::Google::Cloud::Kms::V1::MacSignResponse + # 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. + rpc :MacVerify, ::Google::Cloud::Kms::V1::MacVerifyRequest, ::Google::Cloud::Kms::V1::MacVerifyResponse + # Decapsulates data that was encapsulated 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] + # KEY_ENCAPSULATION. + rpc :Decapsulate, ::Google::Cloud::Kms::V1::DecapsulateRequest, ::Google::Cloud::Kms::V1::DecapsulateResponse + # Generate random bytes using the Cloud KMS randomness source in the provided + # location. + rpc :GenerateRandomBytes, ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest, ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb new file mode 100644 index 000000000000..0ac65bb1082e --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-kms-v1/proto_docs/README.md new file mode 100644 index 000000000000..b4de92b74f3d --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Key Management Service (KMS) V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey.rb new file mode 100644 index 000000000000..e76e403d45dc --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + # Request message for + # {::Google::Cloud::Kms::V1::Autokey::Client#create_key_handle Autokey.CreateKeyHandle}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the resource project and location to create the + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in, e.g. + # `projects/{PROJECT_ID}/locations/{LOCATION}`. + # @!attribute [rw] key_handle_id + # @return [::String] + # Optional. Id of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}. Must be + # unique to the resource project and location. If not provided by the caller, + # a new UUID is used. + # @!attribute [rw] key_handle + # @return [::Google::Cloud::Kms::V1::KeyHandle] + # Required. {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} to create. + class CreateKeyHandleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for {::Google::Cloud::Kms::V1::Autokey::Client#get_key_handle GetKeyHandle}. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} resource, + # e.g. + # `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + class GetKeyHandleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Resource-oriented representation of a request to Cloud KMS Autokey and the + # resulting provisioning of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # @!attribute [rw] name + # @return [::String] + # Identifier. Name of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} + # resource, e.g. + # `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. + # @!attribute [r] kms_key + # @return [::String] + # Output only. Name of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that has + # been provisioned for Customer Managed Encryption Key (CMEK) use in the + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} project and location for the + # requested resource type. The {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} + # project will reflect the value configured in the + # {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} on the resource + # project's ancestor folder at the time of the + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} creation. If more than one + # ancestor folder has a configured + # {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig}, the nearest of these + # configurations is used. + # @!attribute [rw] resource_type_selector + # @return [::String] + # Required. Indicates the resource type that the resulting + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is meant to protect, e.g. + # `{SERVICE}.googleapis.com/{TYPE}`. See documentation for supported resource + # types. + class KeyHandle + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for + # {::Google::Cloud::Kms::V1::Autokey::Client#create_key_handle CreateKeyHandle} long-running + # operation response. + class CreateKeyHandleMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::Autokey::Client#list_key_handles Autokey.ListKeyHandles}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the resource project and location from which to list + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. + # `projects/{PROJECT_ID}/locations/{LOCATION}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} to include in the response. The + # service may return fewer than this value. Further + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} can subsequently be obtained by + # including the + # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token} + # in a subsequent request. If unspecified, at most 100 + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} will be returned. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter to apply when listing + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. + # `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. + class ListKeyHandlesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::Autokey::Client#list_key_handles Autokey.ListKeyHandles}. + # @!attribute [rw] key_handles + # @return [::Array<::Google::Cloud::Kms::V1::KeyHandle>] + # Resulting {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Kms::V1::ListKeyHandlesRequest#page_token ListKeyHandlesRequest.page_token} + # to retrieve the next page of results. + class ListKeyHandlesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey_admin.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey_admin.rb new file mode 100644 index 000000000000..2292e75e0df5 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey_admin.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + # Request message for + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config UpdateAutokeyConfig}. + # @!attribute [rw] autokey_config + # @return [::Google::Cloud::Kms::V1::AutokeyConfig] + # Required. {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} with values to + # update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Masks which fields of the + # {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} to update, e.g. + # `keyProject`. + class UpdateAutokeyConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#get_autokey_config GetAutokeyConfig}. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} + # resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + class GetAutokeyConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cloud KMS Autokey configuration for a folder. + # @!attribute [rw] name + # @return [::String] + # Identifier. Name of the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} + # resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. + # @!attribute [rw] key_project + # @return [::String] + # Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or + # `projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision a new + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} when a + # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} is created. On + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config UpdateAutokeyConfig}, + # the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on + # this key project. Once configured, for Cloud KMS Autokey to function + # properly, this key project must have the Cloud KMS API activated and the + # Cloud KMS Service Agent for this key project must be granted the + # `cloudkms.admin` role (or pertinent permissions). A request with an empty + # key project field will clear the configuration. + # @!attribute [r] state + # @return [::Google::Cloud::Kms::V1::AutokeyConfig::State] + # Output only. The state for the AutokeyConfig. + # @!attribute [rw] etag + # @return [::String] + # Optional. A checksum computed by the server based on the value of other + # fields. This may be sent on update requests to ensure that the client has + # an up-to-date value before proceeding. The request will be rejected with an + # ABORTED error on a mismatched etag. + class AutokeyConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The states AutokeyConfig can be in. + module State + # The state of the AutokeyConfig is unspecified. + STATE_UNSPECIFIED = 0 + + # The AutokeyConfig is currently active. + ACTIVE = 1 + + # A previously configured key project has been deleted and the current + # AutokeyConfig is unusable. + KEY_PROJECT_DELETED = 2 + + # The AutokeyConfig is not yet initialized or has been reset to its default + # uninitialized state. + UNINITIALIZED = 3 + end + end + + # Request message for + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the resource project to the show effective Cloud KMS + # Autokey configuration for. This may be helpful for interrogating the effect + # of nested folder configurations on a given resource project. + class ShowEffectiveAutokeyConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. + # @!attribute [rw] key_project + # @return [::String] + # Name of the key project configured in the resource project's folder + # ancestry. + class ShowEffectiveAutokeyConfigResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/ekm_service.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/ekm_service.rb new file mode 100644 index 000000000000..1c149af0f118 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/ekm_service.rb @@ -0,0 +1,351 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + # Request message for + # {::Google::Cloud::Kms::V1::EkmService::Client#list_ekm_connections EkmService.ListEkmConnections}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to list, in the format + # `projects/*/locations/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to include in the + # response. Further {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} can + # subsequently be obtained by including the + # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # 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). + # @!attribute [rw] order_by + # @return [::String] + # 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). + class ListEkmConnectionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::EkmService::Client#list_ekm_connections EkmService.ListEkmConnections}. + # @!attribute [rw] ekm_connections + # @return [::Array<::Google::Cloud::Kms::V1::EkmConnection>] + # The list of {::Google::Cloud::Kms::V1::EkmConnection EkmConnections}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Kms::V1::ListEkmConnectionsRequest#page_token ListEkmConnectionsRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} + # that matched the query. + # + # This field is not populated if + # {::Google::Cloud::Kms::V1::ListEkmConnectionsRequest#filter ListEkmConnectionsRequest.filter} + # is applied. + class ListEkmConnectionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::EkmService::Client#get_ekm_connection EkmService.GetEkmConnection}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to get. + class GetEkmConnectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::EkmService::Client#create_ekm_connection EkmService.CreateEkmConnection}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}, in the format + # `projects/*/locations/*`. + # @!attribute [rw] ekm_connection_id + # @return [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. + # @!attribute [rw] ekm_connection + # @return [::Google::Cloud::Kms::V1::EkmConnection] + # Required. An {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with + # initial field values. + class CreateEkmConnectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::EkmService::Client#update_ekm_connection EkmService.UpdateEkmConnection}. + # @!attribute [rw] ekm_connection + # @return [::Google::Cloud::Kms::V1::EkmConnection] + # Required. {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with updated + # values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated in this request. + class UpdateEkmConnectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::EkmService::Client#get_ekm_config EkmService.GetEkmConfig}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::EkmConfig#name name} of the + # {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} to get. + class GetEkmConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::EkmService::Client#update_ekm_config EkmService.UpdateEkmConfig}. + # @!attribute [rw] ekm_config + # @return [::Google::Cloud::Kms::V1::EkmConfig] + # Required. {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} with updated values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated in this request. + class UpdateEkmConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A {::Google::Cloud::Kms::V1::Certificate Certificate} represents an X.509 + # certificate used to authenticate HTTPS connections to EKM replicas. + # @!attribute [rw] raw_der + # @return [::String] + # Required. The raw certificate bytes in DER format. + # @!attribute [r] parsed + # @return [::Boolean] + # Output only. True if the certificate was parsed successfully. + # @!attribute [r] issuer + # @return [::String] + # Output only. The issuer distinguished name in RFC 2253 format. Only present + # if {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. + # @!attribute [r] subject + # @return [::String] + # Output only. The subject distinguished name in RFC 2253 format. Only + # present if {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. + # @!attribute [r] subject_alternative_dns_names + # @return [::Array<::String>] + # Output only. The subject Alternative DNS names. Only present if + # {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. + # @!attribute [r] not_before_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The certificate is not valid before this time. Only present if + # {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. + # @!attribute [r] not_after_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The certificate is not valid after this time. Only present if + # {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. + # @!attribute [r] serial_number + # @return [::String] + # Output only. The certificate serial number as a hex string. Only present if + # {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. + # @!attribute [r] sha256_fingerprint + # @return [::String] + # Output only. The SHA-256 certificate fingerprint as a hex string. Only + # present if {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. + class Certificate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} represents an + # individual EKM connection. It can be used for creating + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} and + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} with a + # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC}, as well as + # performing cryptographic operations using keys created within the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name for the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} in the format + # `projects/*/locations/*/ekmConnections/*`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} was created. + # @!attribute [rw] service_resolvers + # @return [::Array<::Google::Cloud::Kms::V1::EkmConnection::ServiceResolver>] + # Optional. A list of + # {::Google::Cloud::Kms::V1::EkmConnection::ServiceResolver ServiceResolvers} where + # the EKM can be reached. There should be one ServiceResolver per EKM + # replica. Currently, only a single + # {::Google::Cloud::Kms::V1::EkmConnection::ServiceResolver ServiceResolver} is + # supported. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the currently stored + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. + # @!attribute [rw] key_management_mode + # @return [::Google::Cloud::Kms::V1::EkmConnection::KeyManagementMode] + # Optional. Describes who can perform control plane operations on the EKM. If + # unset, this defaults to + # {::Google::Cloud::Kms::V1::EkmConnection::KeyManagementMode::MANUAL MANUAL}. + # @!attribute [rw] crypto_space_path + # @return [::String] + # Optional. Identifies the EKM Crypto Space that this + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} maps to. Note: This + # field is required if + # {::Google::Cloud::Kms::V1::EkmConnection::KeyManagementMode KeyManagementMode} is + # {::Google::Cloud::Kms::V1::EkmConnection::KeyManagementMode::CLOUD_KMS CLOUD_KMS}. + class EkmConnection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A {::Google::Cloud::Kms::V1::EkmConnection::ServiceResolver ServiceResolver} + # represents an EKM replica that can be reached within an + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. + # @!attribute [rw] service_directory_service + # @return [::String] + # Required. The resource name of the Service Directory service pointing to + # an EKM replica, in the format + # `projects/*/locations/*/namespaces/*/services/*`. + # @!attribute [rw] endpoint_filter + # @return [::String] + # 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. + # @!attribute [rw] hostname + # @return [::String] + # Required. The hostname of the EKM replica used at TLS and HTTP layers. + # @!attribute [rw] server_certificates + # @return [::Array<::Google::Cloud::Kms::V1::Certificate>] + # Required. A list of leaf server certificates used to authenticate HTTPS + # connections to the EKM replica. Currently, a maximum of 10 + # {::Google::Cloud::Kms::V1::Certificate Certificate} is supported. + class ServiceResolver + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Kms::V1::EkmConnection::KeyManagementMode KeyManagementMode} + # describes who can perform control plane cryptographic operations using this + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. + module KeyManagementMode + # Not specified. + KEY_MANAGEMENT_MODE_UNSPECIFIED = 0 + + # EKM-side key management operations on + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} created with this + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} must be initiated from + # the EKM directly and cannot be performed from Cloud KMS. This means that: + # * When creating a + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} associated with + # this + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}, the caller must + # supply the key path of pre-existing external key material that will be + # linked to the {::Google::Cloud::Kms::V1::CryptoKeyVersion 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. + MANUAL = 1 + + # All {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} created with this + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} use EKM-side key + # management operations initiated from Cloud KMS. This means that: + # + # * When a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # associated with this {::Google::Cloud::Kms::V1::EkmConnection 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 + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} can be requested by + # calling + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version DestroyCryptoKeyVersion}. + # * Automatic rotation of key material is supported. + CLOUD_KMS = 2 + end + end + + # An {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} is a singleton resource that + # represents configuration parameters that apply to all + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} and + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} with a + # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} in a given + # project and location. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name for the + # {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} in the format + # `projects/*/locations/*/ekmConfig`. + # @!attribute [rw] default_ekm_connection + # @return [::String] + # Optional. Resource name of the default + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. Setting this field to + # the empty string removes the default. + class EkmConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::EkmService::Client#verify_connectivity EkmService.VerifyConnectivity}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to verify. + class VerifyConnectivityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::EkmService::Client#verify_connectivity EkmService.VerifyConnectivity}. + class VerifyConnectivityResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/hsm_management.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/hsm_management.rb new file mode 100644 index 000000000000..7498382268f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/hsm_management.rb @@ -0,0 +1,877 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + # A {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # represents a single-tenant HSM instance. It can be used for creating + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with a + # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of + # [HSM_SINGLE_TENANT][CryptoKeyVersion.ProtectionLevel.HSM_SINGLE_TENANT], as + # well as performing cryptographic operations using keys created within the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name for this + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} in + # the format `projects/*/locations/*/singleTenantHsmInstances/*`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} was + # created. + # @!attribute [r] state + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State] + # Output only. The state of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # @!attribute [rw] quorum_auth + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth] + # Required. The quorum auth configuration for the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} was + # deleted. + # @!attribute [r] unrefreshed_duration_until_disable + # @return [::Google::Protobuf::Duration] + # Output only. The system-defined duration that an instance can remain + # unrefreshed until it is automatically disabled. This will have a value of + # 120 days. + # @!attribute [r] disable_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the instance will be automatically disabled + # if not refreshed. This field is updated upon creation and after each + # successful refresh operation and enable. A + # [RefreshSingleTenantHsmInstance][] operation must be made via a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # before this time otherwise the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} will + # become disabled. + class SingleTenantHsmInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for M of N quorum auth. + # @!attribute [rw] total_approver_count + # @return [::Integer] + # Required. The total number of approvers. This is the N value used + # for M of N quorum auth. Must be greater than or equal to 3 and less than + # or equal to 16. + # @!attribute [r] required_approver_count + # @return [::Integer] + # Output only. The required numbers of approvers. The M value used for M of + # N quorum auth. Must be greater than or equal to 2 and less than or equal + # to + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} + # - 1. + # @!attribute [r] two_factor_public_key_pems + # @return [::Array<::String>] + # Output only. The public keys associated with the 2FA keys for M of N + # quorum auth. + class QuorumAuth + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The set of states of a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is + # being created. + CREATING = 1 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is + # waiting for 2FA keys to be registered. This can be done by calling + # {::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal CreateSingleTenantHsmInstanceProposal} + # with the [RegisterTwoFactorAuthKeys][] operation. + PENDING_TWO_FACTOR_AUTH_REGISTRATION = 2 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is + # ready to use. A + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state + # for all {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} created within the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} to + # be usable. + ACTIVE = 3 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is + # being disabled. + DISABLING = 4 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is + # disabled. + DISABLED = 5 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is + # being deleted. Requests to the instance will be rejected in this state. + DELETING = 6 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # has been deleted. + DELETED = 7 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # has failed and can not be recovered or used. + FAILED = 8 + end + end + + # A + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # represents a proposal to perform an operation on a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name for this + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} in + # the format `projects/*/locations/*/singleTenantHsmInstances/*/proposals/*`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # was created. + # @!attribute [r] state + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::State] + # Output only. The state of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. + # @!attribute [r] failure_reason + # @return [::String] + # Output only. The root cause of the most recent failure. Only present if + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#state state} is + # [FAILED][SingleTenantHsmInstanceProposal.FAILED]. + # @!attribute [r] quorum_parameters + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters] + # Output only. The quorum approval parameters for the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. + # + # Note: The following fields are mutually exclusive: `quorum_parameters`, `required_action_quorum_parameters`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] required_action_quorum_parameters + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters] + # Output only. Parameters for an approval of a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # that has both required challenges and a quorum. + # + # Note: The following fields are mutually exclusive: `required_action_quorum_parameters`, `quorum_parameters`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # will expire if not approved and executed. + # + # Note: The following fields are mutually exclusive: `expire_time`, `ttl`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Input only. The TTL for the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. + # Proposals will expire after this duration. + # + # Note: The following fields are mutually exclusive: `ttl`, `expire_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # was deleted. + # @!attribute [r] purge_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the soft-deleted + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # will be permanently purged. This field is only populated + # when the state is DELETED and will be set a time after expiration of the + # proposal, i.e. >= expire_time or (create_time + ttl). + # @!attribute [rw] register_two_factor_auth_keys + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RegisterTwoFactorAuthKeys] + # Register 2FA keys for the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # This operation requires all N Challenges to be signed by 2FA keys. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::PENDING_TWO_FACTOR_AUTH_REGISTRATION PENDING_TWO_FACTOR_AUTH_REGISTRATION} + # state to perform this operation. + # + # Note: The following fields are mutually exclusive: `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `enable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `add_quorum_member`, `remove_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] disable_single_tenant_hsm_instance + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::DisableSingleTenantHsmInstance] + # Disable the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state + # to perform this operation. + # + # Note: The following fields are mutually exclusive: `disable_single_tenant_hsm_instance`, `register_two_factor_auth_keys`, `enable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `add_quorum_member`, `remove_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] enable_single_tenant_hsm_instance + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::EnableSingleTenantHsmInstance] + # Enable the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::DISABLED DISABLED} + # state to perform this operation. + # + # Note: The following fields are mutually exclusive: `enable_single_tenant_hsm_instance`, `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `add_quorum_member`, `remove_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete_single_tenant_hsm_instance + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::DeleteSingleTenantHsmInstance] + # Delete the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # Deleting a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # will make all {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} attached to the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # unusable. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::DISABLED DISABLED} or + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::PENDING_TWO_FACTOR_AUTH_REGISTRATION PENDING_TWO_FACTOR_AUTH_REGISTRATION} + # state to perform this operation. + # + # Note: The following fields are mutually exclusive: `delete_single_tenant_hsm_instance`, `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `enable_single_tenant_hsm_instance`, `add_quorum_member`, `remove_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] add_quorum_member + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::AddQuorumMember] + # Add a quorum member to the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # This will increase the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} + # by 1. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state + # to perform this operation. + # + # Note: The following fields are mutually exclusive: `add_quorum_member`, `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `enable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `remove_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] remove_quorum_member + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RemoveQuorumMember] + # Remove a quorum member from the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # This will reduce + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} + # by 1. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state + # to perform this operation. + # + # Note: The following fields are mutually exclusive: `remove_quorum_member`, `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `enable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `add_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] refresh_single_tenant_hsm_instance + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RefreshSingleTenantHsmInstance] + # Refreshes the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # This operation must be performed periodically to keep the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # active. This operation must be performed before + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#unrefreshed_duration_until_disable unrefreshed_duration_until_disable} + # has passed. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # must be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state + # to perform this operation. + # + # Note: The following fields are mutually exclusive: `refresh_single_tenant_hsm_instance`, `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `enable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `add_quorum_member`, `remove_quorum_member`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class SingleTenantHsmInstanceProposal + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Parameters of quorum approval for the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. + # @!attribute [r] required_approver_count + # @return [::Integer] + # Output only. The required numbers of approvers. This is the M value used + # for M of N quorum auth. It is less than the number of public keys. + # @!attribute [r] challenges + # @return [::Array<::Google::Cloud::Kms::V1::Challenge>] + # Output only. The challenges to be signed by 2FA keys for quorum auth. M + # of N of these challenges are required to be signed to approve the + # operation. + # @!attribute [r] approved_two_factor_public_key_pems + # @return [::Array<::String>] + # Output only. The public keys associated with the 2FA keys that have + # already approved the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # by signing the challenge. + class QuorumParameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Parameters for an approval that has both required challenges and a + # quorum. + # @!attribute [r] required_challenges + # @return [::Array<::Google::Cloud::Kms::V1::Challenge>] + # Output only. A list of specific challenges that must be signed. + # For some operations, this will contain a single challenge. + # @!attribute [r] required_approver_count + # @return [::Integer] + # Output only. The required number of quorum approvers. This is the M value + # used for M of N quorum auth. It is less than the number of public keys. + # @!attribute [r] quorum_challenges + # @return [::Array<::Google::Cloud::Kms::V1::Challenge>] + # Output only. The challenges to be signed by 2FA keys for quorum auth. M + # of N of these challenges are required to be signed to approve the + # operation. + # @!attribute [r] approved_two_factor_public_key_pems + # @return [::Array<::String>] + # Output only. The public keys associated with the 2FA keys that have + # already approved the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # by signing the challenge. + class RequiredActionQuorumParameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Register 2FA keys for the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # This operation requires all Challenges to be signed by 2FA keys. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must + # be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::PENDING_TWO_FACTOR_AUTH_REGISTRATION PENDING_TWO_FACTOR_AUTH_REGISTRATION} + # state to perform this operation. + # @!attribute [rw] required_approver_count + # @return [::Integer] + # Required. The required numbers of approvers to set for the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # This is the M value used for M of N quorum auth. Must be greater than or + # equal to 2 and less than or equal to + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} + # - 1. + # @!attribute [rw] two_factor_public_key_pems + # @return [::Array<::String>] + # Required. The public keys associated with the 2FA keys for M of N quorum + # auth. Public keys must be associated with RSA 2048 keys. + class RegisterTwoFactorAuthKeys + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Disable the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must + # be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state to + # perform this operation. + class DisableSingleTenantHsmInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Enable the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must + # be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::DISABLED DISABLED} + # state to perform this operation. + class EnableSingleTenantHsmInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Delete the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # Deleting a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} will + # make all {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} attached to the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # unusable. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must + # not be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::DELETING DELETING} or + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::DELETED DELETED} state + # to perform this operation. + class DeleteSingleTenantHsmInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Add a quorum member to the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # This will increase the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} + # by 1. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must + # be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state to + # perform this operation. + # @!attribute [rw] two_factor_public_key_pem + # @return [::String] + # Required. The public key associated with the 2FA key for the new quorum + # member to add. Public keys must be associated with RSA 2048 keys. + class AddQuorumMember + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Remove a quorum member from the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # This will reduce + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} + # by 1. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must + # be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state to + # perform this operation. + # @!attribute [rw] two_factor_public_key_pem + # @return [::String] + # Required. The public key associated with the 2FA key for the quorum + # member to remove. Public keys must be associated with RSA 2048 keys. + class RemoveQuorumMember + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Refreshes the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. + # This operation must be performed periodically to keep the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # active. This operation must be performed before + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#unrefreshed_duration_until_disable unrefreshed_duration_until_disable} + # has passed. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must + # be in the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state to + # perform this operation. + class RefreshSingleTenantHsmInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The set of states of a + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # is being created. + CREATING = 1 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # is pending approval. + PENDING = 2 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # has been approved. + APPROVED = 3 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # is being executed. + RUNNING = 4 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # has been executed successfully. + SUCCEEDED = 5 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # has failed. + FAILED = 6 + + # The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # has been deleted and will be purged after the purge_time. + DELETED = 7 + end + end + + # A challenge to be signed by a 2FA key. + # @!attribute [r] challenge + # @return [::String] + # Output only. The challenge to be signed by the 2FA key indicated by the + # public key. + # @!attribute [r] public_key_pem + # @return [::String] + # Output only. The public key associated with the 2FA key that should sign + # the challenge. + class Challenge + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A reply to a challenge signed by a 2FA key. + # @!attribute [rw] signed_challenge + # @return [::String] + # Required. The signed challenge associated with the 2FA key. + # The signature must be RSASSA-PKCS1 v1.5 with a SHA256 digest. + # @!attribute [rw] public_key_pem + # @return [::String] + # Required. The public key associated with the 2FA key. + class ChallengeReply + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances HsmManagement.ListSingleTenantHsmInstances}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to + # list, in the format `projects/*/locations/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to + # include in the response. Further + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} can + # subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # 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). + # @!attribute [rw] order_by + # @return [::String] + # 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). + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Optional. If set to true, + # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances HsmManagement.ListSingleTenantHsmInstances} + # will also return + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} in + # DELETED state. + class ListSingleTenantHsmInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances HsmManagement.ListSingleTenantHsmInstances}. + # @!attribute [rw] single_tenant_hsm_instances + # @return [::Array<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>] + # The list of + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest#page_token ListSingleTenantHsmInstancesRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} + # that matched the query. + # + # This field is not populated if + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest#filter ListSingleTenantHsmInstancesRequest.filter} + # is applied. + class ListSingleTenantHsmInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance HsmManagement.GetSingleTenantHsmInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of + # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # to get. + class GetSingleTenantHsmInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance HsmManagement.CreateSingleTenantHsmInstance}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}, in + # the format `projects/*/locations/*`. + # @!attribute [rw] single_tenant_hsm_instance_id + # @return [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. + # @!attribute [rw] single_tenant_hsm_instance + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] + # Required. An + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} with + # initial field values. + class CreateSingleTenantHsmInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance CreateSingleTenantHsmInstance} + # long-running operation response. + class CreateSingleTenantHsmInstanceMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal HsmManagement.CreateSingleTenantHsmInstanceProposal}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of + # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} + # associated with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. + # @!attribute [rw] single_tenant_hsm_instance_proposal_id + # @return [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. + # @!attribute [rw] single_tenant_hsm_instance_proposal + # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to create. + class CreateSingleTenantHsmInstanceProposalRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal CreateSingleTenantHsmInstanceProposal} + # long-running operation response. + class CreateSingleTenantHsmInstanceProposalMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance_proposal HsmManagement.GetSingleTenantHsmInstanceProposal}. + # @!attribute [rw] name + # @return [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to get. + class GetSingleTenantHsmInstanceProposalRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#approve_single_tenant_hsm_instance_proposal HsmManagement.ApproveSingleTenantHsmInstanceProposal}. + # @!attribute [rw] name + # @return [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to approve. + # @!attribute [rw] quorum_reply + # @return [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::QuorumReply] + # Required. The reply to + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters QuorumParameters} + # for approving the proposal. + # + # Note: The following fields are mutually exclusive: `quorum_reply`, `required_action_quorum_reply`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] required_action_quorum_reply + # @return [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::RequiredActionQuorumReply] + # Required. The reply to + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters RequiredActionQuorumParameters} + # for approving the proposal. + # + # Note: The following fields are mutually exclusive: `required_action_quorum_reply`, `quorum_reply`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ApproveSingleTenantHsmInstanceProposalRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The reply to + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters QuorumParameters} + # for approving the proposal. + # @!attribute [rw] challenge_replies + # @return [::Array<::Google::Cloud::Kms::V1::ChallengeReply>] + # Required. The challenge replies to approve the proposal. Challenge + # replies can be sent across multiple requests. The proposal will be + # approved when + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters#required_approver_count required_approver_count} + # challenge replies are provided. + class QuorumReply + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The reply to + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters RequiredActionQuorumParameters} + # for approving the proposal. + # @!attribute [rw] required_challenge_replies + # @return [::Array<::Google::Cloud::Kms::V1::ChallengeReply>] + # Required. All required challenges must be signed for the proposal to be + # approved. These can be sent across multiple requests. + # @!attribute [rw] quorum_challenge_replies + # @return [::Array<::Google::Cloud::Kms::V1::ChallengeReply>] + # Required. Quorum members' signed challenge replies. These can be provided + # across multiple requests. The proposal will be approved when + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters#required_approver_count required_approver_count} + # quorum_challenge_replies are provided and when all + # required_challenge_replies are provided. + class RequiredActionQuorumReply + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#approve_single_tenant_hsm_instance_proposal HsmManagement.ApproveSingleTenantHsmInstanceProposal}. + class ApproveSingleTenantHsmInstanceProposalResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal HsmManagement.ExecuteSingleTenantHsmInstanceProposal}. + # @!attribute [rw] name + # @return [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to execute. + class ExecuteSingleTenantHsmInstanceProposalRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal HsmManagement.ExecuteSingleTenantHsmInstanceProposal}. + class ExecuteSingleTenantHsmInstanceProposalResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal ExecuteSingleTenantHsmInstanceProposal} + # long-running operation response. + class ExecuteSingleTenantHsmInstanceProposalMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals HsmManagement.ListSingleTenantHsmInstanceProposals}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the single tenant HSM instance associated + # with the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # to list, in the format `projects/*/locations/*/singleTenantHsmInstances/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # to include in the response. Further + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # can subsequently be obtained by including the + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # 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). + # @!attribute [rw] order_by + # @return [::String] + # 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). + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Optional. If set to true, + # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals HsmManagement.ListSingleTenantHsmInstanceProposals} + # will also return + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # in DELETED state. + class ListSingleTenantHsmInstanceProposalsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals HsmManagement.ListSingleTenantHsmInstanceProposals}. + # @!attribute [rw] single_tenant_hsm_instance_proposals + # @return [::Array<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>] + # The list of + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest#page_token ListSingleTenantHsmInstanceProposalsRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} + # that matched the query. + # + # This field is not populated if + # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest#filter ListSingleTenantHsmInstanceProposalsRequest.filter} + # is applied. + class ListSingleTenantHsmInstanceProposalsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::HsmManagement::Client#delete_single_tenant_hsm_instance_proposal HsmManagement.DeleteSingleTenantHsmInstanceProposal}. + # @!attribute [rw] name + # @return [::String] + # Required. The + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the + # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} + # to delete. + class DeleteSingleTenantHsmInstanceProposalRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb new file mode 100644 index 000000000000..1159f4b97906 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb @@ -0,0 +1,1148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + # A {::Google::Cloud::Kms::V1::KeyRing KeyRing} is a toplevel logical grouping of + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name for the + # {::Google::Cloud::Kms::V1::KeyRing KeyRing} in the format + # `projects/*/locations/*/keyRings/*`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this {::Google::Cloud::Kms::V1::KeyRing KeyRing} + # was created. + class KeyRing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} represents a logical key that + # can be used for cryptographic operations. + # + # A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is made up of zero or more + # {::Google::Cloud::Kms::V1::CryptoKeyVersion versions}, which represent the actual + # key material used in cryptographic operations. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name for this + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the format + # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + # @!attribute [r] primary + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # Output only. A copy of the "primary" + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} that will be used + # by {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt} when this + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is given in + # {::Google::Cloud::Kms::V1::EncryptRequest#name EncryptRequest.name}. + # + # The {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}'s primary version can be + # updated via + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version UpdateCryptoKeyPrimaryVersion}. + # + # Keys with {::Google::Cloud::Kms::V1::CryptoKey#purpose purpose} + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT} + # may have a primary. For other keys, this field will be omitted. + # @!attribute [rw] purpose + # @return [::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose] + # Immutable. The immutable purpose of this + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} was created. + # @!attribute [rw] next_rotation_time + # @return [::Google::Protobuf::Timestamp] + # At {::Google::Cloud::Kms::V1::CryptoKey#next_rotation_time next_rotation_time}, + # the Key Management Service will automatically: + # + # 1. Create a new version of this {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # 2. Mark the new version as primary. + # + # Key rotations performed manually via + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} + # and + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version UpdateCryptoKeyPrimaryVersion} + # do not affect + # {::Google::Cloud::Kms::V1::CryptoKey#next_rotation_time next_rotation_time}. + # + # Keys with {::Google::Cloud::Kms::V1::CryptoKey#purpose purpose} + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT} + # support automatic rotation. For other keys, this field must be omitted. + # @!attribute [rw] rotation_period + # @return [::Google::Protobuf::Duration] + # {::Google::Cloud::Kms::V1::CryptoKey#next_rotation_time 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 {::Google::Cloud::Kms::V1::CryptoKey#rotation_period rotation_period} is + # set, + # {::Google::Cloud::Kms::V1::CryptoKey#next_rotation_time next_rotation_time} + # must also be set. + # + # Keys with {::Google::Cloud::Kms::V1::CryptoKey#purpose purpose} + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT} + # support automatic rotation. For other keys, this field must be omitted. + # @!attribute [rw] version_template + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate] + # A template describing settings for new + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} instances. The + # properties of new {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # instances created by either + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} + # or auto-rotation are controlled by this template. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels with user-defined metadata. For more information, see + # [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys). + # @!attribute [rw] import_only + # @return [::Boolean] + # Immutable. Whether this key may contain imported versions only. + # @!attribute [rw] destroy_scheduled_duration + # @return [::Google::Protobuf::Duration] + # Immutable. The period of time that versions of this key spend in the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED} + # state before transitioning to + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}. + # If not specified at creation time, the default duration is 30 days. + # @!attribute [rw] crypto_key_backend + # @return [::String] + # Immutable. The resource name of the backend environment where the key + # material for all {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} + # associated with this {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} reside and + # where all related cryptographic operations are performed. Only applicable + # if {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} have a + # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC}, with the + # resource name in the format `projects/*/locations/*/ekmConnections/*`. Only + # applicable if {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} + # have a {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM_SINGLE_TENANT HSM_SINGLE_TENANT}, + # with the resource name in the format + # `projects/*/locations/*/singleTenantHsmInstances/*`. + # Note, this list is non-exhaustive and may apply to additional + # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevels} in the future. + # @!attribute [rw] key_access_justifications_policy + # @return [::Google::Cloud::Kms::V1::KeyAccessJustificationsPolicy] + # Optional. The policy used for Key Access Justifications Policy Enforcement. + # If this field is present and this key is enrolled in Key Access + # Justifications Policy Enforcement, the policy will be evaluated in encrypt, + # decrypt, and sign operations, and the operation will fail if rejected by + # the policy. The policy is defined by specifying zero or more allowed + # justification codes. + # https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes + # By default, this field is absent, and all justification codes are allowed. + class CryptoKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose CryptoKeyPurpose} + # describes the cryptographic capabilities of a + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. A given key can only be used + # for the operations allowed by its purpose. For more information, see [Key + # purposes](https://cloud.google.com/kms/docs/algorithms#key_purposes). + module CryptoKeyPurpose + # Not specified. + CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0 + + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used + # with {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt} and + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt Decrypt}. + ENCRYPT_DECRYPT = 1 + + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used + # with + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign AsymmetricSign} + # and + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey}. + ASYMMETRIC_SIGN = 5 + + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used + # with + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt AsymmetricDecrypt} + # and + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey}. + ASYMMETRIC_DECRYPT = 6 + + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used + # with {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt RawEncrypt} + # and {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt RawDecrypt}. + # This purpose is meant to be used for interoperable symmetric + # encryption and does not support automatic CryptoKey rotation. + RAW_ENCRYPT_DECRYPT = 7 + + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used + # with {::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign MacSign}. + MAC = 9 + + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used + # with + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey} + # and {::Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate Decapsulate}. + KEY_ENCAPSULATION = 10 + end + end + + # A {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate CryptoKeyVersionTemplate} + # specifies the properties to use when creating a new + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, either manually + # with + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} + # or automatically as a result of auto-rotation. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} to use when creating + # a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} based on this + # template. Immutable. Defaults to + # {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}. + # @!attribute [rw] algorithm + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] + # Required. + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm Algorithm} + # to use when creating a + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} based on this + # template. + # + # For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both + # this field is omitted and + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} is + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. + class CryptoKeyVersionTemplate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains an HSM-generated attestation about a key operation. For more + # information, see [Verifying attestations] + # (https://cloud.google.com/kms/docs/attest-key). + # @!attribute [r] format + # @return [::Google::Cloud::Kms::V1::KeyOperationAttestation::AttestationFormat] + # Output only. The format of the attestation data. + # @!attribute [r] content + # @return [::String] + # Output only. The attestation data provided by the HSM when the key + # operation was performed. + # @!attribute [r] cert_chains + # @return [::Google::Cloud::Kms::V1::KeyOperationAttestation::CertificateChains] + # Output only. The certificate chains needed to validate the attestation + class KeyOperationAttestation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Certificate chains needed to verify the attestation. + # Certificates in chains are PEM-encoded and are ordered based on + # https://tools.ietf.org/html/rfc5246#section-7.4.2. + # @!attribute [rw] cavium_certs + # @return [::Array<::String>] + # Cavium certificate chain corresponding to the attestation. + # @!attribute [rw] google_card_certs + # @return [::Array<::String>] + # Google card certificate chain corresponding to the attestation. + # @!attribute [rw] google_partition_certs + # @return [::Array<::String>] + # Google partition certificate chain corresponding to the attestation. + class CertificateChains + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Attestation formats provided by the HSM. + module AttestationFormat + # Not specified. + 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. + CAVIUM_V1_COMPRESSED = 3 + + # Cavium HSM attestation V2 compressed with gzip. This is a new format + # introduced in Cavium's version 3.2-08. + CAVIUM_V2_COMPRESSED = 4 + end + end + + # A {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} represents an + # individual cryptographic key, and the associated key material. + # + # An + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} + # version can be used for cryptographic operations. + # + # For security reasons, the raw cryptographic key material represented by a + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} can never be viewed + # or exported. It can only be used to encrypt, decrypt, or sign data when an + # authorized user or application invokes Cloud KMS. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name for this + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in the format + # `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + # @!attribute [rw] state + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState] + # The current state of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. + # @!attribute [r] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # Output only. The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} + # describing how crypto operations are performed with this + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. + # @!attribute [r] algorithm + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] + # Output only. The + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm CryptoKeyVersionAlgorithm} + # that this {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} + # supports. + # @!attribute [r] attestation + # @return [::Google::Cloud::Kms::V1::KeyOperationAttestation] + # 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 + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#protection_level protection_level} + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} was created. + # @!attribute [r] generate_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s key material was + # generated. + # @!attribute [r] destroy_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s key material is + # scheduled for destruction. Only present if + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED}. + # @!attribute [r] destroy_event_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this CryptoKeyVersion's key material was + # destroyed. Only present if + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}. + # @!attribute [r] import_job + # @return [::String] + # Output only. The name of the {::Google::Cloud::Kms::V1::ImportJob ImportJob} + # used in the most recent import of this + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Only present if + # the underlying key material was imported. + # @!attribute [r] import_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s key material was + # most recently imported. + # @!attribute [r] import_failure_reason + # @return [::String] + # Output only. The root cause of the most recent import failure. Only present + # if {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::IMPORT_FAILED IMPORT_FAILED}. + # @!attribute [r] generation_failure_reason + # @return [::String] + # Output only. The root cause of the most recent generation failure. Only + # present if {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::GENERATION_FAILED GENERATION_FAILED}. + # @!attribute [r] external_destruction_failure_reason + # @return [::String] + # Output only. The root cause of the most recent external destruction + # failure. Only present if + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::EXTERNAL_DESTRUCTION_FAILED EXTERNAL_DESTRUCTION_FAILED}. + # @!attribute [rw] external_protection_level_options + # @return [::Google::Cloud::Kms::V1::ExternalProtectionLevelOptions] + # ExternalProtectionLevelOptions stores a group of additional fields for + # configuring a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} that + # are specific to the + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL} protection level + # and {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} + # protection levels. + # @!attribute [r] reimport_eligible + # @return [::Boolean] + # Output only. Whether or not this key version is eligible for reimport, by + # being specified as a target in + # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#crypto_key_version ImportCryptoKeyVersionRequest.crypto_key_version}. + class CryptoKeyVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The algorithm of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, indicating what + # parameters must be used for each cryptographic operation. + # + # The + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm::GOOGLE_SYMMETRIC_ENCRYPTION GOOGLE_SYMMETRIC_ENCRYPTION} + # algorithm is usable with + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. + # + # Algorithms beginning with `RSA_SIGN_` are usable with + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_SIGN ASYMMETRIC_SIGN}. + # + # The fields in the name after `RSA_SIGN_` correspond to the following + # parameters: padding algorithm, modulus bit length, and digest algorithm. + # + # For PSS, the salt length used is equal to the length of digest + # algorithm. For example, + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm::RSA_SIGN_PSS_2048_SHA256 RSA_SIGN_PSS_2048_SHA256} + # will use PSS with a salt length of 256 bits or 32 bytes. + # + # Algorithms beginning with `RSA_DECRYPT_` are usable with + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_DECRYPT ASYMMETRIC_DECRYPT}. + # + # The fields in the name after `RSA_DECRYPT_` correspond to the following + # parameters: padding algorithm, modulus bit length, and digest algorithm. + # + # Algorithms beginning with `EC_SIGN_` are usable with + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_SIGN ASYMMETRIC_SIGN}. + # + # The fields in the name after `EC_SIGN_` correspond to the following + # parameters: elliptic curve, digest algorithm. + # + # Algorithms beginning with `HMAC_` are usable with + # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} + # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::MAC MAC}. + # + # The suffix following `HMAC_` corresponds to the hash algorithm being used + # (eg. SHA256). + # + # Algorithms beginning with `PQ_` are post-quantum. + # + # For more information, see [Key purposes and algorithms] + # (https://cloud.google.com/kms/docs/algorithms). + module CryptoKeyVersionAlgorithm + # Not specified. + CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0 + + # Creates symmetric encryption keys. + GOOGLE_SYMMETRIC_ENCRYPTION = 1 + + # AES-GCM (Galois Counter Mode) using 128-bit keys. + AES_128_GCM = 41 + + # AES-GCM (Galois Counter Mode) using 256-bit keys. + AES_256_GCM = 19 + + # AES-CBC (Cipher Block Chaining Mode) using 128-bit keys. + AES_128_CBC = 42 + + # AES-CBC (Cipher Block Chaining Mode) using 256-bit keys. + AES_256_CBC = 43 + + # AES-CTR (Counter Mode) using 128-bit keys. + AES_128_CTR = 44 + + # AES-CTR (Counter Mode) using 256-bit keys. + AES_256_CTR = 45 + + # RSASSA-PSS 2048 bit key with a SHA256 digest. + RSA_SIGN_PSS_2048_SHA256 = 2 + + # RSASSA-PSS 3072 bit key with a SHA256 digest. + RSA_SIGN_PSS_3072_SHA256 = 3 + + # RSASSA-PSS 4096 bit key with a SHA256 digest. + RSA_SIGN_PSS_4096_SHA256 = 4 + + # RSASSA-PSS 4096 bit key with a SHA512 digest. + RSA_SIGN_PSS_4096_SHA512 = 15 + + # RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest. + RSA_SIGN_PKCS1_2048_SHA256 = 5 + + # RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest. + RSA_SIGN_PKCS1_3072_SHA256 = 6 + + # RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest. + RSA_SIGN_PKCS1_4096_SHA256 = 7 + + # RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest. + RSA_SIGN_PKCS1_4096_SHA512 = 16 + + # RSASSA-PKCS1-v1_5 signing without encoding, with a 2048 bit key. + RSA_SIGN_RAW_PKCS1_2048 = 28 + + # RSASSA-PKCS1-v1_5 signing without encoding, with a 3072 bit key. + RSA_SIGN_RAW_PKCS1_3072 = 29 + + # RSASSA-PKCS1-v1_5 signing without encoding, with a 4096 bit key. + RSA_SIGN_RAW_PKCS1_4096 = 30 + + # RSAES-OAEP 2048 bit key with a SHA256 digest. + RSA_DECRYPT_OAEP_2048_SHA256 = 8 + + # RSAES-OAEP 3072 bit key with a SHA256 digest. + RSA_DECRYPT_OAEP_3072_SHA256 = 9 + + # RSAES-OAEP 4096 bit key with a SHA256 digest. + RSA_DECRYPT_OAEP_4096_SHA256 = 10 + + # RSAES-OAEP 4096 bit key with a SHA512 digest. + RSA_DECRYPT_OAEP_4096_SHA512 = 17 + + # RSAES-OAEP 2048 bit key with a SHA1 digest. + RSA_DECRYPT_OAEP_2048_SHA1 = 37 + + # RSAES-OAEP 3072 bit key with a SHA1 digest. + RSA_DECRYPT_OAEP_3072_SHA1 = 38 + + # RSAES-OAEP 4096 bit key with a SHA1 digest. + 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 + 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 + 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 + EC_SIGN_SECP256K1_SHA256 = 31 + + # EdDSA on the Curve25519 in pure mode (taking data as input). + EC_SIGN_ED25519 = 40 + + # HMAC-SHA256 signing with a 256 bit key. + HMAC_SHA256 = 32 + + # HMAC-SHA1 signing with a 160 bit key. + HMAC_SHA1 = 33 + + # HMAC-SHA384 signing with a 384 bit key. + HMAC_SHA384 = 34 + + # HMAC-SHA512 signing with a 512 bit key. + HMAC_SHA512 = 35 + + # HMAC-SHA224 signing with a 224 bit key. + HMAC_SHA224 = 36 + + # Algorithm representing symmetric encryption by an external key manager. + EXTERNAL_SYMMETRIC_ENCRYPTION = 18 + + # ML-KEM-768 (FIPS 203) + ML_KEM_768 = 47 + + # ML-KEM-1024 (FIPS 203) + ML_KEM_1024 = 48 + + # X-Wing hybrid KEM combining ML-KEM-768 with X25519 following + # datatracker.ietf.org/doc/draft-connolly-cfrg-xwing-kem/. + KEM_XWING = 63 + + # The post-quantum Module-Lattice-Based Digital Signature Algorithm, at + # security level 3. Randomized version. + PQ_SIGN_ML_DSA_65 = 56 + + # The post-quantum stateless hash-based digital signature algorithm, at + # security level 1. Randomized version. + PQ_SIGN_SLH_DSA_SHA2_128S = 57 + end + + # The state of a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, + # indicating if it can be used. + module CryptoKeyVersionState + # Not specified. + 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 + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} + # as soon as the version is ready. + PENDING_GENERATION = 5 + + # This version may be used for cryptographic operations. + ENABLED = 1 + + # This version may not be used, but the key material is still available, + # and the version can be placed back into the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} + # state. + DISABLED = 2 + + # The key material of this version is destroyed and no longer stored. + # This version may only become + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} + # again if this version is + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#reimport_eligible reimport_eligible} + # and the original key material is reimported with a call to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version KeyManagementService.ImportCryptoKeyVersion}. + DESTROYED = 3 + + # This version is scheduled for destruction, and will be destroyed soon. + # Call + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version RestoreCryptoKeyVersion} + # to put it back into the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED} + # state. + 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 + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} + # as soon as the version is ready. + 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 + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#import_failure_reason CryptoKeyVersion.import_failure_reason}. + IMPORT_FAILED = 7 + + # This version was not generated successfully. It may not be used, enabled, + # disabled, or destroyed. Additional details can be found in + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#generation_failure_reason CryptoKeyVersion.generation_failure_reason}. + 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. + 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 + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#external_destruction_failure_reason CryptoKeyVersion.external_destruction_failure_reason}. + EXTERNAL_DESTRUCTION_FAILED = 10 + end + + # A view for {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}s. + # Controls the level of detail returned for + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} in + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions KeyManagementService.ListCryptoKeyVersions} + # and + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys KeyManagementService.ListCryptoKeys}. + module CryptoKeyVersionView + # Default view for each + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Does not + # include the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#attestation attestation} field. + CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0 + + # Provides all fields in each + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, including the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#attestation attestation}. + FULL = 1 + end + end + + # Data with integrity verification field. + # @!attribute [rw] data + # @return [::String] + # Raw Data. + # @!attribute [rw] crc32c_checksum + # @return [::Google::Protobuf::Int64Value] + # Integrity verification field. A CRC32C + # checksum of the returned + # {::Google::Cloud::Kms::V1::ChecksummedData#data ChecksummedData.data}. An + # integrity check of + # {::Google::Cloud::Kms::V1::ChecksummedData#data ChecksummedData.data} can be + # performed by computing the CRC32C checksum of + # {::Google::Cloud::Kms::V1::ChecksummedData#data ChecksummedData.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. + class ChecksummedData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The public keys for a given + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Obtained via + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey}. + # @!attribute [rw] pem + # @return [::String] + # 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). + # @!attribute [rw] algorithm + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] + # The + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm Algorithm} + # associated with this key. + # @!attribute [rw] pem_crc32c + # @return [::Google::Protobuf::Int64Value] + # Integrity verification field. A CRC32C checksum of the returned + # {::Google::Cloud::Kms::V1::PublicKey#pem PublicKey.pem}. An integrity check of + # {::Google::Cloud::Kms::V1::PublicKey#pem PublicKey.pem} can be performed by + # computing the CRC32C checksum of + # {::Google::Cloud::Kms::V1::PublicKey#pem 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. + # @!attribute [rw] name + # @return [::String] + # The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key. + # Provided here for verification. + # + # NOTE: This field is in Beta. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key. + # @!attribute [rw] public_key_format + # @return [::Google::Cloud::Kms::V1::PublicKey::PublicKeyFormat] + # The {::Google::Cloud::Kms::V1::PublicKey PublicKey} format specified by the + # customer through the + # {::Google::Cloud::Kms::V1::GetPublicKeyRequest#public_key_format public_key_format} + # field. + # @!attribute [rw] public_key + # @return [::Google::Cloud::Kms::V1::ChecksummedData] + # This field contains the public key (with integrity verification), formatted + # according to the + # {::Google::Cloud::Kms::V1::PublicKey#public_key_format public_key_format} field. + class PublicKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The supported {::Google::Cloud::Kms::V1::PublicKey PublicKey} formats. + module PublicKeyFormat + # If the + # {::Google::Cloud::Kms::V1::GetPublicKeyRequest#public_key_format public_key_format} + # field is not specified: + # - For PQC algorithms, an error will be returned. + # - For non-PQC algorithms, the default format is PEM, and the field + # {::Google::Cloud::Kms::V1::PublicKey#pem pem} will be populated. + # + # Otherwise, the public key will be exported through the + # {::Google::Cloud::Kms::V1::PublicKey#public_key public_key} field in the + # requested format. + PUBLIC_KEY_FORMAT_UNSPECIFIED = 0 + + # The returned public key will be encoded in PEM format. + # See the [RFC7468](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) for more information. + PEM = 1 + + # The returned public key will be encoded in DER format (the + # PrivateKeyInfo structure from RFC 5208). + DER = 2 + + # This is supported only for PQC algorithms. + # The key material is returned in the format defined by NIST PQC + # standards (FIPS 203, FIPS 204, and FIPS 205). + NIST_PQC = 3 + + # The returned public key is in raw bytes format defined in its standard + # https://datatracker.ietf.org/doc/draft-connolly-cfrg-xwing-kem. + XWING_RAW_BYTES = 4 + end + end + + # An {::Google::Cloud::Kms::V1::ImportJob ImportJob} can be used to create + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} and + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} using pre-existing + # key material, generated outside of Cloud KMS. + # + # When an {::Google::Cloud::Kms::V1::ImportJob ImportJob} is created, Cloud KMS will + # generate a "wrapping key", which is a public/private key pair. You use the + # wrapping key to encrypt (also known as wrap) the pre-existing key material to + # protect it during the import process. The nature of the wrapping key depends + # on the choice of + # {::Google::Cloud::Kms::V1::ImportJob#import_method import_method}. When the + # wrapping key generation is complete, the + # {::Google::Cloud::Kms::V1::ImportJob#state state} will be set to + # {::Google::Cloud::Kms::V1::ImportJob::ImportJobState::ACTIVE ACTIVE} and the + # {::Google::Cloud::Kms::V1::ImportJob#public_key public_key} can be fetched. The + # fetched public key can then be used to wrap your pre-existing key material. + # + # Once the key material is wrapped, it can be imported into a new + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in an existing + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} by calling + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version ImportCryptoKeyVersion}. + # Multiple {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} can be + # imported with a single {::Google::Cloud::Kms::V1::ImportJob ImportJob}. Cloud KMS + # uses the private key portion of the wrapping key to unwrap the key material. + # Only Cloud KMS has access to the private key. + # + # An {::Google::Cloud::Kms::V1::ImportJob ImportJob} expires 3 days after it is + # created. Once expired, Cloud KMS will no longer be able to import or unwrap + # any key material that was wrapped with the + # {::Google::Cloud::Kms::V1::ImportJob ImportJob}'s public key. + # + # For more information, see + # [Importing a key](https://cloud.google.com/kms/docs/importing-a-key). + # @!attribute [r] name + # @return [::String] + # Output only. The resource name for this + # {::Google::Cloud::Kms::V1::ImportJob ImportJob} in the format + # `projects/*/locations/*/keyRings/*/importJobs/*`. + # @!attribute [rw] import_method + # @return [::Google::Cloud::Kms::V1::ImportJob::ImportMethod] + # Required. Immutable. The wrapping method to be used for incoming key + # material. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # Required. Immutable. The protection level of the + # {::Google::Cloud::Kms::V1::ImportJob ImportJob}. This must match the + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level} + # of the {::Google::Cloud::Kms::V1::CryptoKey#version_template version_template} + # on the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} you attempt to import + # into. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Kms::V1::ImportJob ImportJob} was created. + # @!attribute [r] generate_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this {::Google::Cloud::Kms::V1::ImportJob ImportJob}'s key + # material was generated. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Kms::V1::ImportJob ImportJob} is scheduled for expiration and + # can no longer be used to import key material. + # @!attribute [r] expire_event_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this {::Google::Cloud::Kms::V1::ImportJob ImportJob} + # expired. Only present if {::Google::Cloud::Kms::V1::ImportJob#state state} is + # {::Google::Cloud::Kms::V1::ImportJob::ImportJobState::EXPIRED EXPIRED}. + # @!attribute [r] state + # @return [::Google::Cloud::Kms::V1::ImportJob::ImportJobState] + # Output only. The current state of the + # {::Google::Cloud::Kms::V1::ImportJob ImportJob}, indicating if it can be used. + # @!attribute [r] public_key + # @return [::Google::Cloud::Kms::V1::ImportJob::WrappingPublicKey] + # Output only. The public key with which to wrap key material prior to + # import. Only returned if {::Google::Cloud::Kms::V1::ImportJob#state state} is + # {::Google::Cloud::Kms::V1::ImportJob::ImportJobState::ACTIVE ACTIVE}. + # @!attribute [r] attestation + # @return [::Google::Cloud::Kms::V1::KeyOperationAttestation] + # 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 + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod ImportMethod} is one with a + # protection level of {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM}. + # @!attribute [rw] crypto_key_backend + # @return [::String] + # Immutable. The resource name of the backend environment where the key + # material for the wrapping key resides and where all related cryptographic + # operations are performed. Currently, this field is only populated for keys + # stored in HSM_SINGLE_TENANT. Note, this list is non-exhaustive and may + # apply to additional {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevels} + # in the future. + # Supported resources: + # * `"projects/*/locations/*/singleTenantHsmInstances/*"` + class ImportJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The public key component of the wrapping key. For details of the type of + # key this public key corresponds to, see the + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod ImportMethod}. + # @!attribute [rw] pem + # @return [::String] + # 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). + class WrappingPublicKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod ImportMethod} describes the + # key wrapping method chosen for this + # {::Google::Cloud::Kms::V1::ImportJob ImportJob}. + module ImportMethod + # Not specified. + 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). + 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). + 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). + 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). + 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. + 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. + RSA_OAEP_4096_SHA256 = 6 + end + + # The state of the {::Google::Cloud::Kms::V1::ImportJob ImportJob}, indicating if + # it can be used. + module ImportJobState + # Not specified. + 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 + # {::Google::Cloud::Kms::V1::ImportJob::ImportJobState::ACTIVE ACTIVE} as soon as + # the wrapping key is generated. + PENDING_GENERATION = 1 + + # This job may be used in + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key CreateCryptoKey} + # and + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} + # requests. + ACTIVE = 2 + + # This job can no longer be used and may not leave this state once entered. + EXPIRED = 3 + end + end + + # ExternalProtectionLevelOptions stores a group of additional fields for + # configuring a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} that + # are specific to the {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL} + # protection level and + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} protection + # levels. + # @!attribute [rw] external_key_uri + # @return [::String] + # The URI for an external resource that this + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} represents. + # @!attribute [rw] ekm_connection_key_path + # @return [::String] + # The path to the external key material on the EKM when using + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} e.g., "v0/my/key". Set + # this field instead of external_key_uri when using an + # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. + class ExternalProtectionLevelOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A + # {::Google::Cloud::Kms::V1::KeyAccessJustificationsPolicy KeyAccessJustificationsPolicy} + # specifies zero or more allowed + # {::Google::Cloud::Kms::V1::AccessReason AccessReason} values for encrypt, decrypt, + # and sign operations on a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # @!attribute [rw] allowed_access_reasons + # @return [::Array<::Google::Cloud::Kms::V1::AccessReason>] + # The list of allowed reasons for access to a + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. Zero allowed access reasons + # means all encrypt, decrypt, and sign operations for the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} associated with this policy will + # fail. + class KeyAccessJustificationsPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A RetiredResource resource represents the record of a deleted + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. Its purpose is to provide + # visibility into retained user data and to prevent reuse of these names for + # new {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name for this + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} in the format + # `projects/*/locations/*/retiredResources/*`. + # @!attribute [r] original_resource + # @return [::String] + # Output only. The full resource name of the original + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that was deleted in the format + # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + # @!attribute [r] resource_type + # @return [::String] + # Output only. The resource type of the original deleted resource. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the original resource was deleted and this + # RetiredResource record was created. + class RetiredResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} specifies how + # cryptographic operations are performed. For more information, see [Protection + # levels] (https://cloud.google.com/kms/docs/algorithms#protection_levels). + module ProtectionLevel + # Not specified. + PROTECTION_LEVEL_UNSPECIFIED = 0 + + # Crypto operations are performed in software. + SOFTWARE = 1 + + # Crypto operations are performed in a Hardware Security Module. + HSM = 2 + + # Crypto operations are performed by an external key manager. + EXTERNAL = 3 + + # Crypto operations are performed in an EKM-over-VPC backend. + EXTERNAL_VPC = 4 + + # Crypto operations are performed in a single-tenant HSM. + HSM_SINGLE_TENANT = 5 + end + + # Describes the reason for a data access. Please refer to + # https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes + # for the detailed semantic meaning of justification reason codes. + module AccessReason + # Unspecified access reason. + REASON_UNSPECIFIED = 0 + + # Customer-initiated support. + CUSTOMER_INITIATED_SUPPORT = 1 + + # Google-initiated access for system management and troubleshooting. + GOOGLE_INITIATED_SERVICE = 2 + + # Google-initiated access in response to a legal request or legal process. + THIRD_PARTY_DATA_REQUEST = 3 + + # Google-initiated access for security, fraud, abuse, or compliance purposes. + GOOGLE_INITIATED_REVIEW = 4 + + # Customer uses their account to perform any access to their own data which + # their IAM policy authorizes. + CUSTOMER_INITIATED_ACCESS = 5 + + # Google systems access customer data to help optimize the structure of the + # data or quality for future uses by the customer. + GOOGLE_INITIATED_SYSTEM_OPERATION = 6 + + # No reason is expected for this key request. + REASON_NOT_EXPECTED = 7 + + # Deprecated: This code is no longer generated by + # Google Cloud. The GOOGLE_RESPONSE_TO_PRODUCTION_ALERT justification codes + # available in both Key Access Justifications and Access Transparency logs + # provide customer-visible signals of emergency access in more precise + # contexts. + # + # Customer uses their account to perform any access to their own data which + # their IAM policy authorizes, and one of the following is true: + # + # * A Google administrator has reset the root-access account associated with + # the user's organization within the past 7 days. + # * A Google-initiated emergency access operation has interacted with a + # resource in the same project or folder as the currently accessed resource + # within the past 7 days. + MODIFIED_CUSTOMER_INITIATED_ACCESS = 8 + + # Deprecated: This code is no longer generated by + # Google Cloud. The GOOGLE_RESPONSE_TO_PRODUCTION_ALERT justification codes + # available in both Key Access Justifications and Access Transparency logs + # provide customer-visible signals of emergency access in more precise + # contexts. + # + # Google systems access customer data to help optimize the structure of the + # data or quality for future uses by the customer, and one of the following + # is true: + # + # * A Google administrator has reset the root-access account associated with + # the user's organization within the past 7 days. + # * A Google-initiated emergency access operation has interacted with a + # resource in the same project or folder as the currently accessed resource + # within the past 7 days. + MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION = 9 + + # Google-initiated access to maintain system reliability. + GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 10 + + # One of the following operations is being executed while simultaneously + # encountering an internal technical issue which prevented a more precise + # justification code from being generated: + # + # * Your account has been used to perform any access to your own data which + # your IAM policy authorizes. + # * An automated Google system operates on encrypted customer data which your + # IAM policy authorizes. + # * Customer-initiated Google support access. + # * Google-initiated support access to protect system reliability. + CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING = 11 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb new file mode 100644 index 000000000000..d7e4c1a0141b --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb @@ -0,0 +1,1907 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Kms + module V1 + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings KeyManagementService.ListKeyRings}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format + # `projects/*/locations/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::KeyRing KeyRings} to include in the response. Further + # {::Google::Cloud::Kms::V1::KeyRing KeyRings} can subsequently be obtained by + # including the + # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # 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). + # @!attribute [rw] order_by + # @return [::String] + # 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). + class ListKeyRingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys KeyManagementService.ListCryptoKeys}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} + # to list, in the format `projects/*/locations/*/keyRings/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} to include in the response. + # Further {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token}. + # @!attribute [rw] version_view + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] + # The fields of the primary version to include in the response. + # @!attribute [rw] filter + # @return [::String] + # 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). + # @!attribute [rw] order_by + # @return [::String] + # 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). + class ListCryptoKeysRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions KeyManagementService.ListCryptoKeyVersions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to list, in the format + # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} to include in the + # response. Further {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} + # can subsequently be obtained by including the + # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token}. + # @!attribute [rw] view + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] + # The fields to include in the response. + # @!attribute [rw] filter + # @return [::String] + # 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). + # @!attribute [rw] order_by + # @return [::String] + # 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). + class ListCryptoKeyVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_import_jobs KeyManagementService.ListImportJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} + # to list, in the format `projects/*/locations/*/keyRings/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::ImportJob ImportJobs} to include in the response. + # Further {::Google::Cloud::Kms::V1::ImportJob ImportJobs} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # 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). + # @!attribute [rw] order_by + # @return [::String] + # 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). + class ListImportJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources KeyManagementService.ListRetiredResources}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project-specific location holding the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}, in the format + # `projects/*/locations/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} to be included in + # the response. Further + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token}. + class ListRetiredResourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings KeyManagementService.ListKeyRings}. + # @!attribute [rw] key_rings + # @return [::Array<::Google::Cloud::Kms::V1::KeyRing>] + # The list of {::Google::Cloud::Kms::V1::KeyRing KeyRings}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Kms::V1::ListKeyRingsRequest#page_token ListKeyRingsRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of {::Google::Cloud::Kms::V1::KeyRing KeyRings} that matched + # the query. + # + # This field is not populated if + # {::Google::Cloud::Kms::V1::ListKeyRingsRequest#filter ListKeyRingsRequest.filter} + # is applied. + class ListKeyRingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys KeyManagementService.ListCryptoKeys}. + # @!attribute [rw] crypto_keys + # @return [::Array<::Google::Cloud::Kms::V1::CryptoKey>] + # The list of {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Kms::V1::ListCryptoKeysRequest#page_token ListCryptoKeysRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} that + # matched the query. + # + # This field is not populated if + # {::Google::Cloud::Kms::V1::ListCryptoKeysRequest#filter ListCryptoKeysRequest.filter} + # is applied. + class ListCryptoKeysResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions KeyManagementService.ListCryptoKeyVersions}. + # @!attribute [rw] crypto_key_versions + # @return [::Array<::Google::Cloud::Kms::V1::CryptoKeyVersion>] + # The list of {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest#page_token ListCryptoKeyVersionsRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} that matched the + # query. + # + # This field is not populated if + # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest#filter ListCryptoKeyVersionsRequest.filter} + # is applied. + class ListCryptoKeyVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_import_jobs KeyManagementService.ListImportJobs}. + # @!attribute [rw] import_jobs + # @return [::Array<::Google::Cloud::Kms::V1::ImportJob>] + # The list of {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Kms::V1::ListImportJobsRequest#page_token ListImportJobsRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of {::Google::Cloud::Kms::V1::ImportJob ImportJobs} that + # matched the query. + # + # This field is not populated if + # {::Google::Cloud::Kms::V1::ListImportJobsRequest#filter ListImportJobsRequest.filter} + # is applied. + class ListImportJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources KeyManagementService.ListRetiredResources}. + # @!attribute [rw] retired_resources + # @return [::Array<::Google::Cloud::Kms::V1::RetiredResource>] + # The list of {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Pass this value in + # {::Google::Cloud::Kms::V1::ListRetiredResourcesRequest#page_token ListRetiredResourcesRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} + # that matched the query. + class ListRetiredResourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_key_ring KeyManagementService.GetKeyRing}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the + # {::Google::Cloud::Kms::V1::KeyRing KeyRing} to get. + class GetKeyRingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key KeyManagementService.GetCryptoKey}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to get. + class GetCryptoKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key_version KeyManagementService.GetCryptoKeyVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to get. + class GetCryptoKeyVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key KeyManagementService.GetPublicKey}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key to get. + # @!attribute [rw] public_key_format + # @return [::Google::Cloud::Kms::V1::PublicKey::PublicKeyFormat] + # Optional. The {::Google::Cloud::Kms::V1::PublicKey PublicKey} format specified + # by the user. This field is required for PQC algorithms. If specified, the + # public key will be exported through the + # {::Google::Cloud::Kms::V1::PublicKey#public_key public_key} field in the + # requested format. Otherwise, the {::Google::Cloud::Kms::V1::PublicKey#pem pem} + # field will be populated for non-PQC algorithms, and an error will be + # returned for PQC algorithms. + class GetPublicKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_import_job KeyManagementService.GetImportJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the + # {::Google::Cloud::Kms::V1::ImportJob ImportJob} to get. + class GetImportJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_retired_resource KeyManagementService.GetRetiredResource}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::RetiredResource#name name} of the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} to get. + class GetRetiredResourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_key_ring KeyManagementService.CreateKeyRing}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format + # `projects/*/locations/*`. + # @!attribute [rw] key_ring_id + # @return [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @!attribute [rw] key_ring + # @return [::Google::Cloud::Kms::V1::KeyRing] + # Required. A {::Google::Cloud::Kms::V1::KeyRing KeyRing} with initial field + # values. + class CreateKeyRingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key KeyManagementService.CreateCryptoKey}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the KeyRing + # associated with the {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # @!attribute [rw] crypto_key_id + # @return [::String] + # Required. It must be unique within a KeyRing and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @!attribute [rw] crypto_key + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # Required. A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with initial field + # values. + # @!attribute [rw] skip_initial_version_creation + # @return [::Boolean] + # If set to true, the request will create a + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} without any + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. You must + # manually call + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} + # or + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version ImportCryptoKeyVersion} + # before you can use this {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + class CreateCryptoKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version KeyManagementService.CreateCryptoKeyVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} associated with the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. + # @!attribute [rw] crypto_key_version + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # Required. A {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with + # initial field values. + class CreateCryptoKeyVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key KeyManagementService.DeleteCryptoKey}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to delete. + class DeleteCryptoKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to delete. + class DeleteCryptoKeyVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version KeyManagementService.ImportCryptoKeyVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to be imported into. + # + # The create permission is only required on this key when creating a new + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. + # @!attribute [rw] crypto_key_version + # @return [::String] + # Optional. The optional {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of + # an existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to + # target for an import operation. If this field is not present, a new + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} containing the + # supplied key material is created. + # + # If this field is present, the supplied key material is imported into + # the existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. To + # import into an existing + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} must be a child of + # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#parent ImportCryptoKeyVersionRequest.parent}, + # have been previously created via + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version ImportCryptoKeyVersion}, + # and be in + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED} + # or + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::IMPORT_FAILED IMPORT_FAILED} + # state. The key material and algorithm must match the previous + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} exactly if the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} has ever contained + # key material. + # @!attribute [rw] algorithm + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] + # Required. The + # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm algorithm} + # of the key being imported. This does not need to match the + # {::Google::Cloud::Kms::V1::CryptoKey#version_template version_template} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} this version imports into. + # @!attribute [rw] import_job + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the + # {::Google::Cloud::Kms::V1::ImportJob ImportJob} that was used to wrap this key + # material. + # @!attribute [rw] wrapped_key + # @return [::String] + # 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 + # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA1_AES_256 RSA_OAEP_3072_SHA1_AES_256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA1_AES_256 RSA_OAEP_4096_SHA1_AES_256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256_AES_256 RSA_OAEP_3072_SHA256_AES_256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256_AES_256 RSA_OAEP_4096_SHA256_AES_256}), + # + # this field must contain the concatenation of: + #
    + #
  1. An ephemeral AES-256 wrapping key wrapped with the + # {::Google::Cloud::Kms::V1::ImportJob#public_key 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 + # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256 RSA_OAEP_3072_SHA256} + # or + # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256 RSA_OAEP_4096_SHA256}), + # + # this field must contain the formatted key to be imported, wrapped with the + # {::Google::Cloud::Kms::V1::ImportJob#public_key public_key} using RSAES-OAEP + # with SHA-256, MGF1 with SHA-256, and an empty label. + # @!attribute [rw] rsa_aes_wrapped_key + # @return [::String] + # Optional. This field has the same meaning as + # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#wrapped_key wrapped_key}. + # Prefer to use that field in new work. Either that field or this field + # (but not both) must be specified. + class ImportCryptoKeyVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_import_job KeyManagementService.CreateImportJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the + # {::Google::Cloud::Kms::V1::KeyRing KeyRing} associated with the + # {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. + # @!attribute [rw] import_job_id + # @return [::String] + # Required. It must be unique within a KeyRing and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @!attribute [rw] import_job + # @return [::Google::Cloud::Kms::V1::ImportJob] + # Required. An {::Google::Cloud::Kms::V1::ImportJob ImportJob} with initial field + # values. + class CreateImportJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key KeyManagementService.UpdateCryptoKey}. + # @!attribute [rw] crypto_key + # @return [::Google::Cloud::Kms::V1::CryptoKey] + # Required. {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with updated values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated in this request. + class UpdateCryptoKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_version KeyManagementService.UpdateCryptoKeyVersion}. + # @!attribute [rw] crypto_key_version + # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] + # Required. {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with + # updated values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated in this request. + class UpdateCryptoKeyVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version KeyManagementService.UpdateCryptoKeyPrimaryVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to update. + # @!attribute [rw] crypto_key_version_id + # @return [::String] + # Required. The id of the child + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use as primary. + class UpdateCryptoKeyPrimaryVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version KeyManagementService.DestroyCryptoKeyVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to destroy. + class DestroyCryptoKeyVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version KeyManagementService.RestoreCryptoKeyVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to restore. + class RestoreCryptoKeyVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt KeyManagementService.Encrypt}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} or + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # encryption. + # + # If a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is specified, the server + # will use its {::Google::Cloud::Kms::V1::CryptoKey#primary primary version}. + # @!attribute [rw] plaintext + # @return [::String] + # Required. The data to encrypt. Must be no larger than 64KiB. + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys, the + # plaintext must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @!attribute [rw] additional_authenticated_data + # @return [::String] + # Optional. Optional data that, if specified, must also be provided during + # decryption through + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys the + # AAD must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @!attribute [rw] plaintext_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}) + # is equal to + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c 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. + # @!attribute [rw] additional_authenticated_data_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}) + # is equal to + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c 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. + class EncryptRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt KeyManagementService.Decrypt}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to use for decryption. The + # server will choose the appropriate version. + # @!attribute [rw] ciphertext + # @return [::String] + # Required. The encrypted data originally returned in + # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext EncryptResponse.ciphertext}. + # @!attribute [rw] additional_authenticated_data + # @return [::String] + # Optional. Optional data that must match the data originally supplied in + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. + # @!attribute [rw] ciphertext_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}) + # is equal to + # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext_crc32c 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. + # @!attribute [rw] additional_authenticated_data_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}) + # is equal to + # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data_crc32c 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. + class DecryptRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt KeyManagementService.RawEncrypt}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # encryption. + # @!attribute [rw] plaintext + # @return [::String] + # Required. The data to encrypt. Must be no larger than 64KiB. + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the + # plaintext must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @!attribute [rw] additional_authenticated_data + # @return [::String] + # Optional. Optional data that, if specified, must also be provided during + # decryption through + # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. + # + # This field may only be used in conjunction with an + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm} that accepts + # additional authenticated data (for example, AES-GCM). + # + # The maximum size depends on the key version's + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. + # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the + # plaintext must be no larger than 64KiB. For + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of + # the plaintext and additional_authenticated_data fields must be no larger + # than 8KiB. + # @!attribute [rw] plaintext_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext RawEncryptRequest.plaintext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received plaintext using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + # @!attribute [rw] additional_authenticated_data_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received additional_authenticated_data using + # this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + # @!attribute [rw] initialization_vector + # @return [::String] + # 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 + # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. + # @!attribute [rw] initialization_vector_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector RawEncryptRequest.initialization_vector}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received initialization_vector using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + class RawEncryptRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt KeyManagementService.RawDecrypt}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # decryption. + # @!attribute [rw] ciphertext + # @return [::String] + # Required. The encrypted data originally returned in + # {::Google::Cloud::Kms::V1::RawEncryptResponse#ciphertext RawEncryptResponse.ciphertext}. + # @!attribute [rw] additional_authenticated_data + # @return [::String] + # Optional. Optional data that must match the data originally supplied in + # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. + # @!attribute [rw] initialization_vector + # @return [::String] + # Required. The initialization vector (IV) used during encryption, which must + # match the data originally provided in + # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. + # @!attribute [rw] tag_length + # @return [::Integer] + # 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). + # @!attribute [rw] ciphertext_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext RawDecryptRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received ciphertext using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + # @!attribute [rw] additional_authenticated_data_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received additional_authenticated_data using + # this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + # @!attribute [rw] initialization_vector_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector RawDecryptRequest.initialization_vector}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received initialization_vector using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. + class RawDecryptRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign KeyManagementService.AsymmetricSign}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # signing. + # @!attribute [rw] digest + # @return [::Google::Cloud::Kms::V1::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 + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm}. + # + # This field may not be supplied if + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} + # is supplied. + # @!attribute [rw] digest_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}) + # is equal to + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c 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. + # @!attribute [rw] data + # @return [::String] + # Optional. The data to sign. + # It can't be supplied if + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} + # is supplied. + # @!attribute [rw] data_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}) + # is equal to + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c 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. + class AsymmetricSignRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt KeyManagementService.AsymmetricDecrypt}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # decryption. + # @!attribute [rw] ciphertext + # @return [::String] + # Required. The data encrypted with the named + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s public key using + # OAEP. + # @!attribute [rw] ciphertext_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}) + # is equal to + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c 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. + class AsymmetricDecryptRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign KeyManagementService.MacSign}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # signing. + # @!attribute [rw] data + # @return [::String] + # Required. The data to sign. The MAC tag is computed over this data field + # based on the specific algorithm. + # @!attribute [rw] data_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}. If + # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} + # will verify the integrity of the received + # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} + # will report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}) is + # equal to + # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c 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. + class MacSignRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_verify KeyManagementService.MacVerify}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # verification. + # @!attribute [rw] data + # @return [::String] + # Required. The data used previously as a + # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} to generate + # the MAC tag. + # @!attribute [rw] data_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}. If + # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} + # will verify the integrity of the received + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data} using + # this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}) + # is equal to + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c 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. + # @!attribute [rw] mac + # @return [::String] + # Required. The signature to verify. + # @!attribute [rw] mac_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. An optional CRC32C checksum of the + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}. If + # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} + # will verify the integrity of the received + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac} using this + # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} + # will report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}) is + # equal to + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c 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. + class MacVerifyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate KeyManagementService.Decapsulate}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for + # decapsulation. + # @!attribute [rw] ciphertext + # @return [::String] + # Required. The ciphertext produced from encapsulation with the + # named {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public + # key(s). + # @!attribute [rw] ciphertext_crc32c + # @return [::Google::Protobuf::Int64Value] + # Optional. A CRC32C checksum of the + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}. + # If specified, + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # verify the integrity of the received + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext} + # using this checksum. + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will + # report an error if the checksum verification fails. If you receive a + # checksum error, your client should verify that + # CRC32C({::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}) + # is equal to + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.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. + class DecapsulateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#generate_random_bytes KeyManagementService.GenerateRandomBytes}. + # @!attribute [rw] location + # @return [::String] + # The project-specific location in which to generate random bytes. + # For example, "projects/my-project/locations/us-central1". + # @!attribute [rw] length_bytes + # @return [::Integer] + # The length in bytes of the amount of randomness to retrieve. Minimum 8 + # bytes, maximum 1024 bytes. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} to use when + # generating the random data. Currently, only + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} protection level is + # supported. + class GenerateRandomBytesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt KeyManagementService.Encrypt}. + # @!attribute [rw] name + # @return [::String] + # The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in + # encryption. Check this field to verify that the intended resource was used + # for encryption. + # @!attribute [rw] ciphertext + # @return [::String] + # The encrypted data. + # @!attribute [rw] ciphertext_crc32c + # @return [::Google::Protobuf::Int64Value] + # Integrity verification field. A CRC32C checksum of the returned + # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext EncryptResponse.ciphertext}. + # An integrity check of + # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext EncryptResponse.ciphertext} + # can be performed by computing the CRC32C checksum of + # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext 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. + # @!attribute [rw] verified_plaintext_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c EncryptRequest.plaintext_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of the + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext plaintext}. A false value of + # this field indicates either that + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c EncryptRequest.plaintext_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c EncryptRequest.plaintext_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] verified_additional_authenticated_data_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c EncryptRequest.additional_authenticated_data_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of the + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data AAD}. A + # false value of this field indicates either that + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c EncryptRequest.additional_authenticated_data_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c EncryptRequest.additional_authenticated_data_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in + # encryption. + class EncryptResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt KeyManagementService.Decrypt}. + # @!attribute [rw] plaintext + # @return [::String] + # The decrypted data originally supplied in + # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}. + # @!attribute [rw] plaintext_crc32c + # @return [::Google::Protobuf::Int64Value] + # Integrity verification field. A CRC32C checksum of the returned + # {::Google::Cloud::Kms::V1::DecryptResponse#plaintext DecryptResponse.plaintext}. + # An integrity check of + # {::Google::Cloud::Kms::V1::DecryptResponse#plaintext DecryptResponse.plaintext} + # can be performed by computing the CRC32C checksum of + # {::Google::Cloud::Kms::V1::DecryptResponse#plaintext 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 + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} is able to + # successfully decrypt the + # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext 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. + # @!attribute [rw] used_primary + # @return [::Boolean] + # Whether the Decryption was performed using the primary key version. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in + # decryption. + class DecryptResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt KeyManagementService.RawEncrypt}. + # @!attribute [rw] ciphertext + # @return [::String] + # The encrypted data. In the case of AES-GCM, the authentication tag + # is the {::Google::Cloud::Kms::V1::RawEncryptResponse#tag_length tag_length} + # bytes at the end of this field. + # @!attribute [rw] initialization_vector + # @return [::String] + # The initialization vector (IV) generated by the service during + # encryption. This value must be stored and provided in + # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector RawDecryptRequest.initialization_vector} + # at decryption time. + # @!attribute [rw] tag_length + # @return [::Integer] + # The length of the authentication tag that is appended to + # the end of the ciphertext. + # @!attribute [rw] ciphertext_crc32c + # @return [::Google::Protobuf::Int64Value] + # Integrity verification field. A CRC32C checksum of the returned + # {::Google::Cloud::Kms::V1::RawEncryptResponse#ciphertext 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. + # @!attribute [rw] initialization_vector_crc32c + # @return [::Google::Protobuf::Int64Value] + # Integrity verification field. A CRC32C checksum of the returned + # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector 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. + # @!attribute [rw] verified_plaintext_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext_crc32c RawEncryptRequest.plaintext_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of the plaintext. A false value of this + # field indicates either that + # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext_crc32c RawEncryptRequest.plaintext_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext_crc32c RawEncryptRequest.plaintext_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] verified_additional_authenticated_data_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data_crc32c RawEncryptRequest.additional_authenticated_data_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of additional_authenticated_data. A false + # value of this field indicates either that // + # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data_crc32c RawEncryptRequest.additional_authenticated_data_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data_crc32c RawEncryptRequest.additional_authenticated_data_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] verified_initialization_vector_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector_crc32c RawEncryptRequest.initialization_vector_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of initialization_vector. A false value of + # this field indicates either that + # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector_crc32c RawEncryptRequest.initialization_vector_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector_crc32c RawEncryptRequest.initialization_vector_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] name + # @return [::String] + # The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in + # encryption. Check this field to verify that the intended resource was used + # for encryption. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in + # encryption. + class RawEncryptResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt KeyManagementService.RawDecrypt}. + # @!attribute [rw] plaintext + # @return [::String] + # The decrypted data. + # @!attribute [rw] plaintext_crc32c + # @return [::Google::Protobuf::Int64Value] + # Integrity verification field. A CRC32C checksum of the returned + # {::Google::Cloud::Kms::V1::RawDecryptResponse#plaintext 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 + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} is able to + # successfully decrypt the + # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext 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. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in + # decryption. + # @!attribute [rw] verified_ciphertext_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext_crc32c RawDecryptRequest.ciphertext_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of the ciphertext. A false value of this + # field indicates either that + # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext_crc32c RawDecryptRequest.ciphertext_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext_crc32c RawDecryptRequest.ciphertext_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] verified_additional_authenticated_data_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data_crc32c RawDecryptRequest.additional_authenticated_data_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of additional_authenticated_data. A false + # value of this field indicates either that // + # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data_crc32c RawDecryptRequest.additional_authenticated_data_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data_crc32c RawDecryptRequest.additional_authenticated_data_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] verified_initialization_vector_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector_crc32c RawDecryptRequest.initialization_vector_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of initialization_vector. A false value of + # this field indicates either that + # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector_crc32c RawDecryptRequest.initialization_vector_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector_crc32c RawDecryptRequest.initialization_vector_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + class RawDecryptResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign KeyManagementService.AsymmetricSign}. + # @!attribute [rw] signature + # @return [::String] + # The created signature. + # @!attribute [rw] signature_crc32c + # @return [::Google::Protobuf::Int64Value] + # Integrity verification field. A CRC32C checksum of the returned + # {::Google::Cloud::Kms::V1::AsymmetricSignResponse#signature AsymmetricSignResponse.signature}. + # An integrity check of + # {::Google::Cloud::Kms::V1::AsymmetricSignResponse#signature AsymmetricSignResponse.signature} + # can be performed by computing the CRC32C checksum of + # {::Google::Cloud::Kms::V1::AsymmetricSignResponse#signature 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. + # @!attribute [rw] verified_digest_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c AsymmetricSignRequest.digest_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of the + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest digest}. A false value + # of this field indicates either that + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c AsymmetricSignRequest.digest_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c AsymmetricSignRequest.digest_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] name + # @return [::String] + # The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for signing. + # Check this field to verify that the intended resource was used for signing. + # @!attribute [rw] verified_data_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c AsymmetricSignRequest.data_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of the + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data data}. A false value of + # this field indicates either that + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c AsymmetricSignRequest.data_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c AsymmetricSignRequest.data_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for signing. + class AsymmetricSignResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt KeyManagementService.AsymmetricDecrypt}. + # @!attribute [rw] plaintext + # @return [::String] + # The decrypted data originally encrypted with the matching public key. + # @!attribute [rw] plaintext_crc32c + # @return [::Google::Protobuf::Int64Value] + # Integrity verification field. A CRC32C checksum of the returned + # {::Google::Cloud::Kms::V1::AsymmetricDecryptResponse#plaintext AsymmetricDecryptResponse.plaintext}. + # An integrity check of + # {::Google::Cloud::Kms::V1::AsymmetricDecryptResponse#plaintext AsymmetricDecryptResponse.plaintext} + # can be performed by computing the CRC32C checksum of + # {::Google::Cloud::Kms::V1::AsymmetricDecryptResponse#plaintext 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. + # @!attribute [rw] verified_ciphertext_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c AsymmetricDecryptRequest.ciphertext_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of the + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext ciphertext}. A + # false value of this field indicates either that + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c AsymmetricDecryptRequest.ciphertext_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c AsymmetricDecryptRequest.ciphertext_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in + # decryption. + class AsymmetricDecryptResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign KeyManagementService.MacSign}. + # @!attribute [rw] name + # @return [::String] + # The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for signing. + # Check this field to verify that the intended resource was used for signing. + # @!attribute [rw] mac + # @return [::String] + # The created signature. + # @!attribute [rw] mac_crc32c + # @return [::Google::Protobuf::Int64Value] + # Integrity verification field. A CRC32C checksum of the returned + # {::Google::Cloud::Kms::V1::MacSignResponse#mac MacSignResponse.mac}. An + # integrity check of + # {::Google::Cloud::Kms::V1::MacSignResponse#mac MacSignResponse.mac} can be + # performed by computing the CRC32C checksum of + # {::Google::Cloud::Kms::V1::MacSignResponse#mac 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. + # @!attribute [rw] verified_data_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c MacSignRequest.data_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of the + # {::Google::Cloud::Kms::V1::MacSignRequest#data data}. A false value of this + # field indicates either that + # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c MacSignRequest.data_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c MacSignRequest.data_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for signing. + class MacSignResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_verify KeyManagementService.MacVerify}. + # @!attribute [rw] name + # @return [::String] + # The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for + # verification. Check this field to verify that the intended resource was + # used for verification. + # @!attribute [rw] success + # @return [::Boolean] + # This field indicates whether or not the verification operation for + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac} over + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data} was + # successful. + # @!attribute [rw] verified_data_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c MacVerifyRequest.data_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of the + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data data}. A false value of this + # field indicates either that + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c MacVerifyRequest.data_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c MacVerifyRequest.data_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] verified_mac_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c MacVerifyRequest.mac_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of the + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac data}. A false value of this + # field indicates either that + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c MacVerifyRequest.mac_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c MacVerifyRequest.mac_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] verified_success_integrity + # @return [::Boolean] + # 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. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for + # verification. + class MacVerifyResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate KeyManagementService.Decapsulate}. + # @!attribute [rw] name + # @return [::String] + # The resource name of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for + # decapsulation. Check this field to verify that the intended resource was + # used for decapsulation. + # @!attribute [rw] shared_secret + # @return [::String] + # The decapsulated shared_secret originally encapsulated with the matching + # public key. + # @!attribute [rw] shared_secret_crc32c + # @return [::Integer] + # Integrity verification field. A CRC32C checksum of the returned + # {::Google::Cloud::Kms::V1::DecapsulateResponse#shared_secret DecapsulateResponse.shared_secret}. + # An integrity check of + # {::Google::Cloud::Kms::V1::DecapsulateResponse#shared_secret DecapsulateResponse.shared_secret} + # can be performed by computing the CRC32C checksum of + # {::Google::Cloud::Kms::V1::DecapsulateResponse#shared_secret DecapsulateResponse.shared_secret} + # 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 + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} is able to + # successfully decrypt the + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext 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. + # @!attribute [rw] verified_ciphertext_crc32c + # @return [::Boolean] + # Integrity verification field. A flag indicating whether + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.ciphertext_crc32c} + # was received by + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used + # for the integrity verification of the + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext ciphertext}. A false + # value of this field indicates either that + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.ciphertext_crc32c} + # was left unset or that it was not delivered to + # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've + # set + # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.ciphertext_crc32c} + # but this field is still false, discard the response and perform a limited + # number of retries. + # @!attribute [rw] protection_level + # @return [::Google::Cloud::Kms::V1::ProtectionLevel] + # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in + # decapsulation. + class DecapsulateResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#generate_random_bytes KeyManagementService.GenerateRandomBytes}. + # @!attribute [rw] data + # @return [::String] + # The generated data. + # @!attribute [rw] data_crc32c + # @return [::Google::Protobuf::Int64Value] + # Integrity verification field. A CRC32C checksum of the returned + # {::Google::Cloud::Kms::V1::GenerateRandomBytesResponse#data GenerateRandomBytesResponse.data}. + # An integrity check of + # {::Google::Cloud::Kms::V1::GenerateRandomBytesResponse#data GenerateRandomBytesResponse.data} + # can be performed by computing the CRC32C checksum of + # {::Google::Cloud::Kms::V1::GenerateRandomBytesResponse#data 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. + class GenerateRandomBytesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A {::Google::Cloud::Kms::V1::Digest Digest} holds a cryptographic message digest. + # @!attribute [rw] sha256 + # @return [::String] + # A message digest produced with the SHA-256 algorithm. + # + # Note: The following fields are mutually exclusive: `sha256`, `sha384`, `sha512`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] sha384 + # @return [::String] + # A message digest produced with the SHA-384 algorithm. + # + # Note: The following fields are mutually exclusive: `sha384`, `sha256`, `sha512`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] sha512 + # @return [::String] + # A message digest produced with the SHA-512 algorithm. + # + # Note: The following fields are mutually exclusive: `sha512`, `sha256`, `sha384`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Digest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cloud KMS metadata for the given + # [google.cloud.location.Location][google.cloud.location.Location]. + # @!attribute [rw] hsm_available + # @return [::Boolean] + # Indicates whether {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level} + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} can be created in this + # location. + # @!attribute [rw] ekm_available + # @return [::Boolean] + # Indicates whether {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level} + # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL} can be created in + # this location. + # @!attribute [rw] hsm_single_tenant_available + # @return [::Boolean] + # Indicates whether {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with + # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level} + # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM_SINGLE_TENANT HSM_SINGLE_TENANT} + # can be created in this location. + class LocationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key KeyManagementService.DeleteCryptoKey} + # long-running operation. + # @!attribute [r] retired_resource + # @return [::String] + # Output only. The resource name of the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} created as a result + # of this operation, in the format + # `projects/*/locations/*/retiredResources/*`. + class DeleteCryptoKeyMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion} + # long-running operation. + class DeleteCryptoKeyVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..1b485b0c3456 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-kms-v1/snippets/Gemfile new file mode 100644 index 000000000000..98c89139a331 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-kms-v1", path: "../" +else + gem "google-cloud-kms-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/create_key_handle.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/create_key_handle.rb new file mode 100644 index 000000000000..9807ecfd6d41 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/create_key_handle.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_Autokey_CreateKeyHandle_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the create_key_handle call in the Autokey service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::Autokey::Client#create_key_handle. +# +def create_key_handle + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::Autokey::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateKeyHandleRequest.new + + # Call the create_key_handle method. + result = client.create_key_handle request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudkms_v1_generated_Autokey_CreateKeyHandle_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/get_key_handle.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/get_key_handle.rb new file mode 100644 index 000000000000..ad2dfdd2d2f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/get_key_handle.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_Autokey_GetKeyHandle_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_key_handle call in the Autokey service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::Autokey::Client#get_key_handle. +# +def get_key_handle + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::Autokey::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetKeyHandleRequest.new + + # Call the get_key_handle method. + result = client.get_key_handle request + + # The returned object is of type Google::Cloud::Kms::V1::KeyHandle. + p result +end +# [END cloudkms_v1_generated_Autokey_GetKeyHandle_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/list_key_handles.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/list_key_handles.rb new file mode 100644 index 000000000000..bd5d80e61cc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/list_key_handles.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_Autokey_ListKeyHandles_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the list_key_handles call in the Autokey service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::Autokey::Client#list_key_handles. +# +def list_key_handles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::Autokey::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListKeyHandlesRequest.new + + # Call the list_key_handles method. + result = client.list_key_handles request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Kms::V1::KeyHandle. + p item + end +end +# [END cloudkms_v1_generated_Autokey_ListKeyHandles_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/get_autokey_config.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/get_autokey_config.rb new file mode 100644 index 000000000000..2bad14b94792 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/get_autokey_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_autokey_config call in the AutokeyAdmin service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::AutokeyAdmin::Client#get_autokey_config. +# +def get_autokey_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new + + # Call the get_autokey_config method. + result = client.get_autokey_config request + + # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. + p result +end +# [END cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/show_effective_autokey_config.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/show_effective_autokey_config.rb new file mode 100644 index 000000000000..4b92b55e18c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/show_effective_autokey_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_AutokeyAdmin_ShowEffectiveAutokeyConfig_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the show_effective_autokey_config call in the AutokeyAdmin service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config. +# +def show_effective_autokey_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new + + # Call the show_effective_autokey_config method. + result = client.show_effective_autokey_config request + + # The returned object is of type Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse. + p result +end +# [END cloudkms_v1_generated_AutokeyAdmin_ShowEffectiveAutokeyConfig_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/update_autokey_config.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/update_autokey_config.rb new file mode 100644 index 000000000000..5fa43287ea04 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/update_autokey_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_AutokeyAdmin_UpdateAutokeyConfig_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the update_autokey_config call in the AutokeyAdmin service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config. +# +def update_autokey_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new + + # Call the update_autokey_config method. + result = client.update_autokey_config request + + # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. + p result +end +# [END cloudkms_v1_generated_AutokeyAdmin_UpdateAutokeyConfig_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb new file mode 100644 index 000000000000..ec27b6df3f7f --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_EkmService_CreateEkmConnection_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the create_ekm_connection call in the EkmService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::EkmService::Client#create_ekm_connection. +# +def create_ekm_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::EkmService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new + + # Call the create_ekm_connection method. + result = client.create_ekm_connection request + + # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + p result +end +# [END cloudkms_v1_generated_EkmService_CreateEkmConnection_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_config.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_config.rb new file mode 100644 index 000000000000..f5ff174a38d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_EkmService_GetEkmConfig_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_ekm_config call in the EkmService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::EkmService::Client#get_ekm_config. +# +def get_ekm_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::EkmService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetEkmConfigRequest.new + + # Call the get_ekm_config method. + result = client.get_ekm_config request + + # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. + p result +end +# [END cloudkms_v1_generated_EkmService_GetEkmConfig_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb new file mode 100644 index 000000000000..8d053d252aa8 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_EkmService_GetEkmConnection_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_ekm_connection call in the EkmService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::EkmService::Client#get_ekm_connection. +# +def get_ekm_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::EkmService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetEkmConnectionRequest.new + + # Call the get_ekm_connection method. + result = client.get_ekm_connection request + + # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + p result +end +# [END cloudkms_v1_generated_EkmService_GetEkmConnection_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb new file mode 100644 index 000000000000..be9c3b272b35 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_EkmService_ListEkmConnections_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the list_ekm_connections call in the EkmService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::EkmService::Client#list_ekm_connections. +# +def list_ekm_connections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::EkmService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new + + # Call the list_ekm_connections method. + result = client.list_ekm_connections request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Kms::V1::EkmConnection. + p item + end +end +# [END cloudkms_v1_generated_EkmService_ListEkmConnections_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_config.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_config.rb new file mode 100644 index 000000000000..ac08cf508839 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_EkmService_UpdateEkmConfig_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the update_ekm_config call in the EkmService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::EkmService::Client#update_ekm_config. +# +def update_ekm_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::EkmService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new + + # Call the update_ekm_config method. + result = client.update_ekm_config request + + # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. + p result +end +# [END cloudkms_v1_generated_EkmService_UpdateEkmConfig_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb new file mode 100644 index 000000000000..a9755b7323ca --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_EkmService_UpdateEkmConnection_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the update_ekm_connection call in the EkmService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::EkmService::Client#update_ekm_connection. +# +def update_ekm_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::EkmService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new + + # Call the update_ekm_connection method. + result = client.update_ekm_connection request + + # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + p result +end +# [END cloudkms_v1_generated_EkmService_UpdateEkmConnection_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/verify_connectivity.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/verify_connectivity.rb new file mode 100644 index 000000000000..bcd0bb46d6e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/verify_connectivity.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_EkmService_VerifyConnectivity_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the verify_connectivity call in the EkmService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::EkmService::Client#verify_connectivity. +# +def verify_connectivity + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::EkmService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::VerifyConnectivityRequest.new + + # Call the verify_connectivity method. + result = client.verify_connectivity request + + # The returned object is of type Google::Cloud::Kms::V1::VerifyConnectivityResponse. + p result +end +# [END cloudkms_v1_generated_EkmService_VerifyConnectivity_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/approve_single_tenant_hsm_instance_proposal.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/approve_single_tenant_hsm_instance_proposal.rb new file mode 100644 index 000000000000..77a998e4b5cd --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/approve_single_tenant_hsm_instance_proposal.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_HsmManagement_ApproveSingleTenantHsmInstanceProposal_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the approve_single_tenant_hsm_instance_proposal call in the HsmManagement service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::HsmManagement::Client#approve_single_tenant_hsm_instance_proposal. +# +def approve_single_tenant_hsm_instance_proposal + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::HsmManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new + + # Call the approve_single_tenant_hsm_instance_proposal method. + result = client.approve_single_tenant_hsm_instance_proposal request + + # The returned object is of type Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse. + p result +end +# [END cloudkms_v1_generated_HsmManagement_ApproveSingleTenantHsmInstanceProposal_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance.rb new file mode 100644 index 000000000000..2df459816670 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstance_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the create_single_tenant_hsm_instance call in the HsmManagement service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance. +# +def create_single_tenant_hsm_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::HsmManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new + + # Call the create_single_tenant_hsm_instance method. + result = client.create_single_tenant_hsm_instance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstance_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance_proposal.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance_proposal.rb new file mode 100644 index 000000000000..9e6556d7eae3 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance_proposal.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstanceProposal_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the create_single_tenant_hsm_instance_proposal call in the HsmManagement service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal. +# +def create_single_tenant_hsm_instance_proposal + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::HsmManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new + + # Call the create_single_tenant_hsm_instance_proposal method. + result = client.create_single_tenant_hsm_instance_proposal request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstanceProposal_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/delete_single_tenant_hsm_instance_proposal.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/delete_single_tenant_hsm_instance_proposal.rb new file mode 100644 index 000000000000..21d71b99870d --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/delete_single_tenant_hsm_instance_proposal.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_HsmManagement_DeleteSingleTenantHsmInstanceProposal_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the delete_single_tenant_hsm_instance_proposal call in the HsmManagement service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::HsmManagement::Client#delete_single_tenant_hsm_instance_proposal. +# +def delete_single_tenant_hsm_instance_proposal + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::HsmManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new + + # Call the delete_single_tenant_hsm_instance_proposal method. + result = client.delete_single_tenant_hsm_instance_proposal request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudkms_v1_generated_HsmManagement_DeleteSingleTenantHsmInstanceProposal_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/execute_single_tenant_hsm_instance_proposal.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/execute_single_tenant_hsm_instance_proposal.rb new file mode 100644 index 000000000000..ead2fc3f2199 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/execute_single_tenant_hsm_instance_proposal.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_HsmManagement_ExecuteSingleTenantHsmInstanceProposal_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the execute_single_tenant_hsm_instance_proposal call in the HsmManagement service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal. +# +def execute_single_tenant_hsm_instance_proposal + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::HsmManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new + + # Call the execute_single_tenant_hsm_instance_proposal method. + result = client.execute_single_tenant_hsm_instance_proposal request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudkms_v1_generated_HsmManagement_ExecuteSingleTenantHsmInstanceProposal_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance.rb new file mode 100644 index 000000000000..c963d5607da0 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstance_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_single_tenant_hsm_instance call in the HsmManagement service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance. +# +def get_single_tenant_hsm_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::HsmManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new + + # Call the get_single_tenant_hsm_instance method. + result = client.get_single_tenant_hsm_instance request + + # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstance. + p result +end +# [END cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstance_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance_proposal.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance_proposal.rb new file mode 100644 index 000000000000..f89d87e097e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance_proposal.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstanceProposal_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_single_tenant_hsm_instance_proposal call in the HsmManagement service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance_proposal. +# +def get_single_tenant_hsm_instance_proposal + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::HsmManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new + + # Call the get_single_tenant_hsm_instance_proposal method. + result = client.get_single_tenant_hsm_instance_proposal request + + # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. + p result +end +# [END cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstanceProposal_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instance_proposals.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instance_proposals.rb new file mode 100644 index 000000000000..55a42124c7ef --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instance_proposals.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstanceProposals_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the list_single_tenant_hsm_instance_proposals call in the HsmManagement service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals. +# +def list_single_tenant_hsm_instance_proposals + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::HsmManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new + + # Call the list_single_tenant_hsm_instance_proposals method. + result = client.list_single_tenant_hsm_instance_proposals request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. + p item + end +end +# [END cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstanceProposals_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instances.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instances.rb new file mode 100644 index 000000000000..df085be0417e --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instances.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstances_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the list_single_tenant_hsm_instances call in the HsmManagement service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances. +# +def list_single_tenant_hsm_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::HsmManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new + + # Call the list_single_tenant_hsm_instances method. + result = client.list_single_tenant_hsm_instances request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstance. + p item + end +end +# [END cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstances_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb new file mode 100644 index 000000000000..0f3a0732da95 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_AsymmetricDecrypt_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the asymmetric_decrypt call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt. +# +def asymmetric_decrypt + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new + + # Call the asymmetric_decrypt method. + result = client.asymmetric_decrypt request + + # The returned object is of type Google::Cloud::Kms::V1::AsymmetricDecryptResponse. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_AsymmetricDecrypt_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb new file mode 100644 index 000000000000..01b0ff3723a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_AsymmetricSign_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the asymmetric_sign call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign. +# +def asymmetric_sign + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::AsymmetricSignRequest.new + + # Call the asymmetric_sign method. + result = client.asymmetric_sign request + + # The returned object is of type Google::Cloud::Kms::V1::AsymmetricSignResponse. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_AsymmetricSign_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb new file mode 100644 index 000000000000..ae957f4881e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_CreateCryptoKey_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the create_crypto_key call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key. +# +def create_crypto_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new + + # Call the create_crypto_key method. + result = client.create_crypto_key request + + # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_CreateCryptoKey_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb new file mode 100644 index 000000000000..46142b493c33 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_CreateCryptoKeyVersion_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the create_crypto_key_version call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version. +# +def create_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new + + # Call the create_crypto_key_version method. + result = client.create_crypto_key_version request + + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_CreateCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb new file mode 100644 index 000000000000..3e6695419037 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_CreateImportJob_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the create_import_job call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#create_import_job. +# +def create_import_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateImportJobRequest.new + + # Call the create_import_job method. + result = client.create_import_job request + + # The returned object is of type Google::Cloud::Kms::V1::ImportJob. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_CreateImportJob_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb new file mode 100644 index 000000000000..b575b8dc1ff7 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_CreateKeyRing_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the create_key_ring call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#create_key_ring. +# +def create_key_ring + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateKeyRingRequest.new + + # Call the create_key_ring method. + result = client.create_key_ring request + + # The returned object is of type Google::Cloud::Kms::V1::KeyRing. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_CreateKeyRing_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decapsulate.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decapsulate.rb new file mode 100644 index 000000000000..149baf282bb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decapsulate.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_Decapsulate_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the decapsulate call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate. +# +def decapsulate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::DecapsulateRequest.new + + # Call the decapsulate method. + result = client.decapsulate request + + # The returned object is of type Google::Cloud::Kms::V1::DecapsulateResponse. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_Decapsulate_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb new file mode 100644 index 000000000000..1e6504ccf66f --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_Decrypt_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the decrypt call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt. +# +def decrypt + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::DecryptRequest.new + + # Call the decrypt method. + result = client.decrypt request + + # The returned object is of type Google::Cloud::Kms::V1::DecryptResponse. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_Decrypt_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key.rb new file mode 100644 index 000000000000..f64d065ce5f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_DeleteCryptoKey_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the delete_crypto_key call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key. +# +def delete_crypto_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new + + # Call the delete_crypto_key method. + result = client.delete_crypto_key request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudkms_v1_generated_KeyManagementService_DeleteCryptoKey_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key_version.rb new file mode 100644 index 000000000000..f48c576d4553 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key_version.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_DeleteCryptoKeyVersion_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the delete_crypto_key_version call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version. +# +def delete_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new + + # Call the delete_crypto_key_version method. + result = client.delete_crypto_key_version request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudkms_v1_generated_KeyManagementService_DeleteCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb new file mode 100644 index 000000000000..94ebe1d38021 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_DestroyCryptoKeyVersion_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the destroy_crypto_key_version call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version. +# +def destroy_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new + + # Call the destroy_crypto_key_version method. + result = client.destroy_crypto_key_version request + + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_DestroyCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb new file mode 100644 index 000000000000..5a1ed5e33ba4 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_Encrypt_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the encrypt call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt. +# +def encrypt + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::EncryptRequest.new + + # Call the encrypt method. + result = client.encrypt request + + # The returned object is of type Google::Cloud::Kms::V1::EncryptResponse. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_Encrypt_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb new file mode 100644 index 000000000000..30b4a16192cb --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_GenerateRandomBytes_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the generate_random_bytes call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#generate_random_bytes. +# +def generate_random_bytes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new + + # Call the generate_random_bytes method. + result = client.generate_random_bytes request + + # The returned object is of type Google::Cloud::Kms::V1::GenerateRandomBytesResponse. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_GenerateRandomBytes_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb new file mode 100644 index 000000000000..2174b3dc805d --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_GetCryptoKey_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_crypto_key call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key. +# +def get_crypto_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetCryptoKeyRequest.new + + # Call the get_crypto_key method. + result = client.get_crypto_key request + + # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_GetCryptoKey_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb new file mode 100644 index 000000000000..a4a97d77248c --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_GetCryptoKeyVersion_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_crypto_key_version call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key_version. +# +def get_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new + + # Call the get_crypto_key_version method. + result = client.get_crypto_key_version request + + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_GetCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb new file mode 100644 index 000000000000..b639a6385621 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_GetImportJob_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_import_job call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#get_import_job. +# +def get_import_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetImportJobRequest.new + + # Call the get_import_job method. + result = client.get_import_job request + + # The returned object is of type Google::Cloud::Kms::V1::ImportJob. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_GetImportJob_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb new file mode 100644 index 000000000000..71ad0602045f --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_GetKeyRing_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_key_ring call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#get_key_ring. +# +def get_key_ring + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetKeyRingRequest.new + + # Call the get_key_ring method. + result = client.get_key_ring request + + # The returned object is of type Google::Cloud::Kms::V1::KeyRing. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_GetKeyRing_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb new file mode 100644 index 000000000000..7e8309a3e369 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_GetPublicKey_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_public_key call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key. +# +def get_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetPublicKeyRequest.new + + # Call the get_public_key method. + result = client.get_public_key request + + # The returned object is of type Google::Cloud::Kms::V1::PublicKey. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_GetPublicKey_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_retired_resource.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_retired_resource.rb new file mode 100644 index 000000000000..e97f6c246278 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_retired_resource.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_GetRetiredResource_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the get_retired_resource call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#get_retired_resource. +# +def get_retired_resource + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetRetiredResourceRequest.new + + # Call the get_retired_resource method. + result = client.get_retired_resource request + + # The returned object is of type Google::Cloud::Kms::V1::RetiredResource. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_GetRetiredResource_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb new file mode 100644 index 000000000000..d05ba0ef9746 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_ImportCryptoKeyVersion_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the import_crypto_key_version call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version. +# +def import_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new + + # Call the import_crypto_key_version method. + result = client.import_crypto_key_version request + + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_ImportCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb new file mode 100644 index 000000000000..5b9dc78c108b --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_ListCryptoKeyVersions_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the list_crypto_key_versions call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions. +# +def list_crypto_key_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new + + # Call the list_crypto_key_versions method. + result = client.list_crypto_key_versions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Kms::V1::CryptoKeyVersion. + p item + end +end +# [END cloudkms_v1_generated_KeyManagementService_ListCryptoKeyVersions_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb new file mode 100644 index 000000000000..4e7f54324c02 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_ListCryptoKeys_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the list_crypto_keys call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys. +# +def list_crypto_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListCryptoKeysRequest.new + + # Call the list_crypto_keys method. + result = client.list_crypto_keys request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Kms::V1::CryptoKey. + p item + end +end +# [END cloudkms_v1_generated_KeyManagementService_ListCryptoKeys_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb new file mode 100644 index 000000000000..b7cfa58bbb95 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_ListImportJobs_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the list_import_jobs call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#list_import_jobs. +# +def list_import_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListImportJobsRequest.new + + # Call the list_import_jobs method. + result = client.list_import_jobs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Kms::V1::ImportJob. + p item + end +end +# [END cloudkms_v1_generated_KeyManagementService_ListImportJobs_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb new file mode 100644 index 000000000000..c3665776e625 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_ListKeyRings_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the list_key_rings call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings. +# +def list_key_rings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListKeyRingsRequest.new + + # Call the list_key_rings method. + result = client.list_key_rings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Kms::V1::KeyRing. + p item + end +end +# [END cloudkms_v1_generated_KeyManagementService_ListKeyRings_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_retired_resources.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_retired_resources.rb new file mode 100644 index 000000000000..37b49670c788 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_retired_resources.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_ListRetiredResources_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the list_retired_resources call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources. +# +def list_retired_resources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new + + # Call the list_retired_resources method. + result = client.list_retired_resources request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Kms::V1::RetiredResource. + p item + end +end +# [END cloudkms_v1_generated_KeyManagementService_ListRetiredResources_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb new file mode 100644 index 000000000000..9d3718d85179 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_MacSign_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the mac_sign call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign. +# +def mac_sign + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::MacSignRequest.new + + # Call the mac_sign method. + result = client.mac_sign request + + # The returned object is of type Google::Cloud::Kms::V1::MacSignResponse. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_MacSign_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb new file mode 100644 index 000000000000..65a343b47ee8 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_MacVerify_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the mac_verify call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#mac_verify. +# +def mac_verify + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::MacVerifyRequest.new + + # Call the mac_verify method. + result = client.mac_verify request + + # The returned object is of type Google::Cloud::Kms::V1::MacVerifyResponse. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_MacVerify_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_decrypt.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_decrypt.rb new file mode 100644 index 000000000000..f54f0801674d --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_decrypt.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_RawDecrypt_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the raw_decrypt call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt. +# +def raw_decrypt + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::RawDecryptRequest.new + + # Call the raw_decrypt method. + result = client.raw_decrypt request + + # The returned object is of type Google::Cloud::Kms::V1::RawDecryptResponse. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_RawDecrypt_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_encrypt.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_encrypt.rb new file mode 100644 index 000000000000..1bdf56170b0f --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_encrypt.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_RawEncrypt_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the raw_encrypt call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt. +# +def raw_encrypt + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::RawEncryptRequest.new + + # Call the raw_encrypt method. + result = client.raw_encrypt request + + # The returned object is of type Google::Cloud::Kms::V1::RawEncryptResponse. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_RawEncrypt_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb new file mode 100644 index 000000000000..d0a409277146 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_RestoreCryptoKeyVersion_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the restore_crypto_key_version call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version. +# +def restore_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new + + # Call the restore_crypto_key_version method. + result = client.restore_crypto_key_version request + + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_RestoreCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb new file mode 100644 index 000000000000..6899ea887f88 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_UpdateCryptoKey_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the update_crypto_key call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key. +# +def update_crypto_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new + + # Call the update_crypto_key method. + result = client.update_crypto_key request + + # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKey_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb new file mode 100644 index 000000000000..b8fb6fa24b78 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the update_crypto_key_primary_version call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version. +# +def update_crypto_key_primary_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new + + # Call the update_crypto_key_primary_version method. + result = client.update_crypto_key_primary_version request + + # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb new file mode 100644 index 000000000000..e41e9f84cdd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyVersion_sync] +require "google/cloud/kms/v1" + +## +# Snippet for the update_crypto_key_version call in the KeyManagementService service +# +# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_version. +# +def update_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new + + # Call the update_crypto_key_version method. + result = client.update_crypto_key_version request + + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end +# [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json b/owl-bot-staging/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json new file mode 100644 index 000000000000..ee286d53d09d --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json @@ -0,0 +1,2215 @@ +{ + "client_library": { + "name": "google-cloud-kms-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.kms.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudkms_v1_generated_Autokey_CreateKeyHandle_sync", + "title": "Snippet for the create_key_handle call in the Autokey service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::Autokey::Client#create_key_handle.", + "file": "autokey/create_key_handle.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_key_handle", + "full_name": "::Google::Cloud::Kms::V1::Autokey::Client#create_key_handle", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::CreateKeyHandleRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Autokey::Client", + "full_name": "::Google::Cloud::Kms::V1::Autokey::Client" + }, + "method": { + "short_name": "CreateKeyHandle", + "full_name": "google.cloud.kms.v1.Autokey.CreateKeyHandle", + "service": { + "short_name": "Autokey", + "full_name": "google.cloud.kms.v1.Autokey" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_Autokey_GetKeyHandle_sync", + "title": "Snippet for the get_key_handle call in the Autokey service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::Autokey::Client#get_key_handle.", + "file": "autokey/get_key_handle.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_key_handle", + "full_name": "::Google::Cloud::Kms::V1::Autokey::Client#get_key_handle", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetKeyHandleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::KeyHandle", + "client": { + "short_name": "Autokey::Client", + "full_name": "::Google::Cloud::Kms::V1::Autokey::Client" + }, + "method": { + "short_name": "GetKeyHandle", + "full_name": "google.cloud.kms.v1.Autokey.GetKeyHandle", + "service": { + "short_name": "Autokey", + "full_name": "google.cloud.kms.v1.Autokey" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_Autokey_ListKeyHandles_sync", + "title": "Snippet for the list_key_handles call in the Autokey service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::Autokey::Client#list_key_handles.", + "file": "autokey/list_key_handles.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_key_handles", + "full_name": "::Google::Cloud::Kms::V1::Autokey::Client#list_key_handles", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ListKeyHandlesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ListKeyHandlesResponse", + "client": { + "short_name": "Autokey::Client", + "full_name": "::Google::Cloud::Kms::V1::Autokey::Client" + }, + "method": { + "short_name": "ListKeyHandles", + "full_name": "google.cloud.kms.v1.Autokey.ListKeyHandles", + "service": { + "short_name": "Autokey", + "full_name": "google.cloud.kms.v1.Autokey" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_AutokeyAdmin_UpdateAutokeyConfig_sync", + "title": "Snippet for the update_autokey_config call in the AutokeyAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config.", + "file": "autokey_admin/update_autokey_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_autokey_config", + "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::AutokeyConfig", + "client": { + "short_name": "AutokeyAdmin::Client", + "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client" + }, + "method": { + "short_name": "UpdateAutokeyConfig", + "full_name": "google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig", + "service": { + "short_name": "AutokeyAdmin", + "full_name": "google.cloud.kms.v1.AutokeyAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync", + "title": "Snippet for the get_autokey_config call in the AutokeyAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::AutokeyAdmin::Client#get_autokey_config.", + "file": "autokey_admin/get_autokey_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_autokey_config", + "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client#get_autokey_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetAutokeyConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::AutokeyConfig", + "client": { + "short_name": "AutokeyAdmin::Client", + "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client" + }, + "method": { + "short_name": "GetAutokeyConfig", + "full_name": "google.cloud.kms.v1.AutokeyAdmin.GetAutokeyConfig", + "service": { + "short_name": "AutokeyAdmin", + "full_name": "google.cloud.kms.v1.AutokeyAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_AutokeyAdmin_ShowEffectiveAutokeyConfig_sync", + "title": "Snippet for the show_effective_autokey_config call in the AutokeyAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config.", + "file": "autokey_admin/show_effective_autokey_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "show_effective_autokey_config", + "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse", + "client": { + "short_name": "AutokeyAdmin::Client", + "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client" + }, + "method": { + "short_name": "ShowEffectiveAutokeyConfig", + "full_name": "google.cloud.kms.v1.AutokeyAdmin.ShowEffectiveAutokeyConfig", + "service": { + "short_name": "AutokeyAdmin", + "full_name": "google.cloud.kms.v1.AutokeyAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_EkmService_ListEkmConnections_sync", + "title": "Snippet for the list_ekm_connections call in the EkmService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#list_ekm_connections.", + "file": "ekm_service/list_ekm_connections.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_ekm_connections", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#list_ekm_connections", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ListEkmConnectionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ListEkmConnectionsResponse", + "client": { + "short_name": "EkmService::Client", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" + }, + "method": { + "short_name": "ListEkmConnections", + "full_name": "google.cloud.kms.v1.EkmService.ListEkmConnections", + "service": { + "short_name": "EkmService", + "full_name": "google.cloud.kms.v1.EkmService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_EkmService_GetEkmConnection_sync", + "title": "Snippet for the get_ekm_connection call in the EkmService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#get_ekm_connection.", + "file": "ekm_service/get_ekm_connection.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_ekm_connection", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#get_ekm_connection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetEkmConnectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::EkmConnection", + "client": { + "short_name": "EkmService::Client", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" + }, + "method": { + "short_name": "GetEkmConnection", + "full_name": "google.cloud.kms.v1.EkmService.GetEkmConnection", + "service": { + "short_name": "EkmService", + "full_name": "google.cloud.kms.v1.EkmService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_EkmService_CreateEkmConnection_sync", + "title": "Snippet for the create_ekm_connection call in the EkmService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#create_ekm_connection.", + "file": "ekm_service/create_ekm_connection.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_ekm_connection", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#create_ekm_connection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::CreateEkmConnectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::EkmConnection", + "client": { + "short_name": "EkmService::Client", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" + }, + "method": { + "short_name": "CreateEkmConnection", + "full_name": "google.cloud.kms.v1.EkmService.CreateEkmConnection", + "service": { + "short_name": "EkmService", + "full_name": "google.cloud.kms.v1.EkmService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_EkmService_UpdateEkmConnection_sync", + "title": "Snippet for the update_ekm_connection call in the EkmService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#update_ekm_connection.", + "file": "ekm_service/update_ekm_connection.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_ekm_connection", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#update_ekm_connection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::EkmConnection", + "client": { + "short_name": "EkmService::Client", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" + }, + "method": { + "short_name": "UpdateEkmConnection", + "full_name": "google.cloud.kms.v1.EkmService.UpdateEkmConnection", + "service": { + "short_name": "EkmService", + "full_name": "google.cloud.kms.v1.EkmService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_EkmService_GetEkmConfig_sync", + "title": "Snippet for the get_ekm_config call in the EkmService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#get_ekm_config.", + "file": "ekm_service/get_ekm_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_ekm_config", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#get_ekm_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetEkmConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::EkmConfig", + "client": { + "short_name": "EkmService::Client", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" + }, + "method": { + "short_name": "GetEkmConfig", + "full_name": "google.cloud.kms.v1.EkmService.GetEkmConfig", + "service": { + "short_name": "EkmService", + "full_name": "google.cloud.kms.v1.EkmService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_EkmService_UpdateEkmConfig_sync", + "title": "Snippet for the update_ekm_config call in the EkmService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#update_ekm_config.", + "file": "ekm_service/update_ekm_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_ekm_config", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#update_ekm_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::UpdateEkmConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::EkmConfig", + "client": { + "short_name": "EkmService::Client", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" + }, + "method": { + "short_name": "UpdateEkmConfig", + "full_name": "google.cloud.kms.v1.EkmService.UpdateEkmConfig", + "service": { + "short_name": "EkmService", + "full_name": "google.cloud.kms.v1.EkmService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_EkmService_VerifyConnectivity_sync", + "title": "Snippet for the verify_connectivity call in the EkmService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#verify_connectivity.", + "file": "ekm_service/verify_connectivity.rb", + "language": "RUBY", + "client_method": { + "short_name": "verify_connectivity", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#verify_connectivity", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::VerifyConnectivityRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::VerifyConnectivityResponse", + "client": { + "short_name": "EkmService::Client", + "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" + }, + "method": { + "short_name": "VerifyConnectivity", + "full_name": "google.cloud.kms.v1.EkmService.VerifyConnectivity", + "service": { + "short_name": "EkmService", + "full_name": "google.cloud.kms.v1.EkmService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstances_sync", + "title": "Snippet for the list_single_tenant_hsm_instances call in the HsmManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances.", + "file": "hsm_management/list_single_tenant_hsm_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_single_tenant_hsm_instances", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse", + "client": { + "short_name": "HsmManagement::Client", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" + }, + "method": { + "short_name": "ListSingleTenantHsmInstances", + "full_name": "google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstances", + "service": { + "short_name": "HsmManagement", + "full_name": "google.cloud.kms.v1.HsmManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstance_sync", + "title": "Snippet for the get_single_tenant_hsm_instance call in the HsmManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance.", + "file": "hsm_management/get_single_tenant_hsm_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_single_tenant_hsm_instance", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::SingleTenantHsmInstance", + "client": { + "short_name": "HsmManagement::Client", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" + }, + "method": { + "short_name": "GetSingleTenantHsmInstance", + "full_name": "google.cloud.kms.v1.HsmManagement.GetSingleTenantHsmInstance", + "service": { + "short_name": "HsmManagement", + "full_name": "google.cloud.kms.v1.HsmManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstance_sync", + "title": "Snippet for the create_single_tenant_hsm_instance call in the HsmManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance.", + "file": "hsm_management/create_single_tenant_hsm_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_single_tenant_hsm_instance", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "HsmManagement::Client", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" + }, + "method": { + "short_name": "CreateSingleTenantHsmInstance", + "full_name": "google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstance", + "service": { + "short_name": "HsmManagement", + "full_name": "google.cloud.kms.v1.HsmManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstanceProposal_sync", + "title": "Snippet for the create_single_tenant_hsm_instance_proposal call in the HsmManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal.", + "file": "hsm_management/create_single_tenant_hsm_instance_proposal.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_single_tenant_hsm_instance_proposal", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "HsmManagement::Client", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" + }, + "method": { + "short_name": "CreateSingleTenantHsmInstanceProposal", + "full_name": "google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstanceProposal", + "service": { + "short_name": "HsmManagement", + "full_name": "google.cloud.kms.v1.HsmManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_HsmManagement_ApproveSingleTenantHsmInstanceProposal_sync", + "title": "Snippet for the approve_single_tenant_hsm_instance_proposal call in the HsmManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#approve_single_tenant_hsm_instance_proposal.", + "file": "hsm_management/approve_single_tenant_hsm_instance_proposal.rb", + "language": "RUBY", + "client_method": { + "short_name": "approve_single_tenant_hsm_instance_proposal", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#approve_single_tenant_hsm_instance_proposal", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse", + "client": { + "short_name": "HsmManagement::Client", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" + }, + "method": { + "short_name": "ApproveSingleTenantHsmInstanceProposal", + "full_name": "google.cloud.kms.v1.HsmManagement.ApproveSingleTenantHsmInstanceProposal", + "service": { + "short_name": "HsmManagement", + "full_name": "google.cloud.kms.v1.HsmManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_HsmManagement_ExecuteSingleTenantHsmInstanceProposal_sync", + "title": "Snippet for the execute_single_tenant_hsm_instance_proposal call in the HsmManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal.", + "file": "hsm_management/execute_single_tenant_hsm_instance_proposal.rb", + "language": "RUBY", + "client_method": { + "short_name": "execute_single_tenant_hsm_instance_proposal", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "HsmManagement::Client", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" + }, + "method": { + "short_name": "ExecuteSingleTenantHsmInstanceProposal", + "full_name": "google.cloud.kms.v1.HsmManagement.ExecuteSingleTenantHsmInstanceProposal", + "service": { + "short_name": "HsmManagement", + "full_name": "google.cloud.kms.v1.HsmManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstanceProposal_sync", + "title": "Snippet for the get_single_tenant_hsm_instance_proposal call in the HsmManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance_proposal.", + "file": "hsm_management/get_single_tenant_hsm_instance_proposal.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_single_tenant_hsm_instance_proposal", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance_proposal", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal", + "client": { + "short_name": "HsmManagement::Client", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" + }, + "method": { + "short_name": "GetSingleTenantHsmInstanceProposal", + "full_name": "google.cloud.kms.v1.HsmManagement.GetSingleTenantHsmInstanceProposal", + "service": { + "short_name": "HsmManagement", + "full_name": "google.cloud.kms.v1.HsmManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstanceProposals_sync", + "title": "Snippet for the list_single_tenant_hsm_instance_proposals call in the HsmManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals.", + "file": "hsm_management/list_single_tenant_hsm_instance_proposals.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_single_tenant_hsm_instance_proposals", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse", + "client": { + "short_name": "HsmManagement::Client", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" + }, + "method": { + "short_name": "ListSingleTenantHsmInstanceProposals", + "full_name": "google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstanceProposals", + "service": { + "short_name": "HsmManagement", + "full_name": "google.cloud.kms.v1.HsmManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_HsmManagement_DeleteSingleTenantHsmInstanceProposal_sync", + "title": "Snippet for the delete_single_tenant_hsm_instance_proposal call in the HsmManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#delete_single_tenant_hsm_instance_proposal.", + "file": "hsm_management/delete_single_tenant_hsm_instance_proposal.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_single_tenant_hsm_instance_proposal", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#delete_single_tenant_hsm_instance_proposal", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "HsmManagement::Client", + "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" + }, + "method": { + "short_name": "DeleteSingleTenantHsmInstanceProposal", + "full_name": "google.cloud.kms.v1.HsmManagement.DeleteSingleTenantHsmInstanceProposal", + "service": { + "short_name": "HsmManagement", + "full_name": "google.cloud.kms.v1.HsmManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_ListKeyRings_sync", + "title": "Snippet for the list_key_rings call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings.", + "file": "key_management_service/list_key_rings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_key_rings", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ListKeyRingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ListKeyRingsResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "ListKeyRings", + "full_name": "google.cloud.kms.v1.KeyManagementService.ListKeyRings", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_ListCryptoKeys_sync", + "title": "Snippet for the list_crypto_keys call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys.", + "file": "key_management_service/list_crypto_keys.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_crypto_keys", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ListCryptoKeysRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ListCryptoKeysResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "ListCryptoKeys", + "full_name": "google.cloud.kms.v1.KeyManagementService.ListCryptoKeys", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_ListCryptoKeyVersions_sync", + "title": "Snippet for the list_crypto_key_versions call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions.", + "file": "key_management_service/list_crypto_key_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_crypto_key_versions", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "ListCryptoKeyVersions", + "full_name": "google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersions", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_ListImportJobs_sync", + "title": "Snippet for the list_import_jobs call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#list_import_jobs.", + "file": "key_management_service/list_import_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_import_jobs", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#list_import_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ListImportJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ListImportJobsResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "ListImportJobs", + "full_name": "google.cloud.kms.v1.KeyManagementService.ListImportJobs", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_ListRetiredResources_sync", + "title": "Snippet for the list_retired_resources call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources.", + "file": "key_management_service/list_retired_resources.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_retired_resources", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ListRetiredResourcesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ListRetiredResourcesResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "ListRetiredResources", + "full_name": "google.cloud.kms.v1.KeyManagementService.ListRetiredResources", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_GetKeyRing_sync", + "title": "Snippet for the get_key_ring call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_key_ring.", + "file": "key_management_service/get_key_ring.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_key_ring", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_key_ring", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetKeyRingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::KeyRing", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "GetKeyRing", + "full_name": "google.cloud.kms.v1.KeyManagementService.GetKeyRing", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_GetCryptoKey_sync", + "title": "Snippet for the get_crypto_key call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key.", + "file": "key_management_service/get_crypto_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_crypto_key", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetCryptoKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::CryptoKey", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "GetCryptoKey", + "full_name": "google.cloud.kms.v1.KeyManagementService.GetCryptoKey", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_GetCryptoKeyVersion_sync", + "title": "Snippet for the get_crypto_key_version call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key_version.", + "file": "key_management_service/get_crypto_key_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_crypto_key_version", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "GetCryptoKeyVersion", + "full_name": "google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersion", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_GetPublicKey_sync", + "title": "Snippet for the get_public_key call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key.", + "file": "key_management_service/get_public_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_public_key", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetPublicKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::PublicKey", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "GetPublicKey", + "full_name": "google.cloud.kms.v1.KeyManagementService.GetPublicKey", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_GetImportJob_sync", + "title": "Snippet for the get_import_job call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_import_job.", + "file": "key_management_service/get_import_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_import_job", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_import_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetImportJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ImportJob", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "GetImportJob", + "full_name": "google.cloud.kms.v1.KeyManagementService.GetImportJob", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_GetRetiredResource_sync", + "title": "Snippet for the get_retired_resource call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_retired_resource.", + "file": "key_management_service/get_retired_resource.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_retired_resource", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_retired_resource", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetRetiredResourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::RetiredResource", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "GetRetiredResource", + "full_name": "google.cloud.kms.v1.KeyManagementService.GetRetiredResource", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_CreateKeyRing_sync", + "title": "Snippet for the create_key_ring call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#create_key_ring.", + "file": "key_management_service/create_key_ring.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_key_ring", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#create_key_ring", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::CreateKeyRingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::KeyRing", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "CreateKeyRing", + "full_name": "google.cloud.kms.v1.KeyManagementService.CreateKeyRing", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_CreateCryptoKey_sync", + "title": "Snippet for the create_crypto_key call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key.", + "file": "key_management_service/create_crypto_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_crypto_key", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::CreateCryptoKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::CryptoKey", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "CreateCryptoKey", + "full_name": "google.cloud.kms.v1.KeyManagementService.CreateCryptoKey", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_CreateCryptoKeyVersion_sync", + "title": "Snippet for the create_crypto_key_version call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version.", + "file": "key_management_service/create_crypto_key_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_crypto_key_version", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "CreateCryptoKeyVersion", + "full_name": "google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_DeleteCryptoKey_sync", + "title": "Snippet for the delete_crypto_key call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key.", + "file": "key_management_service/delete_crypto_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_crypto_key", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "DeleteCryptoKey", + "full_name": "google.cloud.kms.v1.KeyManagementService.DeleteCryptoKey", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_DeleteCryptoKeyVersion_sync", + "title": "Snippet for the delete_crypto_key_version call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version.", + "file": "key_management_service/delete_crypto_key_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_crypto_key_version", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "DeleteCryptoKeyVersion", + "full_name": "google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_ImportCryptoKeyVersion_sync", + "title": "Snippet for the import_crypto_key_version call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version.", + "file": "key_management_service/import_crypto_key_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_crypto_key_version", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "ImportCryptoKeyVersion", + "full_name": "google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_CreateImportJob_sync", + "title": "Snippet for the create_import_job call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#create_import_job.", + "file": "key_management_service/create_import_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_import_job", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#create_import_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::CreateImportJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ImportJob", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "CreateImportJob", + "full_name": "google.cloud.kms.v1.KeyManagementService.CreateImportJob", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_UpdateCryptoKey_sync", + "title": "Snippet for the update_crypto_key call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key.", + "file": "key_management_service/update_crypto_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_crypto_key", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::CryptoKey", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "UpdateCryptoKey", + "full_name": "google.cloud.kms.v1.KeyManagementService.UpdateCryptoKey", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyVersion_sync", + "title": "Snippet for the update_crypto_key_version call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_version.", + "file": "key_management_service/update_crypto_key_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_crypto_key_version", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "UpdateCryptoKeyVersion", + "full_name": "google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyVersion", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync", + "title": "Snippet for the update_crypto_key_primary_version call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version.", + "file": "key_management_service/update_crypto_key_primary_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_crypto_key_primary_version", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::CryptoKey", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "UpdateCryptoKeyPrimaryVersion", + "full_name": "google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_DestroyCryptoKeyVersion_sync", + "title": "Snippet for the destroy_crypto_key_version call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version.", + "file": "key_management_service/destroy_crypto_key_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "destroy_crypto_key_version", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "DestroyCryptoKeyVersion", + "full_name": "google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_RestoreCryptoKeyVersion_sync", + "title": "Snippet for the restore_crypto_key_version call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version.", + "file": "key_management_service/restore_crypto_key_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_crypto_key_version", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "RestoreCryptoKeyVersion", + "full_name": "google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_Encrypt_sync", + "title": "Snippet for the encrypt call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt.", + "file": "key_management_service/encrypt.rb", + "language": "RUBY", + "client_method": { + "short_name": "encrypt", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::EncryptRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::EncryptResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "Encrypt", + "full_name": "google.cloud.kms.v1.KeyManagementService.Encrypt", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_Decrypt_sync", + "title": "Snippet for the decrypt call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt.", + "file": "key_management_service/decrypt.rb", + "language": "RUBY", + "client_method": { + "short_name": "decrypt", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::DecryptRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::DecryptResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "Decrypt", + "full_name": "google.cloud.kms.v1.KeyManagementService.Decrypt", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_RawEncrypt_sync", + "title": "Snippet for the raw_encrypt call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt.", + "file": "key_management_service/raw_encrypt.rb", + "language": "RUBY", + "client_method": { + "short_name": "raw_encrypt", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::RawEncryptRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::RawEncryptResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "RawEncrypt", + "full_name": "google.cloud.kms.v1.KeyManagementService.RawEncrypt", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_RawDecrypt_sync", + "title": "Snippet for the raw_decrypt call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt.", + "file": "key_management_service/raw_decrypt.rb", + "language": "RUBY", + "client_method": { + "short_name": "raw_decrypt", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::RawDecryptRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::RawDecryptResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "RawDecrypt", + "full_name": "google.cloud.kms.v1.KeyManagementService.RawDecrypt", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_AsymmetricSign_sync", + "title": "Snippet for the asymmetric_sign call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign.", + "file": "key_management_service/asymmetric_sign.rb", + "language": "RUBY", + "client_method": { + "short_name": "asymmetric_sign", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::AsymmetricSignRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::AsymmetricSignResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "AsymmetricSign", + "full_name": "google.cloud.kms.v1.KeyManagementService.AsymmetricSign", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_AsymmetricDecrypt_sync", + "title": "Snippet for the asymmetric_decrypt call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt.", + "file": "key_management_service/asymmetric_decrypt.rb", + "language": "RUBY", + "client_method": { + "short_name": "asymmetric_decrypt", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::AsymmetricDecryptRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::AsymmetricDecryptResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "AsymmetricDecrypt", + "full_name": "google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_MacSign_sync", + "title": "Snippet for the mac_sign call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign.", + "file": "key_management_service/mac_sign.rb", + "language": "RUBY", + "client_method": { + "short_name": "mac_sign", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::MacSignRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::MacSignResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "MacSign", + "full_name": "google.cloud.kms.v1.KeyManagementService.MacSign", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_MacVerify_sync", + "title": "Snippet for the mac_verify call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#mac_verify.", + "file": "key_management_service/mac_verify.rb", + "language": "RUBY", + "client_method": { + "short_name": "mac_verify", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_verify", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::MacVerifyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::MacVerifyResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "MacVerify", + "full_name": "google.cloud.kms.v1.KeyManagementService.MacVerify", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_Decapsulate_sync", + "title": "Snippet for the decapsulate call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate.", + "file": "key_management_service/decapsulate.rb", + "language": "RUBY", + "client_method": { + "short_name": "decapsulate", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::DecapsulateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::DecapsulateResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "Decapsulate", + "full_name": "google.cloud.kms.v1.KeyManagementService.Decapsulate", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_GenerateRandomBytes_sync", + "title": "Snippet for the generate_random_bytes call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#generate_random_bytes.", + "file": "key_management_service/generate_random_bytes.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_random_bytes", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#generate_random_bytes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GenerateRandomBytesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::GenerateRandomBytesResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "GenerateRandomBytes", + "full_name": "google.cloud.kms.v1.KeyManagementService.GenerateRandomBytes", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_paths_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_paths_test.rb new file mode 100644 index 000000000000..0515bb01330e --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/autokey_admin" + +class ::Google::Cloud::Kms::V1::AutokeyAdmin::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_autokey_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.autokey_config_path folder: "value0" + assert_equal "folders/value0/autokeyConfig", path + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_rest_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_rest_test.rb new file mode 100644 index 000000000000..7817898e9446 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_rest_test.rb @@ -0,0 +1,262 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/kms/v1/autokey_admin_pb" +require "google/cloud/kms/v1/autokey_admin/rest" + + +class ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_update_autokey_config + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::AutokeyConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + autokey_config = {} + update_mask = {} + + update_autokey_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::ServiceStub.stub :transcode_update_autokey_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_autokey_config_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_autokey_config({ autokey_config: autokey_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_autokey_config autokey_config: autokey_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_autokey_config ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new(autokey_config: autokey_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_autokey_config({ autokey_config: autokey_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_autokey_config(::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new(autokey_config: autokey_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_autokey_config_client_stub.call_count + end + end + end + + def test_get_autokey_config + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::AutokeyConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_autokey_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::ServiceStub.stub :transcode_get_autokey_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_autokey_config_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_autokey_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_autokey_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_autokey_config ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_autokey_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_autokey_config(::Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_autokey_config_client_stub.call_count + end + end + end + + def test_show_effective_autokey_config + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + show_effective_autokey_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::ServiceStub.stub :transcode_show_effective_autokey_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, show_effective_autokey_config_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.show_effective_autokey_config({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.show_effective_autokey_config parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.show_effective_autokey_config ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.show_effective_autokey_config({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.show_effective_autokey_config(::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, show_effective_autokey_config_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_test.rb new file mode 100644 index 000000000000..2261dc12af95 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_test.rb @@ -0,0 +1,280 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/autokey_admin_pb" +require "google/cloud/kms/v1/autokey_admin" + +class ::Google::Cloud::Kms::V1::AutokeyAdmin::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_update_autokey_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::AutokeyConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + autokey_config = {} + update_mask = {} + + update_autokey_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_autokey_config, name + assert_kind_of ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::AutokeyConfig), request["autokey_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_autokey_config_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_autokey_config({ autokey_config: autokey_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_autokey_config autokey_config: autokey_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_autokey_config ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new(autokey_config: autokey_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_autokey_config({ autokey_config: autokey_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_autokey_config(::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new(autokey_config: autokey_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_autokey_config_client_stub.call_rpc_count + end + end + + def test_get_autokey_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::AutokeyConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_autokey_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_autokey_config, name + assert_kind_of ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_autokey_config_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_autokey_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_autokey_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_autokey_config ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_autokey_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_autokey_config(::Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_autokey_config_client_stub.call_rpc_count + end + end + + def test_show_effective_autokey_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + show_effective_autokey_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :show_effective_autokey_config, name + assert_kind_of ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, show_effective_autokey_config_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.show_effective_autokey_config({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.show_effective_autokey_config parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.show_effective_autokey_config ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.show_effective_autokey_config({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.show_effective_autokey_config(::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new(parent: parent), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, show_effective_autokey_config_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::AutokeyAdmin::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Kms::V1::AutokeyAdmin::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_operations_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_operations_test.rb new file mode 100644 index 000000000000..6fa64dd74514 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/autokey_pb" +require "google/cloud/kms/v1/autokey_services_pb" +require "google/cloud/kms/v1/autokey" + +class ::Google::Cloud::Kms::V1::Autokey::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::Autokey::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_paths_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_paths_test.rb new file mode 100644 index 000000000000..15fcba8550f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/autokey" + +class ::Google::Cloud::Kms::V1::Autokey::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_key_handle_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.key_handle_path project: "value0", location: "value1", key_handle: "value2" + assert_equal "projects/value0/locations/value1/keyHandles/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_rest_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_rest_test.rb new file mode 100644 index 000000000000..46fd4448816b --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_rest_test.rb @@ -0,0 +1,266 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/kms/v1/autokey_pb" +require "google/cloud/kms/v1/autokey/rest" + + +class ::Google::Cloud::Kms::V1::Autokey::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_key_handle + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + key_handle_id = "hello world" + key_handle = {} + + create_key_handle_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::Autokey::Rest::ServiceStub.stub :transcode_create_key_handle_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_key_handle_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_key_handle({ parent: parent, key_handle_id: key_handle_id, key_handle: key_handle }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_key_handle parent: parent, key_handle_id: key_handle_id, key_handle: key_handle do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_key_handle ::Google::Cloud::Kms::V1::CreateKeyHandleRequest.new(parent: parent, key_handle_id: key_handle_id, key_handle: key_handle) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_key_handle({ parent: parent, key_handle_id: key_handle_id, key_handle: key_handle }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_key_handle(::Google::Cloud::Kms::V1::CreateKeyHandleRequest.new(parent: parent, key_handle_id: key_handle_id, key_handle: key_handle), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_key_handle_client_stub.call_count + end + end + end + + def test_get_key_handle + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::KeyHandle.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_key_handle_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::Autokey::Rest::ServiceStub.stub :transcode_get_key_handle_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_key_handle_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_key_handle({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_key_handle name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_key_handle ::Google::Cloud::Kms::V1::GetKeyHandleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_key_handle({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_key_handle(::Google::Cloud::Kms::V1::GetKeyHandleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_key_handle_client_stub.call_count + end + end + end + + def test_list_key_handles + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ListKeyHandlesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_key_handles_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::Autokey::Rest::ServiceStub.stub :transcode_list_key_handles_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_key_handles_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_key_handles({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_key_handles parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_key_handles ::Google::Cloud::Kms::V1::ListKeyHandlesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_key_handles({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_key_handles(::Google::Cloud::Kms::V1::ListKeyHandlesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_key_handles_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::Autokey::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_test.rb new file mode 100644 index 000000000000..9078f4afd48d --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_test.rb @@ -0,0 +1,312 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/autokey_pb" +require "google/cloud/kms/v1/autokey" + +class ::Google::Cloud::Kms::V1::Autokey::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_key_handle + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + key_handle_id = "hello world" + key_handle = {} + + create_key_handle_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_key_handle, name + assert_kind_of ::Google::Cloud::Kms::V1::CreateKeyHandleRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["key_handle_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::KeyHandle), request["key_handle"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_key_handle_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_key_handle({ parent: parent, key_handle_id: key_handle_id, key_handle: key_handle }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_key_handle parent: parent, key_handle_id: key_handle_id, key_handle: key_handle do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_key_handle ::Google::Cloud::Kms::V1::CreateKeyHandleRequest.new(parent: parent, key_handle_id: key_handle_id, key_handle: key_handle) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_key_handle({ parent: parent, key_handle_id: key_handle_id, key_handle: key_handle }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_key_handle(::Google::Cloud::Kms::V1::CreateKeyHandleRequest.new(parent: parent, key_handle_id: key_handle_id, key_handle: key_handle), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_key_handle_client_stub.call_rpc_count + end + end + + def test_get_key_handle + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::KeyHandle.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_key_handle_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_key_handle, name + assert_kind_of ::Google::Cloud::Kms::V1::GetKeyHandleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_key_handle_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_key_handle({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_key_handle name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_key_handle ::Google::Cloud::Kms::V1::GetKeyHandleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_key_handle({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_key_handle(::Google::Cloud::Kms::V1::GetKeyHandleRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_key_handle_client_stub.call_rpc_count + end + end + + def test_list_key_handles + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ListKeyHandlesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_key_handles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_key_handles, name + assert_kind_of ::Google::Cloud::Kms::V1::ListKeyHandlesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_key_handles_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_key_handles({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_key_handles parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_key_handles ::Google::Cloud::Kms::V1::ListKeyHandlesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_key_handles({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_key_handles(::Google::Cloud::Kms::V1::ListKeyHandlesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_key_handles_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::Autokey::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Kms::V1::Autokey::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Kms::V1::Autokey::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb new file mode 100644 index 000000000000..17d9d7b401c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/ekm_service" + +class ::Google::Cloud::Kms::V1::EkmService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_ekm_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.ekm_config_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/ekmConfig", path + end + end + + def test_ekm_connection_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.ekm_connection_path project: "value0", location: "value1", ekm_connection: "value2" + assert_equal "projects/value0/locations/value1/ekmConnections/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" + assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb new file mode 100644 index 000000000000..75d141e73f4f --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb @@ -0,0 +1,485 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/kms/v1/ekm_service_pb" +require "google/cloud/kms/v1/ekm_service/rest" + + +class ::Google::Cloud::Kms::V1::EkmService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_ekm_connections + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ListEkmConnectionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_ekm_connections_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_list_ekm_connections_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_ekm_connections_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_ekm_connections({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_ekm_connections parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_ekm_connections ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_ekm_connections({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_ekm_connections(::Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_ekm_connections_client_stub.call_count + end + end + end + + def test_get_ekm_connection + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::EkmConnection.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_ekm_connection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_get_ekm_connection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_ekm_connection_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_ekm_connection({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_ekm_connection name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_ekm_connection ::Google::Cloud::Kms::V1::GetEkmConnectionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_ekm_connection({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_ekm_connection(::Google::Cloud::Kms::V1::GetEkmConnectionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_ekm_connection_client_stub.call_count + end + end + end + + def test_create_ekm_connection + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::EkmConnection.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + ekm_connection_id = "hello world" + ekm_connection = {} + + create_ekm_connection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_create_ekm_connection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_ekm_connection_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_ekm_connection({ parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_ekm_connection parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_ekm_connection ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new(parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_ekm_connection({ parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_ekm_connection(::Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new(parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_ekm_connection_client_stub.call_count + end + end + end + + def test_update_ekm_connection + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::EkmConnection.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + ekm_connection = {} + update_mask = {} + + update_ekm_connection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_update_ekm_connection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_ekm_connection_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_ekm_connection({ ekm_connection: ekm_connection, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_ekm_connection ekm_connection: ekm_connection, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_ekm_connection ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new(ekm_connection: ekm_connection, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_ekm_connection({ ekm_connection: ekm_connection, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_ekm_connection(::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new(ekm_connection: ekm_connection, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_ekm_connection_client_stub.call_count + end + end + end + + def test_get_ekm_config + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::EkmConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_ekm_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_get_ekm_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_ekm_config_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_ekm_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_ekm_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_ekm_config ::Google::Cloud::Kms::V1::GetEkmConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_ekm_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_ekm_config(::Google::Cloud::Kms::V1::GetEkmConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_ekm_config_client_stub.call_count + end + end + end + + def test_update_ekm_config + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::EkmConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + ekm_config = {} + update_mask = {} + + update_ekm_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_update_ekm_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_ekm_config_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_ekm_config({ ekm_config: ekm_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_ekm_config ekm_config: ekm_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_ekm_config ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new(ekm_config: ekm_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_ekm_config({ ekm_config: ekm_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_ekm_config(::Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new(ekm_config: ekm_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_ekm_config_client_stub.call_count + end + end + end + + def test_verify_connectivity + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::VerifyConnectivityResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + verify_connectivity_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_verify_connectivity_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, verify_connectivity_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.verify_connectivity({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.verify_connectivity name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.verify_connectivity ::Google::Cloud::Kms::V1::VerifyConnectivityRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.verify_connectivity({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.verify_connectivity(::Google::Cloud::Kms::V1::VerifyConnectivityRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, verify_connectivity_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::EkmService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb new file mode 100644 index 000000000000..8d6b3e9152f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb @@ -0,0 +1,531 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/ekm_service_pb" +require "google/cloud/kms/v1/ekm_service" + +class ::Google::Cloud::Kms::V1::EkmService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_ekm_connections + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ListEkmConnectionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_ekm_connections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_ekm_connections, name + assert_kind_of ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_ekm_connections_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_ekm_connections({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_ekm_connections parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_ekm_connections ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_ekm_connections({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_ekm_connections(::Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_ekm_connections_client_stub.call_rpc_count + end + end + + def test_get_ekm_connection + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::EkmConnection.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_ekm_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_ekm_connection, name + assert_kind_of ::Google::Cloud::Kms::V1::GetEkmConnectionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_ekm_connection_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_ekm_connection({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_ekm_connection name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_ekm_connection ::Google::Cloud::Kms::V1::GetEkmConnectionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_ekm_connection({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_ekm_connection(::Google::Cloud::Kms::V1::GetEkmConnectionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_ekm_connection_client_stub.call_rpc_count + end + end + + def test_create_ekm_connection + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::EkmConnection.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + ekm_connection_id = "hello world" + ekm_connection = {} + + create_ekm_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_ekm_connection, name + assert_kind_of ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["ekm_connection_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::EkmConnection), request["ekm_connection"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_ekm_connection_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_ekm_connection({ parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_ekm_connection parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_ekm_connection ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new(parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_ekm_connection({ parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_ekm_connection(::Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new(parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_ekm_connection_client_stub.call_rpc_count + end + end + + def test_update_ekm_connection + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::EkmConnection.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + ekm_connection = {} + update_mask = {} + + update_ekm_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_ekm_connection, name + assert_kind_of ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::EkmConnection), request["ekm_connection"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_ekm_connection_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_ekm_connection({ ekm_connection: ekm_connection, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_ekm_connection ekm_connection: ekm_connection, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_ekm_connection ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new(ekm_connection: ekm_connection, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_ekm_connection({ ekm_connection: ekm_connection, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_ekm_connection(::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new(ekm_connection: ekm_connection, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_ekm_connection_client_stub.call_rpc_count + end + end + + def test_get_ekm_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::EkmConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_ekm_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_ekm_config, name + assert_kind_of ::Google::Cloud::Kms::V1::GetEkmConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_ekm_config_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_ekm_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_ekm_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_ekm_config ::Google::Cloud::Kms::V1::GetEkmConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_ekm_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_ekm_config(::Google::Cloud::Kms::V1::GetEkmConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_ekm_config_client_stub.call_rpc_count + end + end + + def test_update_ekm_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::EkmConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + ekm_config = {} + update_mask = {} + + update_ekm_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_ekm_config, name + assert_kind_of ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::EkmConfig), request["ekm_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_ekm_config_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_ekm_config({ ekm_config: ekm_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_ekm_config ekm_config: ekm_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_ekm_config ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new(ekm_config: ekm_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_ekm_config({ ekm_config: ekm_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_ekm_config(::Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new(ekm_config: ekm_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_ekm_config_client_stub.call_rpc_count + end + end + + def test_verify_connectivity + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::VerifyConnectivityResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + verify_connectivity_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :verify_connectivity, name + assert_kind_of ::Google::Cloud::Kms::V1::VerifyConnectivityRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, verify_connectivity_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.verify_connectivity({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.verify_connectivity name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.verify_connectivity ::Google::Cloud::Kms::V1::VerifyConnectivityRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.verify_connectivity({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.verify_connectivity(::Google::Cloud::Kms::V1::VerifyConnectivityRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, verify_connectivity_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::EkmService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Kms::V1::EkmService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_operations_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_operations_test.rb new file mode 100644 index 000000000000..dc9c54502ebc --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/hsm_management_pb" +require "google/cloud/kms/v1/hsm_management_services_pb" +require "google/cloud/kms/v1/hsm_management" + +class ::Google::Cloud::Kms::V1::HsmManagement::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::HsmManagement::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_paths_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_paths_test.rb new file mode 100644 index 000000000000..ab8276bcff2b --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/hsm_management" + +class ::Google::Cloud::Kms::V1::HsmManagement::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_single_tenant_hsm_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.single_tenant_hsm_instance_path project: "value0", location: "value1", single_tenant_hsm_instance: "value2" + assert_equal "projects/value0/locations/value1/singleTenantHsmInstances/value2", path + end + end + + def test_single_tenant_hsm_instance_proposal_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.single_tenant_hsm_instance_proposal_path project: "value0", location: "value1", single_tenant_hsm_instance: "value2", proposal: "value3" + assert_equal "projects/value0/locations/value1/singleTenantHsmInstances/value2/proposals/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_rest_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_rest_test.rb new file mode 100644 index 000000000000..731fe88066c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_rest_test.rb @@ -0,0 +1,600 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/kms/v1/hsm_management_pb" +require "google/cloud/kms/v1/hsm_management/rest" + + +class ::Google::Cloud::Kms::V1::HsmManagement::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_single_tenant_hsm_instances + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + show_deleted = true + + list_single_tenant_hsm_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_list_single_tenant_hsm_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_single_tenant_hsm_instances_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_single_tenant_hsm_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_single_tenant_hsm_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_single_tenant_hsm_instances ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_single_tenant_hsm_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_single_tenant_hsm_instances(::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_single_tenant_hsm_instances_client_stub.call_count + end + end + end + + def test_get_single_tenant_hsm_instance + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::SingleTenantHsmInstance.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_single_tenant_hsm_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_get_single_tenant_hsm_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_single_tenant_hsm_instance_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_single_tenant_hsm_instance({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_single_tenant_hsm_instance name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_single_tenant_hsm_instance ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_single_tenant_hsm_instance({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_single_tenant_hsm_instance(::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_single_tenant_hsm_instance_client_stub.call_count + end + end + end + + def test_create_single_tenant_hsm_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + single_tenant_hsm_instance_id = "hello world" + single_tenant_hsm_instance = {} + + create_single_tenant_hsm_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_create_single_tenant_hsm_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_single_tenant_hsm_instance_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_single_tenant_hsm_instance({ parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_single_tenant_hsm_instance parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_single_tenant_hsm_instance ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new(parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_single_tenant_hsm_instance({ parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_single_tenant_hsm_instance(::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new(parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_single_tenant_hsm_instance_client_stub.call_count + end + end + end + + def test_create_single_tenant_hsm_instance_proposal + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + single_tenant_hsm_instance_proposal_id = "hello world" + single_tenant_hsm_instance_proposal = {} + + create_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_create_single_tenant_hsm_instance_proposal_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_single_tenant_hsm_instance_proposal_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_single_tenant_hsm_instance_proposal({ parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_single_tenant_hsm_instance_proposal parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new(parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_single_tenant_hsm_instance_proposal({ parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new(parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_single_tenant_hsm_instance_proposal_client_stub.call_count + end + end + end + + def test_approve_single_tenant_hsm_instance_proposal + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + quorum_reply = {} + + approve_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_approve_single_tenant_hsm_instance_proposal_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, approve_single_tenant_hsm_instance_proposal_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.approve_single_tenant_hsm_instance_proposal({ name: name, quorum_reply: quorum_reply }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.approve_single_tenant_hsm_instance_proposal name: name, quorum_reply: quorum_reply do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.approve_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new(name: name, quorum_reply: quorum_reply) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.approve_single_tenant_hsm_instance_proposal({ name: name, quorum_reply: quorum_reply }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.approve_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new(name: name, quorum_reply: quorum_reply), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, approve_single_tenant_hsm_instance_proposal_client_stub.call_count + end + end + end + + def test_execute_single_tenant_hsm_instance_proposal + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + execute_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_execute_single_tenant_hsm_instance_proposal_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, execute_single_tenant_hsm_instance_proposal_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.execute_single_tenant_hsm_instance_proposal({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.execute_single_tenant_hsm_instance_proposal name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.execute_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.execute_single_tenant_hsm_instance_proposal({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.execute_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, execute_single_tenant_hsm_instance_proposal_client_stub.call_count + end + end + end + + def test_get_single_tenant_hsm_instance_proposal + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_get_single_tenant_hsm_instance_proposal_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_single_tenant_hsm_instance_proposal_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_single_tenant_hsm_instance_proposal({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_single_tenant_hsm_instance_proposal name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_single_tenant_hsm_instance_proposal({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_single_tenant_hsm_instance_proposal_client_stub.call_count + end + end + end + + def test_list_single_tenant_hsm_instance_proposals + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + show_deleted = true + + list_single_tenant_hsm_instance_proposals_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_list_single_tenant_hsm_instance_proposals_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_single_tenant_hsm_instance_proposals_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_single_tenant_hsm_instance_proposals({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_single_tenant_hsm_instance_proposals parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_single_tenant_hsm_instance_proposals ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_single_tenant_hsm_instance_proposals({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_single_tenant_hsm_instance_proposals(::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_single_tenant_hsm_instance_proposals_client_stub.call_count + end + end + end + + def test_delete_single_tenant_hsm_instance_proposal + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_delete_single_tenant_hsm_instance_proposal_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_single_tenant_hsm_instance_proposal_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_single_tenant_hsm_instance_proposal({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_single_tenant_hsm_instance_proposal name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_single_tenant_hsm_instance_proposal({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_single_tenant_hsm_instance_proposal_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_test.rb new file mode 100644 index 000000000000..6f7e9924c343 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_test.rb @@ -0,0 +1,696 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/hsm_management_pb" +require "google/cloud/kms/v1/hsm_management" + +class ::Google::Cloud::Kms::V1::HsmManagement::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_single_tenant_hsm_instances + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + show_deleted = true + + list_single_tenant_hsm_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_single_tenant_hsm_instances, name + assert_kind_of ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_single_tenant_hsm_instances_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_single_tenant_hsm_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_single_tenant_hsm_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_single_tenant_hsm_instances ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_single_tenant_hsm_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_single_tenant_hsm_instances(::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_single_tenant_hsm_instances_client_stub.call_rpc_count + end + end + + def test_get_single_tenant_hsm_instance + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::SingleTenantHsmInstance.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_single_tenant_hsm_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_single_tenant_hsm_instance, name + assert_kind_of ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_single_tenant_hsm_instance_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_single_tenant_hsm_instance({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_single_tenant_hsm_instance name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_single_tenant_hsm_instance ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_single_tenant_hsm_instance({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_single_tenant_hsm_instance(::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_single_tenant_hsm_instance_client_stub.call_rpc_count + end + end + + def test_create_single_tenant_hsm_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + single_tenant_hsm_instance_id = "hello world" + single_tenant_hsm_instance = {} + + create_single_tenant_hsm_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_single_tenant_hsm_instance, name + assert_kind_of ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["single_tenant_hsm_instance_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::SingleTenantHsmInstance), request["single_tenant_hsm_instance"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_single_tenant_hsm_instance_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_single_tenant_hsm_instance({ parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_single_tenant_hsm_instance parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_single_tenant_hsm_instance ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new(parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_single_tenant_hsm_instance({ parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_single_tenant_hsm_instance(::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new(parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_single_tenant_hsm_instance_client_stub.call_rpc_count + end + end + + def test_create_single_tenant_hsm_instance_proposal + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + single_tenant_hsm_instance_proposal_id = "hello world" + single_tenant_hsm_instance_proposal = {} + + create_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_single_tenant_hsm_instance_proposal, name + assert_kind_of ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["single_tenant_hsm_instance_proposal_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal), request["single_tenant_hsm_instance_proposal"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_single_tenant_hsm_instance_proposal_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_single_tenant_hsm_instance_proposal({ parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_single_tenant_hsm_instance_proposal parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new(parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_single_tenant_hsm_instance_proposal({ parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new(parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_single_tenant_hsm_instance_proposal_client_stub.call_rpc_count + end + end + + def test_approve_single_tenant_hsm_instance_proposal + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + quorum_reply = {} + + approve_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :approve_single_tenant_hsm_instance_proposal, name + assert_kind_of ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::QuorumReply), request["quorum_reply"] + assert_equal :quorum_reply, request.approval_payload + refute_nil options + end + + Gapic::ServiceStub.stub :new, approve_single_tenant_hsm_instance_proposal_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.approve_single_tenant_hsm_instance_proposal({ name: name, quorum_reply: quorum_reply }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.approve_single_tenant_hsm_instance_proposal name: name, quorum_reply: quorum_reply do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.approve_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new(name: name, quorum_reply: quorum_reply) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.approve_single_tenant_hsm_instance_proposal({ name: name, quorum_reply: quorum_reply }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.approve_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new(name: name, quorum_reply: quorum_reply), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, approve_single_tenant_hsm_instance_proposal_client_stub.call_rpc_count + end + end + + def test_execute_single_tenant_hsm_instance_proposal + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + execute_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :execute_single_tenant_hsm_instance_proposal, name + assert_kind_of ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, execute_single_tenant_hsm_instance_proposal_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.execute_single_tenant_hsm_instance_proposal({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.execute_single_tenant_hsm_instance_proposal name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.execute_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.execute_single_tenant_hsm_instance_proposal({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.execute_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, execute_single_tenant_hsm_instance_proposal_client_stub.call_rpc_count + end + end + + def test_get_single_tenant_hsm_instance_proposal + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_single_tenant_hsm_instance_proposal, name + assert_kind_of ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_single_tenant_hsm_instance_proposal_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_single_tenant_hsm_instance_proposal({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_single_tenant_hsm_instance_proposal name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_single_tenant_hsm_instance_proposal({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_single_tenant_hsm_instance_proposal_client_stub.call_rpc_count + end + end + + def test_list_single_tenant_hsm_instance_proposals + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + show_deleted = true + + list_single_tenant_hsm_instance_proposals_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_single_tenant_hsm_instance_proposals, name + assert_kind_of ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_single_tenant_hsm_instance_proposals_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_single_tenant_hsm_instance_proposals({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_single_tenant_hsm_instance_proposals parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_single_tenant_hsm_instance_proposals ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_single_tenant_hsm_instance_proposals({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_single_tenant_hsm_instance_proposals(::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_single_tenant_hsm_instance_proposals_client_stub.call_rpc_count + end + end + + def test_delete_single_tenant_hsm_instance_proposal + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_single_tenant_hsm_instance_proposal, name + assert_kind_of ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_single_tenant_hsm_instance_proposal_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_single_tenant_hsm_instance_proposal({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_single_tenant_hsm_instance_proposal name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_single_tenant_hsm_instance_proposal({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_single_tenant_hsm_instance_proposal_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::HsmManagement::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Kms::V1::HsmManagement::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Kms::V1::HsmManagement::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_operations_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_operations_test.rb new file mode 100644 index 000000000000..b0d8be4dd67a --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/service_pb" +require "google/cloud/kms/v1/service_services_pb" +require "google/cloud/kms/v1/key_management_service" + +class ::Google::Cloud::Kms::V1::KeyManagementService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::KeyManagementService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb new file mode 100644 index 000000000000..a596f706c595 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/key_management_service" + +class ::Google::Cloud::Kms::V1::KeyManagementService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_crypto_key_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path + end + end + + def test_import_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.import_job_path project: "value0", location: "value1", key_ring: "value2", import_job: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/importJobs/value3", path + end + end + + def test_key_ring_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.key_ring_path project: "value0", location: "value1", key_ring: "value2" + assert_equal "projects/value0/locations/value1/keyRings/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_retired_resource_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.retired_resource_path project: "value0", location: "value1", retired_resource: "value2" + assert_equal "projects/value0/locations/value1/retiredResources/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb new file mode 100644 index 000000000000..29382ada5ddd --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb @@ -0,0 +1,1955 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/kms/v1/service_pb" +require "google/cloud/kms/v1/key_management_service/rest" + + +class ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_key_rings + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ListKeyRingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_key_rings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_list_key_rings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_key_rings_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_key_rings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_key_rings parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_key_rings ::Google::Cloud::Kms::V1::ListKeyRingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_key_rings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_key_rings(::Google::Cloud::Kms::V1::ListKeyRingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_key_rings_client_stub.call_count + end + end + end + + def test_list_crypto_keys + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ListCryptoKeysResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + version_view = :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED + filter = "hello world" + order_by = "hello world" + + list_crypto_keys_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_list_crypto_keys_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_crypto_keys_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_crypto_keys({ parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_crypto_keys parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_crypto_keys ::Google::Cloud::Kms::V1::ListCryptoKeysRequest.new(parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_crypto_keys({ parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_crypto_keys(::Google::Cloud::Kms::V1::ListCryptoKeysRequest.new(parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_crypto_keys_client_stub.call_count + end + end + end + + def test_list_crypto_key_versions + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + view = :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED + filter = "hello world" + order_by = "hello world" + + list_crypto_key_versions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_list_crypto_key_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_crypto_key_versions_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_crypto_key_versions({ parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_crypto_key_versions parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_crypto_key_versions ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_crypto_key_versions({ parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_crypto_key_versions(::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_crypto_key_versions_client_stub.call_count + end + end + end + + def test_list_import_jobs + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ListImportJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_import_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_list_import_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_import_jobs_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_import_jobs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_import_jobs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_import_jobs ::Google::Cloud::Kms::V1::ListImportJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_import_jobs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_import_jobs(::Google::Cloud::Kms::V1::ListImportJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_import_jobs_client_stub.call_count + end + end + end + + def test_list_retired_resources + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_retired_resources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_list_retired_resources_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_retired_resources_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_retired_resources parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_retired_resources ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_retired_resources(::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_retired_resources_client_stub.call_count + end + end + end + + def test_get_key_ring + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::KeyRing.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_key_ring_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_key_ring_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_key_ring_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_key_ring({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_key_ring name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_key_ring ::Google::Cloud::Kms::V1::GetKeyRingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_key_ring({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_key_ring(::Google::Cloud::Kms::V1::GetKeyRingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_key_ring_client_stub.call_count + end + end + end + + def test_get_crypto_key + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::CryptoKey.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_crypto_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_crypto_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_crypto_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_crypto_key({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_crypto_key name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_crypto_key ::Google::Cloud::Kms::V1::GetCryptoKeyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_crypto_key({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_crypto_key(::Google::Cloud::Kms::V1::GetCryptoKeyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_crypto_key_client_stub.call_count + end + end + end + + def test_get_crypto_key_version + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_crypto_key_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_crypto_key_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_crypto_key_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_crypto_key_version ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_crypto_key_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_crypto_key_version(::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_crypto_key_version_client_stub.call_count + end + end + end + + def test_get_public_key + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::PublicKey.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + public_key_format = :PUBLIC_KEY_FORMAT_UNSPECIFIED + + get_public_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_public_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_public_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_public_key({ name: name, public_key_format: public_key_format }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_public_key name: name, public_key_format: public_key_format do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_public_key ::Google::Cloud::Kms::V1::GetPublicKeyRequest.new(name: name, public_key_format: public_key_format) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_public_key({ name: name, public_key_format: public_key_format }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_public_key(::Google::Cloud::Kms::V1::GetPublicKeyRequest.new(name: name, public_key_format: public_key_format), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_public_key_client_stub.call_count + end + end + end + + def test_get_import_job + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ImportJob.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_import_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_import_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_import_job_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_import_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_import_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_import_job ::Google::Cloud::Kms::V1::GetImportJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_import_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_import_job(::Google::Cloud::Kms::V1::GetImportJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_import_job_client_stub.call_count + end + end + end + + def test_get_retired_resource + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::RetiredResource.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_retired_resource_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_retired_resource_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_retired_resource_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_retired_resource({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_retired_resource name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_retired_resource ::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_retired_resource({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_retired_resource(::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_retired_resource_client_stub.call_count + end + end + end + + def test_create_key_ring + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::KeyRing.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + key_ring_id = "hello world" + key_ring = {} + + create_key_ring_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_create_key_ring_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_key_ring_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_key_ring({ parent: parent, key_ring_id: key_ring_id, key_ring: key_ring }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_key_ring parent: parent, key_ring_id: key_ring_id, key_ring: key_ring do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_key_ring ::Google::Cloud::Kms::V1::CreateKeyRingRequest.new(parent: parent, key_ring_id: key_ring_id, key_ring: key_ring) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_key_ring({ parent: parent, key_ring_id: key_ring_id, key_ring: key_ring }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_key_ring(::Google::Cloud::Kms::V1::CreateKeyRingRequest.new(parent: parent, key_ring_id: key_ring_id, key_ring: key_ring), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_key_ring_client_stub.call_count + end + end + end + + def test_create_crypto_key + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::CryptoKey.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + crypto_key_id = "hello world" + crypto_key = {} + skip_initial_version_creation = true + + create_crypto_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_create_crypto_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_crypto_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_crypto_key({ parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_crypto_key parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_crypto_key ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new(parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_crypto_key({ parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_crypto_key(::Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new(parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_crypto_key_client_stub.call_count + end + end + end + + def test_create_crypto_key_version + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + crypto_key_version = {} + + create_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_create_crypto_key_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_crypto_key_version parent: parent, crypto_key_version: crypto_key_version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_crypto_key_version ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_crypto_key_version(::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_crypto_key_version_client_stub.call_count + end + end + end + + def test_delete_crypto_key + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_crypto_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_delete_crypto_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_crypto_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_crypto_key({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_crypto_key name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_crypto_key ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_crypto_key({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_crypto_key(::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_crypto_key_client_stub.call_count + end + end + end + + def test_delete_crypto_key_version + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_delete_crypto_key_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_crypto_key_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_crypto_key_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_crypto_key_version ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_crypto_key_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_crypto_key_version(::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_crypto_key_version_client_stub.call_count + end + end + end + + def test_import_crypto_key_version + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + crypto_key_version = "hello world" + algorithm = :CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED + import_job = "hello world" + wrapped_key = "hello world" + rsa_aes_wrapped_key = "hello world" + + import_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_import_crypto_key_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_crypto_key_version parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_crypto_key_version ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_crypto_key_version(::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_crypto_key_version_client_stub.call_count + end + end + end + + def test_create_import_job + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ImportJob.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + import_job_id = "hello world" + import_job = {} + + create_import_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_create_import_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_import_job_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_import_job({ parent: parent, import_job_id: import_job_id, import_job: import_job }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_import_job parent: parent, import_job_id: import_job_id, import_job: import_job do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_import_job ::Google::Cloud::Kms::V1::CreateImportJobRequest.new(parent: parent, import_job_id: import_job_id, import_job: import_job) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_import_job({ parent: parent, import_job_id: import_job_id, import_job: import_job }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_import_job(::Google::Cloud::Kms::V1::CreateImportJobRequest.new(parent: parent, import_job_id: import_job_id, import_job: import_job), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_import_job_client_stub.call_count + end + end + end + + def test_update_crypto_key + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::CryptoKey.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + crypto_key = {} + update_mask = {} + + update_crypto_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_update_crypto_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_crypto_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_crypto_key({ crypto_key: crypto_key, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_crypto_key crypto_key: crypto_key, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_crypto_key ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new(crypto_key: crypto_key, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_crypto_key({ crypto_key: crypto_key, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_crypto_key(::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new(crypto_key: crypto_key, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_crypto_key_client_stub.call_count + end + end + end + + def test_update_crypto_key_version + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + crypto_key_version = {} + update_mask = {} + + update_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_update_crypto_key_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_crypto_key_version({ crypto_key_version: crypto_key_version, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_crypto_key_version crypto_key_version: crypto_key_version, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_crypto_key_version ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new(crypto_key_version: crypto_key_version, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_crypto_key_version({ crypto_key_version: crypto_key_version, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_crypto_key_version(::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new(crypto_key_version: crypto_key_version, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_crypto_key_version_client_stub.call_count + end + end + end + + def test_update_crypto_key_primary_version + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::CryptoKey.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + crypto_key_version_id = "hello world" + + update_crypto_key_primary_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_update_crypto_key_primary_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_crypto_key_primary_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_crypto_key_primary_version({ name: name, crypto_key_version_id: crypto_key_version_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_crypto_key_primary_version name: name, crypto_key_version_id: crypto_key_version_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_crypto_key_primary_version ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new(name: name, crypto_key_version_id: crypto_key_version_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_crypto_key_primary_version({ name: name, crypto_key_version_id: crypto_key_version_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_crypto_key_primary_version(::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new(name: name, crypto_key_version_id: crypto_key_version_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_crypto_key_primary_version_client_stub.call_count + end + end + end + + def test_destroy_crypto_key_version + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + destroy_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_destroy_crypto_key_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, destroy_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.destroy_crypto_key_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.destroy_crypto_key_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.destroy_crypto_key_version ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.destroy_crypto_key_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.destroy_crypto_key_version(::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, destroy_crypto_key_version_client_stub.call_count + end + end + end + + def test_restore_crypto_key_version + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + restore_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_restore_crypto_key_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restore_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.restore_crypto_key_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.restore_crypto_key_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.restore_crypto_key_version ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.restore_crypto_key_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.restore_crypto_key_version(::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, restore_crypto_key_version_client_stub.call_count + end + end + end + + def test_encrypt + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::EncryptResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + plaintext = "hello world" + additional_authenticated_data = "hello world" + plaintext_crc32c = {} + additional_authenticated_data_crc32c = {} + + encrypt_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_encrypt_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, encrypt_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.encrypt name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.encrypt ::Google::Cloud::Kms::V1::EncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.encrypt(::Google::Cloud::Kms::V1::EncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, encrypt_client_stub.call_count + end + end + end + + def test_decrypt + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::DecryptResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ciphertext = "hello world" + additional_authenticated_data = "hello world" + ciphertext_crc32c = {} + additional_authenticated_data_crc32c = {} + + decrypt_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_decrypt_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, decrypt_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.decrypt name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.decrypt ::Google::Cloud::Kms::V1::DecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.decrypt(::Google::Cloud::Kms::V1::DecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, decrypt_client_stub.call_count + end + end + end + + def test_raw_encrypt + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::RawEncryptResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + plaintext = "hello world" + additional_authenticated_data = "hello world" + plaintext_crc32c = {} + additional_authenticated_data_crc32c = {} + initialization_vector = "hello world" + initialization_vector_crc32c = {} + + raw_encrypt_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_raw_encrypt_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, raw_encrypt_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.raw_encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.raw_encrypt name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.raw_encrypt ::Google::Cloud::Kms::V1::RawEncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.raw_encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.raw_encrypt(::Google::Cloud::Kms::V1::RawEncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, raw_encrypt_client_stub.call_count + end + end + end + + def test_raw_decrypt + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::RawDecryptResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ciphertext = "hello world" + additional_authenticated_data = "hello world" + initialization_vector = "hello world" + tag_length = 42 + ciphertext_crc32c = {} + additional_authenticated_data_crc32c = {} + initialization_vector_crc32c = {} + + raw_decrypt_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_raw_decrypt_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, raw_decrypt_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.raw_decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.raw_decrypt name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.raw_decrypt ::Google::Cloud::Kms::V1::RawDecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.raw_decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.raw_decrypt(::Google::Cloud::Kms::V1::RawDecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, raw_decrypt_client_stub.call_count + end + end + end + + def test_asymmetric_sign + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::AsymmetricSignResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + digest = {} + digest_crc32c = {} + data = "hello world" + data_crc32c = {} + + asymmetric_sign_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_asymmetric_sign_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, asymmetric_sign_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.asymmetric_sign({ name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.asymmetric_sign name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.asymmetric_sign ::Google::Cloud::Kms::V1::AsymmetricSignRequest.new(name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.asymmetric_sign({ name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.asymmetric_sign(::Google::Cloud::Kms::V1::AsymmetricSignRequest.new(name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, asymmetric_sign_client_stub.call_count + end + end + end + + def test_asymmetric_decrypt + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ciphertext = "hello world" + ciphertext_crc32c = {} + + asymmetric_decrypt_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_asymmetric_decrypt_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, asymmetric_decrypt_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.asymmetric_decrypt({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.asymmetric_decrypt name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.asymmetric_decrypt ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.asymmetric_decrypt({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.asymmetric_decrypt(::Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, asymmetric_decrypt_client_stub.call_count + end + end + end + + def test_mac_sign + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::MacSignResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + data = "hello world" + data_crc32c = {} + + mac_sign_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_mac_sign_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, mac_sign_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.mac_sign({ name: name, data: data, data_crc32c: data_crc32c }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.mac_sign name: name, data: data, data_crc32c: data_crc32c do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.mac_sign ::Google::Cloud::Kms::V1::MacSignRequest.new(name: name, data: data, data_crc32c: data_crc32c) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.mac_sign({ name: name, data: data, data_crc32c: data_crc32c }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.mac_sign(::Google::Cloud::Kms::V1::MacSignRequest.new(name: name, data: data, data_crc32c: data_crc32c), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, mac_sign_client_stub.call_count + end + end + end + + def test_mac_verify + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::MacVerifyResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + data = "hello world" + data_crc32c = {} + mac = "hello world" + mac_crc32c = {} + + mac_verify_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_mac_verify_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, mac_verify_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.mac_verify({ name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.mac_verify name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.mac_verify ::Google::Cloud::Kms::V1::MacVerifyRequest.new(name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.mac_verify({ name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.mac_verify(::Google::Cloud::Kms::V1::MacVerifyRequest.new(name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, mac_verify_client_stub.call_count + end + end + end + + def test_decapsulate + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::DecapsulateResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ciphertext = "hello world" + ciphertext_crc32c = {} + + decapsulate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_decapsulate_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, decapsulate_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.decapsulate({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.decapsulate name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.decapsulate ::Google::Cloud::Kms::V1::DecapsulateRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.decapsulate({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.decapsulate(::Google::Cloud::Kms::V1::DecapsulateRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, decapsulate_client_stub.call_count + end + end + end + + def test_generate_random_bytes + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + location = "hello world" + length_bytes = 42 + protection_level = :PROTECTION_LEVEL_UNSPECIFIED + + generate_random_bytes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_generate_random_bytes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_random_bytes_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_random_bytes({ location: location, length_bytes: length_bytes, protection_level: protection_level }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_random_bytes location: location, length_bytes: length_bytes, protection_level: protection_level do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_random_bytes ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new(location: location, length_bytes: length_bytes, protection_level: protection_level) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_random_bytes({ location: location, length_bytes: length_bytes, protection_level: protection_level }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_random_bytes(::Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new(location: location, length_bytes: length_bytes, protection_level: protection_level), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_random_bytes_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb new file mode 100644 index 000000000000..e7de561c10bb --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb @@ -0,0 +1,2216 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/kms/v1/service_pb" +require "google/cloud/kms/v1/key_management_service" + +class ::Google::Cloud::Kms::V1::KeyManagementService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_key_rings + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ListKeyRingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_key_rings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_key_rings, name + assert_kind_of ::Google::Cloud::Kms::V1::ListKeyRingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_key_rings_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_key_rings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_key_rings parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_key_rings ::Google::Cloud::Kms::V1::ListKeyRingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_key_rings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_key_rings(::Google::Cloud::Kms::V1::ListKeyRingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_key_rings_client_stub.call_rpc_count + end + end + + def test_list_crypto_keys + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ListCryptoKeysResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + version_view = :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED + filter = "hello world" + order_by = "hello world" + + list_crypto_keys_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_crypto_keys, name + assert_kind_of ::Google::Cloud::Kms::V1::ListCryptoKeysRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED, request["version_view"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_crypto_keys_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_crypto_keys({ parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_crypto_keys parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_crypto_keys ::Google::Cloud::Kms::V1::ListCryptoKeysRequest.new(parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_crypto_keys({ parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_crypto_keys(::Google::Cloud::Kms::V1::ListCryptoKeysRequest.new(parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_crypto_keys_client_stub.call_rpc_count + end + end + + def test_list_crypto_key_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + view = :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED + filter = "hello world" + order_by = "hello world" + + list_crypto_key_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_crypto_key_versions, name + assert_kind_of ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED, request["view"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_crypto_key_versions_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_crypto_key_versions({ parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_crypto_key_versions parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_crypto_key_versions ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_crypto_key_versions({ parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_crypto_key_versions(::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_crypto_key_versions_client_stub.call_rpc_count + end + end + + def test_list_import_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ListImportJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_import_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_import_jobs, name + assert_kind_of ::Google::Cloud::Kms::V1::ListImportJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_import_jobs_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_import_jobs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_import_jobs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_import_jobs ::Google::Cloud::Kms::V1::ListImportJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_import_jobs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_import_jobs(::Google::Cloud::Kms::V1::ListImportJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_import_jobs_client_stub.call_rpc_count + end + end + + def test_list_retired_resources + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_retired_resources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_retired_resources, name + assert_kind_of ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_retired_resources_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_retired_resources parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_retired_resources ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_retired_resources(::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_retired_resources_client_stub.call_rpc_count + end + end + + def test_get_key_ring + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::KeyRing.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_key_ring_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_key_ring, name + assert_kind_of ::Google::Cloud::Kms::V1::GetKeyRingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_key_ring_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_key_ring({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_key_ring name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_key_ring ::Google::Cloud::Kms::V1::GetKeyRingRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_key_ring({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_key_ring(::Google::Cloud::Kms::V1::GetKeyRingRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_key_ring_client_stub.call_rpc_count + end + end + + def test_get_crypto_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::CryptoKey.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_crypto_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_crypto_key, name + assert_kind_of ::Google::Cloud::Kms::V1::GetCryptoKeyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_crypto_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_crypto_key({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_crypto_key name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_crypto_key ::Google::Cloud::Kms::V1::GetCryptoKeyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_crypto_key({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_crypto_key(::Google::Cloud::Kms::V1::GetCryptoKeyRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_crypto_key_client_stub.call_rpc_count + end + end + + def test_get_crypto_key_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_crypto_key_version, name + assert_kind_of ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_crypto_key_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_crypto_key_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_crypto_key_version ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_crypto_key_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_crypto_key_version(::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_crypto_key_version_client_stub.call_rpc_count + end + end + + def test_get_public_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::PublicKey.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + public_key_format = :PUBLIC_KEY_FORMAT_UNSPECIFIED + + get_public_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_public_key, name + assert_kind_of ::Google::Cloud::Kms::V1::GetPublicKeyRequest, request + assert_equal "hello world", request["name"] + assert_equal :PUBLIC_KEY_FORMAT_UNSPECIFIED, request["public_key_format"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_public_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_public_key({ name: name, public_key_format: public_key_format }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_public_key name: name, public_key_format: public_key_format do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_public_key ::Google::Cloud::Kms::V1::GetPublicKeyRequest.new(name: name, public_key_format: public_key_format) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_public_key({ name: name, public_key_format: public_key_format }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_public_key(::Google::Cloud::Kms::V1::GetPublicKeyRequest.new(name: name, public_key_format: public_key_format), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_public_key_client_stub.call_rpc_count + end + end + + def test_get_import_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ImportJob.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_import_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_import_job, name + assert_kind_of ::Google::Cloud::Kms::V1::GetImportJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_import_job_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_import_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_import_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_import_job ::Google::Cloud::Kms::V1::GetImportJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_import_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_import_job(::Google::Cloud::Kms::V1::GetImportJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_import_job_client_stub.call_rpc_count + end + end + + def test_get_retired_resource + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::RetiredResource.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_retired_resource_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_retired_resource, name + assert_kind_of ::Google::Cloud::Kms::V1::GetRetiredResourceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_retired_resource_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_retired_resource({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_retired_resource name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_retired_resource ::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_retired_resource({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_retired_resource(::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_retired_resource_client_stub.call_rpc_count + end + end + + def test_create_key_ring + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::KeyRing.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + key_ring_id = "hello world" + key_ring = {} + + create_key_ring_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_key_ring, name + assert_kind_of ::Google::Cloud::Kms::V1::CreateKeyRingRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["key_ring_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::KeyRing), request["key_ring"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_key_ring_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_key_ring({ parent: parent, key_ring_id: key_ring_id, key_ring: key_ring }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_key_ring parent: parent, key_ring_id: key_ring_id, key_ring: key_ring do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_key_ring ::Google::Cloud::Kms::V1::CreateKeyRingRequest.new(parent: parent, key_ring_id: key_ring_id, key_ring: key_ring) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_key_ring({ parent: parent, key_ring_id: key_ring_id, key_ring: key_ring }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_key_ring(::Google::Cloud::Kms::V1::CreateKeyRingRequest.new(parent: parent, key_ring_id: key_ring_id, key_ring: key_ring), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_key_ring_client_stub.call_rpc_count + end + end + + def test_create_crypto_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::CryptoKey.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + crypto_key_id = "hello world" + crypto_key = {} + skip_initial_version_creation = true + + create_crypto_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_crypto_key, name + assert_kind_of ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["crypto_key_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::CryptoKey), request["crypto_key"] + assert_equal true, request["skip_initial_version_creation"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_crypto_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_crypto_key({ parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_crypto_key parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_crypto_key ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new(parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_crypto_key({ parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_crypto_key(::Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new(parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_crypto_key_client_stub.call_rpc_count + end + end + + def test_create_crypto_key_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + crypto_key_version = {} + + create_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_crypto_key_version, name + assert_kind_of ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::CryptoKeyVersion), request["crypto_key_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_crypto_key_version parent: parent, crypto_key_version: crypto_key_version do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_crypto_key_version ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_crypto_key_version(::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_crypto_key_version_client_stub.call_rpc_count + end + end + + def test_delete_crypto_key + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_crypto_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_crypto_key, name + assert_kind_of ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_crypto_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_crypto_key({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_crypto_key name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_crypto_key ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_crypto_key({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_crypto_key(::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_crypto_key_client_stub.call_rpc_count + end + end + + def test_delete_crypto_key_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_crypto_key_version, name + assert_kind_of ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_crypto_key_version({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_crypto_key_version name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_crypto_key_version ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_crypto_key_version({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_crypto_key_version(::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_crypto_key_version_client_stub.call_rpc_count + end + end + + def test_import_crypto_key_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + crypto_key_version = "hello world" + algorithm = :CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED + import_job = "hello world" + wrapped_key = "hello world" + rsa_aes_wrapped_key = "hello world" + + import_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_crypto_key_version, name + assert_kind_of ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["crypto_key_version"] + assert_equal :CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED, request["algorithm"] + assert_equal "hello world", request["import_job"] + assert_equal "hello world", request["wrapped_key"] + assert_equal "hello world", request["rsa_aes_wrapped_key"] + assert_equal :rsa_aes_wrapped_key, request.wrapped_key_material + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_crypto_key_version parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_crypto_key_version ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_crypto_key_version(::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_crypto_key_version_client_stub.call_rpc_count + end + end + + def test_create_import_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ImportJob.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + import_job_id = "hello world" + import_job = {} + + create_import_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_import_job, name + assert_kind_of ::Google::Cloud::Kms::V1::CreateImportJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["import_job_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::ImportJob), request["import_job"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_import_job_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_import_job({ parent: parent, import_job_id: import_job_id, import_job: import_job }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_import_job parent: parent, import_job_id: import_job_id, import_job: import_job do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_import_job ::Google::Cloud::Kms::V1::CreateImportJobRequest.new(parent: parent, import_job_id: import_job_id, import_job: import_job) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_import_job({ parent: parent, import_job_id: import_job_id, import_job: import_job }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_import_job(::Google::Cloud::Kms::V1::CreateImportJobRequest.new(parent: parent, import_job_id: import_job_id, import_job: import_job), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_import_job_client_stub.call_rpc_count + end + end + + def test_update_crypto_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::CryptoKey.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + crypto_key = {} + update_mask = {} + + update_crypto_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_crypto_key, name + assert_kind_of ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::CryptoKey), request["crypto_key"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_crypto_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_crypto_key({ crypto_key: crypto_key, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_crypto_key crypto_key: crypto_key, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_crypto_key ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new(crypto_key: crypto_key, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_crypto_key({ crypto_key: crypto_key, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_crypto_key(::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new(crypto_key: crypto_key, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_crypto_key_client_stub.call_rpc_count + end + end + + def test_update_crypto_key_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + crypto_key_version = {} + update_mask = {} + + update_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_crypto_key_version, name + assert_kind_of ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::CryptoKeyVersion), request["crypto_key_version"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_crypto_key_version({ crypto_key_version: crypto_key_version, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_crypto_key_version crypto_key_version: crypto_key_version, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_crypto_key_version ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new(crypto_key_version: crypto_key_version, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_crypto_key_version({ crypto_key_version: crypto_key_version, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_crypto_key_version(::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new(crypto_key_version: crypto_key_version, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_crypto_key_version_client_stub.call_rpc_count + end + end + + def test_update_crypto_key_primary_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::CryptoKey.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + crypto_key_version_id = "hello world" + + update_crypto_key_primary_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_crypto_key_primary_version, name + assert_kind_of ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["crypto_key_version_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_crypto_key_primary_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_crypto_key_primary_version({ name: name, crypto_key_version_id: crypto_key_version_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_crypto_key_primary_version name: name, crypto_key_version_id: crypto_key_version_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_crypto_key_primary_version ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new(name: name, crypto_key_version_id: crypto_key_version_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_crypto_key_primary_version({ name: name, crypto_key_version_id: crypto_key_version_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_crypto_key_primary_version(::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new(name: name, crypto_key_version_id: crypto_key_version_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_crypto_key_primary_version_client_stub.call_rpc_count + end + end + + def test_destroy_crypto_key_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + destroy_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :destroy_crypto_key_version, name + assert_kind_of ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, destroy_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.destroy_crypto_key_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.destroy_crypto_key_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.destroy_crypto_key_version ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.destroy_crypto_key_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.destroy_crypto_key_version(::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, destroy_crypto_key_version_client_stub.call_rpc_count + end + end + + def test_restore_crypto_key_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + restore_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :restore_crypto_key_version, name + assert_kind_of ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, restore_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.restore_crypto_key_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.restore_crypto_key_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.restore_crypto_key_version ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.restore_crypto_key_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.restore_crypto_key_version(::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, restore_crypto_key_version_client_stub.call_rpc_count + end + end + + def test_encrypt + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::EncryptResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + plaintext = "hello world" + additional_authenticated_data = "hello world" + plaintext_crc32c = {} + additional_authenticated_data_crc32c = {} + + encrypt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :encrypt, name + assert_kind_of ::Google::Cloud::Kms::V1::EncryptRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["plaintext"] + assert_equal "hello world", request["additional_authenticated_data"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["plaintext_crc32c"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["additional_authenticated_data_crc32c"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, encrypt_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.encrypt name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.encrypt ::Google::Cloud::Kms::V1::EncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.encrypt(::Google::Cloud::Kms::V1::EncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, encrypt_client_stub.call_rpc_count + end + end + + def test_decrypt + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::DecryptResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ciphertext = "hello world" + additional_authenticated_data = "hello world" + ciphertext_crc32c = {} + additional_authenticated_data_crc32c = {} + + decrypt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :decrypt, name + assert_kind_of ::Google::Cloud::Kms::V1::DecryptRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["ciphertext"] + assert_equal "hello world", request["additional_authenticated_data"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["ciphertext_crc32c"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["additional_authenticated_data_crc32c"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, decrypt_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.decrypt name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.decrypt ::Google::Cloud::Kms::V1::DecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.decrypt(::Google::Cloud::Kms::V1::DecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, decrypt_client_stub.call_rpc_count + end + end + + def test_raw_encrypt + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::RawEncryptResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + plaintext = "hello world" + additional_authenticated_data = "hello world" + plaintext_crc32c = {} + additional_authenticated_data_crc32c = {} + initialization_vector = "hello world" + initialization_vector_crc32c = {} + + raw_encrypt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :raw_encrypt, name + assert_kind_of ::Google::Cloud::Kms::V1::RawEncryptRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["plaintext"] + assert_equal "hello world", request["additional_authenticated_data"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["plaintext_crc32c"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["additional_authenticated_data_crc32c"] + assert_equal "hello world", request["initialization_vector"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["initialization_vector_crc32c"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, raw_encrypt_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.raw_encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.raw_encrypt name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.raw_encrypt ::Google::Cloud::Kms::V1::RawEncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.raw_encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.raw_encrypt(::Google::Cloud::Kms::V1::RawEncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, raw_encrypt_client_stub.call_rpc_count + end + end + + def test_raw_decrypt + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::RawDecryptResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ciphertext = "hello world" + additional_authenticated_data = "hello world" + initialization_vector = "hello world" + tag_length = 42 + ciphertext_crc32c = {} + additional_authenticated_data_crc32c = {} + initialization_vector_crc32c = {} + + raw_decrypt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :raw_decrypt, name + assert_kind_of ::Google::Cloud::Kms::V1::RawDecryptRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["ciphertext"] + assert_equal "hello world", request["additional_authenticated_data"] + assert_equal "hello world", request["initialization_vector"] + assert_equal 42, request["tag_length"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["ciphertext_crc32c"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["additional_authenticated_data_crc32c"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["initialization_vector_crc32c"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, raw_decrypt_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.raw_decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.raw_decrypt name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.raw_decrypt ::Google::Cloud::Kms::V1::RawDecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.raw_decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.raw_decrypt(::Google::Cloud::Kms::V1::RawDecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, raw_decrypt_client_stub.call_rpc_count + end + end + + def test_asymmetric_sign + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::AsymmetricSignResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + digest = {} + digest_crc32c = {} + data = "hello world" + data_crc32c = {} + + asymmetric_sign_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :asymmetric_sign, name + assert_kind_of ::Google::Cloud::Kms::V1::AsymmetricSignRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::Digest), request["digest"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["digest_crc32c"] + assert_equal "hello world", request["data"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["data_crc32c"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, asymmetric_sign_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.asymmetric_sign({ name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.asymmetric_sign name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.asymmetric_sign ::Google::Cloud::Kms::V1::AsymmetricSignRequest.new(name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.asymmetric_sign({ name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.asymmetric_sign(::Google::Cloud::Kms::V1::AsymmetricSignRequest.new(name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, asymmetric_sign_client_stub.call_rpc_count + end + end + + def test_asymmetric_decrypt + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ciphertext = "hello world" + ciphertext_crc32c = {} + + asymmetric_decrypt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :asymmetric_decrypt, name + assert_kind_of ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["ciphertext"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["ciphertext_crc32c"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, asymmetric_decrypt_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.asymmetric_decrypt({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.asymmetric_decrypt name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.asymmetric_decrypt ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.asymmetric_decrypt({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.asymmetric_decrypt(::Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, asymmetric_decrypt_client_stub.call_rpc_count + end + end + + def test_mac_sign + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::MacSignResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + data = "hello world" + data_crc32c = {} + + mac_sign_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :mac_sign, name + assert_kind_of ::Google::Cloud::Kms::V1::MacSignRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["data"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["data_crc32c"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, mac_sign_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.mac_sign({ name: name, data: data, data_crc32c: data_crc32c }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.mac_sign name: name, data: data, data_crc32c: data_crc32c do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.mac_sign ::Google::Cloud::Kms::V1::MacSignRequest.new(name: name, data: data, data_crc32c: data_crc32c) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.mac_sign({ name: name, data: data, data_crc32c: data_crc32c }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.mac_sign(::Google::Cloud::Kms::V1::MacSignRequest.new(name: name, data: data, data_crc32c: data_crc32c), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, mac_sign_client_stub.call_rpc_count + end + end + + def test_mac_verify + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::MacVerifyResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + data = "hello world" + data_crc32c = {} + mac = "hello world" + mac_crc32c = {} + + mac_verify_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :mac_verify, name + assert_kind_of ::Google::Cloud::Kms::V1::MacVerifyRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["data"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["data_crc32c"] + assert_equal "hello world", request["mac"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["mac_crc32c"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, mac_verify_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.mac_verify({ name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.mac_verify name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.mac_verify ::Google::Cloud::Kms::V1::MacVerifyRequest.new(name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.mac_verify({ name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.mac_verify(::Google::Cloud::Kms::V1::MacVerifyRequest.new(name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, mac_verify_client_stub.call_rpc_count + end + end + + def test_decapsulate + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::DecapsulateResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ciphertext = "hello world" + ciphertext_crc32c = {} + + decapsulate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :decapsulate, name + assert_kind_of ::Google::Cloud::Kms::V1::DecapsulateRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["ciphertext"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["ciphertext_crc32c"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, decapsulate_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.decapsulate({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.decapsulate name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.decapsulate ::Google::Cloud::Kms::V1::DecapsulateRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.decapsulate({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.decapsulate(::Google::Cloud::Kms::V1::DecapsulateRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, decapsulate_client_stub.call_rpc_count + end + end + + def test_generate_random_bytes + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + location = "hello world" + length_bytes = 42 + protection_level = :PROTECTION_LEVEL_UNSPECIFIED + + generate_random_bytes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_random_bytes, name + assert_kind_of ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest, request + assert_equal "hello world", request["location"] + assert_equal 42, request["length_bytes"] + assert_equal :PROTECTION_LEVEL_UNSPECIFIED, request["protection_level"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_random_bytes_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_random_bytes({ location: location, length_bytes: length_bytes, protection_level: protection_level }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_random_bytes location: location, length_bytes: length_bytes, protection_level: protection_level do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_random_bytes ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new(location: location, length_bytes: length_bytes, protection_level: protection_level) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_random_bytes({ location: location, length_bytes: length_bytes, protection_level: protection_level }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_random_bytes(::Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new(location: location, length_bytes: length_bytes, protection_level: protection_level), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_random_bytes_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Kms::V1::KeyManagementService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Kms::V1::KeyManagementService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Kms::V1::KeyManagementService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/helper.rb b/owl-bot-staging/google-cloud-kms-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-kms-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From 71cb3fd12eb1827b3557a2d54fee17cb75d30cbc Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 11 Feb 2026 18:09:21 +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 --- google-cloud-kms-v1/.owlbot-manifest.json | 7 + google-cloud-kms-v1/gapic_metadata.json | 20 + .../cloud/kms/v1/key_management_service.rb | 1 + .../kms/v1/key_management_service/client.rb | 462 ++ .../v1/key_management_service/operations.rb | 0 .../kms/v1/key_management_service/paths.rb | 19 + .../kms/v1/key_management_service/rest.rb | 1 + .../v1/key_management_service/rest/client.rb | 434 ++ .../key_management_service/rest/operations.rb | 0 .../rest/service_stub.rb | 244 + .../lib/google/cloud/kms/v1/resources_pb.rb | 3 +- .../lib/google/cloud/kms/v1/service_pb.rb | 11 +- .../cloud/kms/v1/service_services_pb.rb | 27 + .../google/cloud/kms/v1/resources.rb | 26 + .../proto_docs/google/cloud/kms/v1/service.rb | 100 + .../delete_crypto_key.rb | 0 .../delete_crypto_key_version.rb | 0 .../get_retired_resource.rb | 0 .../list_retired_resources.rb | 0 .../snippet_metadata_google.cloud.kms.v1.json | 160 + .../key_management_service_operations_test.rb | 0 .../v1/key_management_service_paths_test.rb | 12 + .../v1/key_management_service_rest_test.rb | 218 + .../kms/v1/key_management_service_test.rb | 265 + .../google-cloud-kms-v1/.gitignore | 22 - .../google-cloud-kms-v1/.repo-metadata.json | 18 - .../google-cloud-kms-v1/.rubocop.yml | 33 - owl-bot-staging/google-cloud-kms-v1/.toys.rb | 28 - owl-bot-staging/google-cloud-kms-v1/.yardopts | 12 - .../google-cloud-kms-v1/AUTHENTICATION.md | 122 - .../google-cloud-kms-v1/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-kms-v1/Gemfile | 11 - .../google-cloud-kms-v1/LICENSE.md | 201 - owl-bot-staging/google-cloud-kms-v1/README.md | 153 - owl-bot-staging/google-cloud-kms-v1/Rakefile | 169 - .../google-cloud-kms-v1/gapic_metadata.json | 329 -- .../google-cloud-kms-v1.gemspec | 30 - .../lib/google-cloud-kms-v1.rb | 21 - .../lib/google/cloud/kms/v1.rb | 49 - .../lib/google/cloud/kms/v1/autokey.rb | 73 - .../lib/google/cloud/kms/v1/autokey/client.rb | 782 --- .../cloud/kms/v1/autokey/credentials.rb | 52 - .../google/cloud/kms/v1/autokey/operations.rb | 841 --- .../lib/google/cloud/kms/v1/autokey/paths.rb | 90 - .../lib/google/cloud/kms/v1/autokey/rest.rb | 71 - .../cloud/kms/v1/autokey/rest/client.rb | 727 --- .../cloud/kms/v1/autokey/rest/operations.rb | 925 ---- .../cloud/kms/v1/autokey/rest/service_stub.rb | 265 - .../lib/google/cloud/kms/v1/autokey_admin.rb | 62 - .../cloud/kms/v1/autokey_admin/client.rb | 727 --- .../cloud/kms/v1/autokey_admin/credentials.rb | 52 - .../cloud/kms/v1/autokey_admin/paths.rb | 61 - .../google/cloud/kms/v1/autokey_admin/rest.rb | 60 - .../cloud/kms/v1/autokey_admin/rest/client.rb | 672 --- .../kms/v1/autokey_admin/rest/service_stub.rb | 265 - .../google/cloud/kms/v1/autokey_admin_pb.rb | 54 - .../cloud/kms/v1/autokey_admin_services_pb.rb | 63 - .../lib/google/cloud/kms/v1/autokey_pb.rb | 53 - .../cloud/kms/v1/autokey_services_pb.rb | 72 - .../google/cloud/kms/v1/bindings_override.rb | 204 - .../lib/google/cloud/kms/v1/ekm_service.rb | 59 - .../google/cloud/kms/v1/ekm_service/client.rb | 1135 ----- .../cloud/kms/v1/ekm_service/credentials.rb | 52 - .../google/cloud/kms/v1/ekm_service/paths.rb | 107 - .../google/cloud/kms/v1/ekm_service/rest.rb | 57 - .../cloud/kms/v1/ekm_service/rest/client.rb | 1052 ---- .../kms/v1/ekm_service/rest/service_stub.rb | 511 -- .../lib/google/cloud/kms/v1/ekm_service_pb.rb | 64 - .../cloud/kms/v1/ekm_service_services_pb.rb | 69 - .../lib/google/cloud/kms/v1/hsm_management.rb | 62 - .../cloud/kms/v1/hsm_management/client.rb | 1477 ------ .../kms/v1/hsm_management/credentials.rb | 52 - .../cloud/kms/v1/hsm_management/operations.rb | 841 --- .../cloud/kms/v1/hsm_management/paths.rb | 90 - .../cloud/kms/v1/hsm_management/rest.rb | 60 - .../kms/v1/hsm_management/rest/client.rb | 1380 ----- .../kms/v1/hsm_management/rest/operations.rb | 925 ---- .../v1/hsm_management/rest/service_stub.rb | 634 --- .../google/cloud/kms/v1/hsm_management_pb.rb | 86 - .../kms/v1/hsm_management_services_pb.rb | 91 - .../cloud/kms/v1/key_management_service.rb | 67 - .../kms/v1/key_management_service/client.rb | 4498 ----------------- .../v1/key_management_service/credentials.rb | 52 - .../kms/v1/key_management_service/paths.rb | 153 - .../kms/v1/key_management_service/rest.rb | 65 - .../v1/key_management_service/rest/client.rb | 4233 ---------------- .../rest/service_stub.rb | 2114 -------- .../lib/google/cloud/kms/v1/resources_pb.rb | 73 - .../lib/google/cloud/kms/v1/rest.rb | 42 - .../lib/google/cloud/kms/v1/service_pb.rb | 106 - .../cloud/kms/v1/service_services_pb.rb | 245 - .../lib/google/cloud/kms/v1/version.rb | 28 - .../google-cloud-kms-v1/proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../proto_docs/google/cloud/kms/v1/autokey.rb | 142 - .../google/cloud/kms/v1/autokey_admin.rb | 125 - .../google/cloud/kms/v1/ekm_service.rb | 351 -- .../google/cloud/kms/v1/hsm_management.rb | 877 ---- .../google/cloud/kms/v1/resources.rb | 1148 ----- .../proto_docs/google/cloud/kms/v1/service.rb | 1907 ------- .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/protobuf/wrappers.rb | 121 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../google-cloud-kms-v1/snippets/Gemfile | 32 - .../snippets/autokey/create_key_handle.rb | 54 - .../snippets/autokey/get_key_handle.rb | 47 - .../snippets/autokey/list_key_handles.rb | 51 - .../autokey_admin/get_autokey_config.rb | 47 - .../show_effective_autokey_config.rb | 47 - .../autokey_admin/update_autokey_config.rb | 47 - .../ekm_service/create_ekm_connection.rb | 47 - .../snippets/ekm_service/get_ekm_config.rb | 47 - .../ekm_service/get_ekm_connection.rb | 47 - .../ekm_service/list_ekm_connections.rb | 51 - .../snippets/ekm_service/update_ekm_config.rb | 47 - .../ekm_service/update_ekm_connection.rb | 47 - .../ekm_service/verify_connectivity.rb | 47 - ...ove_single_tenant_hsm_instance_proposal.rb | 47 - .../create_single_tenant_hsm_instance.rb | 54 - ...ate_single_tenant_hsm_instance_proposal.rb | 54 - ...ete_single_tenant_hsm_instance_proposal.rb | 47 - ...ute_single_tenant_hsm_instance_proposal.rb | 54 - .../get_single_tenant_hsm_instance.rb | 47 - ...get_single_tenant_hsm_instance_proposal.rb | 47 - ...st_single_tenant_hsm_instance_proposals.rb | 51 - .../list_single_tenant_hsm_instances.rb | 51 - .../asymmetric_decrypt.rb | 47 - .../key_management_service/asymmetric_sign.rb | 47 - .../create_crypto_key.rb | 47 - .../create_crypto_key_version.rb | 47 - .../create_import_job.rb | 47 - .../key_management_service/create_key_ring.rb | 47 - .../key_management_service/decapsulate.rb | 47 - .../key_management_service/decrypt.rb | 47 - .../destroy_crypto_key_version.rb | 47 - .../key_management_service/encrypt.rb | 47 - .../generate_random_bytes.rb | 47 - .../key_management_service/get_crypto_key.rb | 47 - .../get_crypto_key_version.rb | 47 - .../key_management_service/get_import_job.rb | 47 - .../key_management_service/get_key_ring.rb | 47 - .../key_management_service/get_public_key.rb | 47 - .../import_crypto_key_version.rb | 47 - .../list_crypto_key_versions.rb | 51 - .../list_crypto_keys.rb | 51 - .../list_import_jobs.rb | 51 - .../key_management_service/list_key_rings.rb | 51 - .../key_management_service/mac_sign.rb | 47 - .../key_management_service/mac_verify.rb | 47 - .../key_management_service/raw_decrypt.rb | 47 - .../key_management_service/raw_encrypt.rb | 47 - .../restore_crypto_key_version.rb | 47 - .../update_crypto_key.rb | 47 - .../update_crypto_key_primary_version.rb | 47 - .../update_crypto_key_version.rb | 47 - .../snippet_metadata_google.cloud.kms.v1.json | 2215 -------- .../cloud/kms/v1/autokey_admin_paths_test.rb | 67 - .../cloud/kms/v1/autokey_admin_rest_test.rb | 262 - .../google/cloud/kms/v1/autokey_admin_test.rb | 280 - .../cloud/kms/v1/autokey_operations_test.rb | 400 -- .../google/cloud/kms/v1/autokey_paths_test.rb | 79 - .../google/cloud/kms/v1/autokey_rest_test.rb | 266 - .../test/google/cloud/kms/v1/autokey_test.rb | 312 -- .../cloud/kms/v1/ekm_service_paths_test.rb | 91 - .../cloud/kms/v1/ekm_service_rest_test.rb | 485 -- .../google/cloud/kms/v1/ekm_service_test.rb | 531 -- .../kms/v1/hsm_management_operations_test.rb | 400 -- .../cloud/kms/v1/hsm_management_paths_test.rb | 79 - .../cloud/kms/v1/hsm_management_rest_test.rb | 600 --- .../cloud/kms/v1/hsm_management_test.rb | 696 --- .../v1/key_management_service_paths_test.rb | 115 - .../v1/key_management_service_rest_test.rb | 1955 ------- .../kms/v1/key_management_service_test.rb | 2216 -------- .../google-cloud-kms-v1/test/helper.rb | 25 - 183 files changed, 2008 insertions(+), 47894 deletions(-) rename {owl-bot-staging/google-cloud-kms-v1 => google-cloud-kms-v1}/lib/google/cloud/kms/v1/key_management_service/operations.rb (100%) rename {owl-bot-staging/google-cloud-kms-v1 => google-cloud-kms-v1}/lib/google/cloud/kms/v1/key_management_service/rest/operations.rb (100%) rename {owl-bot-staging/google-cloud-kms-v1 => google-cloud-kms-v1}/snippets/key_management_service/delete_crypto_key.rb (100%) rename {owl-bot-staging/google-cloud-kms-v1 => google-cloud-kms-v1}/snippets/key_management_service/delete_crypto_key_version.rb (100%) rename {owl-bot-staging/google-cloud-kms-v1 => google-cloud-kms-v1}/snippets/key_management_service/get_retired_resource.rb (100%) rename {owl-bot-staging/google-cloud-kms-v1 => google-cloud-kms-v1}/snippets/key_management_service/list_retired_resources.rb (100%) rename {owl-bot-staging/google-cloud-kms-v1 => google-cloud-kms-v1}/test/google/cloud/kms/v1/key_management_service_operations_test.rb (100%) delete mode 100644 owl-bot-staging/google-cloud-kms-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-kms-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-kms-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-kms-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-kms-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-kms-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-kms-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-kms-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-kms-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-kms-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-kms-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-kms-v1/google-cloud-kms-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google-cloud-kms-v1.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/client.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/operations.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/paths.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/client.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/paths.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_pb.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_pb.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/client.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/operations.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/paths.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_pb.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey_admin.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/ekm_service.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/hsm_management.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey/create_key_handle.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey/get_key_handle.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey/list_key_handles.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/get_autokey_config.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/show_effective_autokey_config.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/update_autokey_config.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_config.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_config.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/verify_connectivity.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/approve_single_tenant_hsm_instance_proposal.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance_proposal.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/delete_single_tenant_hsm_instance_proposal.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/execute_single_tenant_hsm_instance_proposal.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance_proposal.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instance_proposals.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instances.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decapsulate.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_decrypt.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_encrypt.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-kms-v1/test/helper.rb diff --git a/google-cloud-kms-v1/.owlbot-manifest.json b/google-cloud-kms-v1/.owlbot-manifest.json index 3d7976900656..c796d338fa83 100644 --- a/google-cloud-kms-v1/.owlbot-manifest.json +++ b/google-cloud-kms-v1/.owlbot-manifest.json @@ -59,9 +59,11 @@ "lib/google/cloud/kms/v1/key_management_service.rb", "lib/google/cloud/kms/v1/key_management_service/client.rb", "lib/google/cloud/kms/v1/key_management_service/credentials.rb", + "lib/google/cloud/kms/v1/key_management_service/operations.rb", "lib/google/cloud/kms/v1/key_management_service/paths.rb", "lib/google/cloud/kms/v1/key_management_service/rest.rb", "lib/google/cloud/kms/v1/key_management_service/rest/client.rb", + "lib/google/cloud/kms/v1/key_management_service/rest/operations.rb", "lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb", "lib/google/cloud/kms/v1/resources_pb.rb", "lib/google/cloud/kms/v1/rest.rb", @@ -119,6 +121,8 @@ "snippets/key_management_service/create_key_ring.rb", "snippets/key_management_service/decapsulate.rb", "snippets/key_management_service/decrypt.rb", + "snippets/key_management_service/delete_crypto_key.rb", + "snippets/key_management_service/delete_crypto_key_version.rb", "snippets/key_management_service/destroy_crypto_key_version.rb", "snippets/key_management_service/encrypt.rb", "snippets/key_management_service/generate_random_bytes.rb", @@ -127,11 +131,13 @@ "snippets/key_management_service/get_import_job.rb", "snippets/key_management_service/get_key_ring.rb", "snippets/key_management_service/get_public_key.rb", + "snippets/key_management_service/get_retired_resource.rb", "snippets/key_management_service/import_crypto_key_version.rb", "snippets/key_management_service/list_crypto_key_versions.rb", "snippets/key_management_service/list_crypto_keys.rb", "snippets/key_management_service/list_import_jobs.rb", "snippets/key_management_service/list_key_rings.rb", + "snippets/key_management_service/list_retired_resources.rb", "snippets/key_management_service/mac_sign.rb", "snippets/key_management_service/mac_verify.rb", "snippets/key_management_service/raw_decrypt.rb", @@ -155,6 +161,7 @@ "test/google/cloud/kms/v1/hsm_management_paths_test.rb", "test/google/cloud/kms/v1/hsm_management_rest_test.rb", "test/google/cloud/kms/v1/hsm_management_test.rb", + "test/google/cloud/kms/v1/key_management_service_operations_test.rb", "test/google/cloud/kms/v1/key_management_service_paths_test.rb", "test/google/cloud/kms/v1/key_management_service_rest_test.rb", "test/google/cloud/kms/v1/key_management_service_test.rb", diff --git a/google-cloud-kms-v1/gapic_metadata.json b/google-cloud-kms-v1/gapic_metadata.json index 6da7977683ca..ea6d2abb953b 100644 --- a/google-cloud-kms-v1/gapic_metadata.json +++ b/google-cloud-kms-v1/gapic_metadata.json @@ -176,6 +176,11 @@ "list_import_jobs" ] }, + "ListRetiredResources": { + "methods": [ + "list_retired_resources" + ] + }, "GetKeyRing": { "methods": [ "get_key_ring" @@ -201,6 +206,11 @@ "get_import_job" ] }, + "GetRetiredResource": { + "methods": [ + "get_retired_resource" + ] + }, "CreateKeyRing": { "methods": [ "create_key_ring" @@ -216,6 +226,16 @@ "create_crypto_key_version" ] }, + "DeleteCryptoKey": { + "methods": [ + "delete_crypto_key" + ] + }, + "DeleteCryptoKeyVersion": { + "methods": [ + "delete_crypto_key_version" + ] + }, "ImportCryptoKeyVersion": { "methods": [ "import_crypto_key_version" diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb index 2087aa376f30..d812dbabc2b9 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb @@ -24,6 +24,7 @@ require "google/cloud/kms/v1/key_management_service/credentials" require "google/cloud/kms/v1/key_management_service/paths" +require "google/cloud/kms/v1/key_management_service/operations" require "google/cloud/kms/v1/key_management_service/client" require "google/cloud/kms/v1/key_management_service/rest" diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb index e3fca32ecf5a..ea507ad423b3 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb @@ -103,6 +103,11 @@ def self.configure initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } + default_config.rpcs.list_retired_resources.timeout = 60.0 + default_config.rpcs.list_retired_resources.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + default_config.rpcs.get_key_ring.timeout = 60.0 default_config.rpcs.get_key_ring.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] @@ -128,6 +133,11 @@ def self.configure initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } + default_config.rpcs.get_retired_resource.timeout = 60.0 + default_config.rpcs.get_retired_resource.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + default_config.rpcs.create_key_ring.timeout = 60.0 default_config.rpcs.create_key_ring.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] @@ -140,6 +150,16 @@ def self.configure default_config.rpcs.create_crypto_key_version.timeout = 60.0 + default_config.rpcs.delete_crypto_key.timeout = 60.0 + default_config.rpcs.delete_crypto_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_crypto_key_version.timeout = 60.0 + default_config.rpcs.delete_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + default_config.rpcs.import_crypto_key_version.timeout = 60.0 default_config.rpcs.create_import_job.timeout = 60.0 @@ -286,6 +306,13 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + @key_management_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Kms::V1::KeyManagementService::Stub, credentials: credentials, @@ -325,6 +352,13 @@ def initialize end end + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Kms::V1::KeyManagementService::Operations] + # + attr_reader :operations_client + ## # Get the associated client for mix-in of the Locations. # @@ -808,6 +842,113 @@ def list_import_jobs request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Lists the {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} which are + # the records of deleted {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # RetiredResources prevent the reuse of these resource names after deletion. + # + # @overload list_retired_resources(request, options = nil) + # Pass arguments to `list_retired_resources` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListRetiredResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_retired_resources(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_retired_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project-specific location holding the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} to be included in + # the response. Further + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new + # + # # Call the list_retired_resources method. + # result = client.list_retired_resources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::RetiredResource. + # p item + # end + # + def list_retired_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_retired_resources.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_retired_resources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_retired_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :list_retired_resources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @key_management_service_stub, :list_retired_resources, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Returns metadata for a given {::Google::Cloud::Kms::V1::KeyRing KeyRing}. # @@ -1254,6 +1395,94 @@ def get_import_job request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Retrieves a specific {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} + # resource, which represents the record of a deleted + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload get_retired_resource(request, options = nil) + # Pass arguments to `get_retired_resource` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetRetiredResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetRetiredResourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_retired_resource(name: nil) + # Pass arguments to `get_retired_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::RetiredResource#name name} of the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Kms::V1::RetiredResource] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Kms::V1::RetiredResource] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetRetiredResourceRequest.new + # + # # Call the get_retired_resource method. + # result = client.get_retired_resource request + # + # # The returned object is of type Google::Cloud::Kms::V1::RetiredResource. + # p result + # + def get_retired_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetRetiredResourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_retired_resource.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_retired_resource.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_retired_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :get_retired_resource, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Create a new {::Google::Cloud::Kms::V1::KeyRing KeyRing} in a given Project and # Location. @@ -1549,6 +1778,211 @@ def create_crypto_key_version request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Permanently deletes the given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # All child {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} must + # have been previously deleted using + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion}. + # The specified crypto key will be immediately and permanently deleted upon + # calling this method. This action cannot be undone. + # + # @overload delete_crypto_key(request, options = nil) + # Pass arguments to `delete_crypto_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_crypto_key(name: nil) + # Pass arguments to `delete_crypto_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new + # + # # Call the delete_crypto_key method. + # result = client.delete_crypto_key request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_crypto_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_crypto_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_crypto_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_crypto_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :delete_crypto_key, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes the given + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Only possible if + # the version has not been previously imported and if its + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is one of + # [DESTROYED][CryptoKeyVersionState.DESTROYED], + # [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or + # [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. + # Successfully imported + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} cannot be deleted + # at this time. The specified version will be immediately and permanently + # deleted upon calling this method. This action cannot be undone. + # + # @overload delete_crypto_key_version(request, options = nil) + # Pass arguments to `delete_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_crypto_key_version(name: nil) + # Pass arguments to `delete_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new + # + # # Call the delete_crypto_key_version method. + # result = client.delete_crypto_key_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_crypto_key_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.call_rpc :delete_crypto_key_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Import wrapped key material into a # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. @@ -3838,6 +4272,11 @@ class Rpcs # attr_reader :list_import_jobs ## + # RPC-specific configuration for `list_retired_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_retired_resources + ## # RPC-specific configuration for `get_key_ring` # @return [::Gapic::Config::Method] # @@ -3863,6 +4302,11 @@ class Rpcs # attr_reader :get_import_job ## + # RPC-specific configuration for `get_retired_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_retired_resource + ## # RPC-specific configuration for `create_key_ring` # @return [::Gapic::Config::Method] # @@ -3878,6 +4322,16 @@ class Rpcs # attr_reader :create_crypto_key_version ## + # RPC-specific configuration for `delete_crypto_key` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_crypto_key + ## + # RPC-specific configuration for `delete_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_crypto_key_version + ## # RPC-specific configuration for `import_crypto_key_version` # @return [::Gapic::Config::Method] # @@ -3973,6 +4427,8 @@ def initialize parent_rpcs = nil @list_crypto_key_versions = ::Gapic::Config::Method.new list_crypto_key_versions_config list_import_jobs_config = parent_rpcs.list_import_jobs if parent_rpcs.respond_to? :list_import_jobs @list_import_jobs = ::Gapic::Config::Method.new list_import_jobs_config + list_retired_resources_config = parent_rpcs.list_retired_resources if parent_rpcs.respond_to? :list_retired_resources + @list_retired_resources = ::Gapic::Config::Method.new list_retired_resources_config get_key_ring_config = parent_rpcs.get_key_ring if parent_rpcs.respond_to? :get_key_ring @get_key_ring = ::Gapic::Config::Method.new get_key_ring_config get_crypto_key_config = parent_rpcs.get_crypto_key if parent_rpcs.respond_to? :get_crypto_key @@ -3983,12 +4439,18 @@ def initialize parent_rpcs = nil @get_public_key = ::Gapic::Config::Method.new get_public_key_config get_import_job_config = parent_rpcs.get_import_job if parent_rpcs.respond_to? :get_import_job @get_import_job = ::Gapic::Config::Method.new get_import_job_config + get_retired_resource_config = parent_rpcs.get_retired_resource if parent_rpcs.respond_to? :get_retired_resource + @get_retired_resource = ::Gapic::Config::Method.new get_retired_resource_config create_key_ring_config = parent_rpcs.create_key_ring if parent_rpcs.respond_to? :create_key_ring @create_key_ring = ::Gapic::Config::Method.new create_key_ring_config create_crypto_key_config = parent_rpcs.create_crypto_key if parent_rpcs.respond_to? :create_crypto_key @create_crypto_key = ::Gapic::Config::Method.new create_crypto_key_config create_crypto_key_version_config = parent_rpcs.create_crypto_key_version if parent_rpcs.respond_to? :create_crypto_key_version @create_crypto_key_version = ::Gapic::Config::Method.new create_crypto_key_version_config + delete_crypto_key_config = parent_rpcs.delete_crypto_key if parent_rpcs.respond_to? :delete_crypto_key + @delete_crypto_key = ::Gapic::Config::Method.new delete_crypto_key_config + delete_crypto_key_version_config = parent_rpcs.delete_crypto_key_version if parent_rpcs.respond_to? :delete_crypto_key_version + @delete_crypto_key_version = ::Gapic::Config::Method.new delete_crypto_key_version_config import_crypto_key_version_config = parent_rpcs.import_crypto_key_version if parent_rpcs.respond_to? :import_crypto_key_version @import_crypto_key_version = ::Gapic::Config::Method.new import_crypto_key_version_config create_import_job_config = parent_rpcs.create_import_job if parent_rpcs.respond_to? :create_import_job diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/operations.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/operations.rb similarity index 100% rename from owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/operations.rb rename to google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/operations.rb diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb index 401d6662145c..5b4fd192401e 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb @@ -125,6 +125,25 @@ def location_path project:, location: "projects/#{project}/locations/#{location}" end + ## + # Create a fully-qualified RetiredResource resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/retiredResources/{retired_resource}` + # + # @param project [String] + # @param location [String] + # @param retired_resource [String] + # + # @return [::String] + def retired_resource_path project:, location:, retired_resource: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/retiredResources/#{retired_resource}" + end + extend self end end diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb index 8affc3141e3a..edc0703e73d5 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb @@ -25,6 +25,7 @@ require "google/cloud/kms/v1/key_management_service/credentials" require "google/cloud/kms/v1/key_management_service/paths" +require "google/cloud/kms/v1/key_management_service/rest/operations" require "google/cloud/kms/v1/key_management_service/rest/client" module Google diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb index 7f76e3ca0cba..1f1be5a73dca 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb @@ -105,6 +105,11 @@ def self.configure initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } + default_config.rpcs.list_retired_resources.timeout = 60.0 + default_config.rpcs.list_retired_resources.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + default_config.rpcs.get_key_ring.timeout = 60.0 default_config.rpcs.get_key_ring.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] @@ -130,6 +135,11 @@ def self.configure initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } + default_config.rpcs.get_retired_resource.timeout = 60.0 + default_config.rpcs.get_retired_resource.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + default_config.rpcs.create_key_ring.timeout = 60.0 default_config.rpcs.create_key_ring.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] @@ -142,6 +152,16 @@ def self.configure default_config.rpcs.create_crypto_key_version.timeout = 60.0 + default_config.rpcs.delete_crypto_key.timeout = 60.0 + default_config.rpcs.delete_crypto_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_crypto_key_version.timeout = 60.0 + default_config.rpcs.delete_crypto_key_version.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + default_config.rpcs.import_crypto_key_version.timeout = 60.0 default_config.rpcs.create_import_job.timeout = 60.0 @@ -283,6 +303,13 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + @operations_client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + @key_management_service_stub = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, @@ -320,6 +347,13 @@ def initialize end end + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Kms::V1::KeyManagementService::Rest::Operations] + # + attr_reader :operations_client + ## # Get the associated client for mix-in of the Locations. # @@ -775,6 +809,106 @@ def list_import_jobs request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Lists the {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} which are + # the records of deleted {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # RetiredResources prevent the reuse of these resource names after deletion. + # + # @overload list_retired_resources(request, options = nil) + # Pass arguments to `list_retired_resources` via a request object, either of type + # {::Google::Cloud::Kms::V1::ListRetiredResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_retired_resources(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_retired_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project-specific location holding the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} to be included in + # the response. Further + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new + # + # # Call the list_retired_resources method. + # result = client.list_retired_resources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Kms::V1::RetiredResource. + # p item + # end + # + def list_retired_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_retired_resources.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_retired_resources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_retired_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.list_retired_resources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @key_management_service_stub, :list_retired_resources, "retired_resources", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Returns metadata for a given {::Google::Cloud::Kms::V1::KeyRing KeyRing}. # @@ -1186,6 +1320,87 @@ def get_import_job request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Retrieves a specific {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} + # resource, which represents the record of a deleted + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # + # @overload get_retired_resource(request, options = nil) + # Pass arguments to `get_retired_resource` via a request object, either of type + # {::Google::Cloud::Kms::V1::GetRetiredResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::GetRetiredResourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_retired_resource(name: nil) + # Pass arguments to `get_retired_resource` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::RetiredResource#name name} of the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::RetiredResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::RetiredResource] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::GetRetiredResourceRequest.new + # + # # Call the get_retired_resource method. + # result = client.get_retired_resource request + # + # # The returned object is of type Google::Cloud::Kms::V1::RetiredResource. + # p result + # + def get_retired_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetRetiredResourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_retired_resource.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_retired_resource.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_retired_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.get_retired_resource request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Create a new {::Google::Cloud::Kms::V1::KeyRing KeyRing} in a given Project and # Location. @@ -1460,6 +1675,197 @@ def create_crypto_key_version request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Permanently deletes the given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. + # All child {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} must + # have been previously deleted using + # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion}. + # The specified crypto key will be immediately and permanently deleted upon + # calling this method. This action cannot be undone. + # + # @overload delete_crypto_key(request, options = nil) + # Pass arguments to `delete_crypto_key` via a request object, either of type + # {::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_crypto_key(name: nil) + # Pass arguments to `delete_crypto_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new + # + # # Call the delete_crypto_key method. + # result = client.delete_crypto_key request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_crypto_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_crypto_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_crypto_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_crypto_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.delete_crypto_key request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes the given + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Only possible if + # the version has not been previously imported and if its + # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is one of + # [DESTROYED][CryptoKeyVersionState.DESTROYED], + # [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or + # [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. + # Successfully imported + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} cannot be deleted + # at this time. The specified version will be immediately and permanently + # deleted upon calling this method. This action cannot be undone. + # + # @overload delete_crypto_key_version(request, options = nil) + # Pass arguments to `delete_crypto_key_version` via a request object, either of type + # {::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_crypto_key_version(name: nil) + # Pass arguments to `delete_crypto_key_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/kms/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new + # + # # Call the delete_crypto_key_version method. + # result = client.delete_crypto_key_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_crypto_key_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_crypto_key_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Kms::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_crypto_key_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_crypto_key_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @key_management_service_stub.delete_crypto_key_version request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Import wrapped key material into a # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. @@ -3600,6 +4006,11 @@ class Rpcs # attr_reader :list_import_jobs ## + # RPC-specific configuration for `list_retired_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_retired_resources + ## # RPC-specific configuration for `get_key_ring` # @return [::Gapic::Config::Method] # @@ -3625,6 +4036,11 @@ class Rpcs # attr_reader :get_import_job ## + # RPC-specific configuration for `get_retired_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_retired_resource + ## # RPC-specific configuration for `create_key_ring` # @return [::Gapic::Config::Method] # @@ -3640,6 +4056,16 @@ class Rpcs # attr_reader :create_crypto_key_version ## + # RPC-specific configuration for `delete_crypto_key` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_crypto_key + ## + # RPC-specific configuration for `delete_crypto_key_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_crypto_key_version + ## # RPC-specific configuration for `import_crypto_key_version` # @return [::Gapic::Config::Method] # @@ -3735,6 +4161,8 @@ def initialize parent_rpcs = nil @list_crypto_key_versions = ::Gapic::Config::Method.new list_crypto_key_versions_config list_import_jobs_config = parent_rpcs.list_import_jobs if parent_rpcs.respond_to? :list_import_jobs @list_import_jobs = ::Gapic::Config::Method.new list_import_jobs_config + list_retired_resources_config = parent_rpcs.list_retired_resources if parent_rpcs.respond_to? :list_retired_resources + @list_retired_resources = ::Gapic::Config::Method.new list_retired_resources_config get_key_ring_config = parent_rpcs.get_key_ring if parent_rpcs.respond_to? :get_key_ring @get_key_ring = ::Gapic::Config::Method.new get_key_ring_config get_crypto_key_config = parent_rpcs.get_crypto_key if parent_rpcs.respond_to? :get_crypto_key @@ -3745,12 +4173,18 @@ def initialize parent_rpcs = nil @get_public_key = ::Gapic::Config::Method.new get_public_key_config get_import_job_config = parent_rpcs.get_import_job if parent_rpcs.respond_to? :get_import_job @get_import_job = ::Gapic::Config::Method.new get_import_job_config + get_retired_resource_config = parent_rpcs.get_retired_resource if parent_rpcs.respond_to? :get_retired_resource + @get_retired_resource = ::Gapic::Config::Method.new get_retired_resource_config create_key_ring_config = parent_rpcs.create_key_ring if parent_rpcs.respond_to? :create_key_ring @create_key_ring = ::Gapic::Config::Method.new create_key_ring_config create_crypto_key_config = parent_rpcs.create_crypto_key if parent_rpcs.respond_to? :create_crypto_key @create_crypto_key = ::Gapic::Config::Method.new create_crypto_key_config create_crypto_key_version_config = parent_rpcs.create_crypto_key_version if parent_rpcs.respond_to? :create_crypto_key_version @create_crypto_key_version = ::Gapic::Config::Method.new create_crypto_key_version_config + delete_crypto_key_config = parent_rpcs.delete_crypto_key if parent_rpcs.respond_to? :delete_crypto_key + @delete_crypto_key = ::Gapic::Config::Method.new delete_crypto_key_config + delete_crypto_key_version_config = parent_rpcs.delete_crypto_key_version if parent_rpcs.respond_to? :delete_crypto_key_version + @delete_crypto_key_version = ::Gapic::Config::Method.new delete_crypto_key_version_config import_crypto_key_version_config = parent_rpcs.import_crypto_key_version if parent_rpcs.respond_to? :import_crypto_key_version @import_crypto_key_version = ::Gapic::Config::Method.new import_crypto_key_version_config create_import_job_config = parent_rpcs.create_import_job if parent_rpcs.respond_to? :create_import_job diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/operations.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/operations.rb similarity index 100% rename from owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/operations.rb rename to google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/operations.rb diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb index 4c0357da3a5f..c8198f421cf0 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb @@ -233,6 +233,46 @@ def list_import_jobs request_pb, options = nil end end + ## + # Baseline implementation for the list_retired_resources REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::ListRetiredResourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::ListRetiredResourcesResponse] + # A result object deserialized from the server's reply + def list_retired_resources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_retired_resources_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_retired_resources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + ## # Baseline implementation for the get_key_ring REST call # @@ -433,6 +473,46 @@ def get_import_job request_pb, options = nil end end + ## + # Baseline implementation for the get_retired_resource REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetRetiredResourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Kms::V1::RetiredResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Kms::V1::RetiredResource] + # A result object deserialized from the server's reply + def get_retired_resource request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_retired_resource_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_retired_resource", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Kms::V1::RetiredResource.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + ## # Baseline implementation for the create_key_ring REST call # @@ -553,6 +633,86 @@ def create_crypto_key_version request_pb, options = nil end end + ## + # Baseline implementation for the delete_crypto_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_crypto_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_crypto_key_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_crypto_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_crypto_key_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_crypto_key_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_crypto_key_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + ## # Baseline implementation for the import_crypto_key_version REST call # @@ -1317,6 +1477,27 @@ def self.transcode_list_import_jobs_request request_pb transcoder.transcode request_pb end + ## + # @private + # + # GRPC transcoding helper method for the list_retired_resources REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_retired_resources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/retiredResources", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + ## # @private # @@ -1422,6 +1603,27 @@ def self.transcode_get_import_job_request request_pb transcoder.transcode request_pb end + ## + # @private + # + # GRPC transcoding helper method for the get_retired_resource REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::GetRetiredResourceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_retired_resource_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/retiredResources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + ## # @private # @@ -1488,6 +1690,48 @@ def self.transcode_create_crypto_key_version_request request_pb transcoder.transcode request_pb end + ## + # @private + # + # GRPC transcoding helper method for the delete_crypto_key REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_crypto_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_crypto_key_version REST call + # + # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_crypto_key_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + ## # @private # diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb index 6ca4144f1ac5..3321840e9771 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb @@ -11,7 +11,7 @@ require 'google/protobuf/wrappers_pb' -descriptor_data = "\n#google/cloud/kms/v1/resources.proto\x12\x13google.cloud.kms.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xb5\x01\n\x07KeyRing\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:a\xea\x41^\n\x1f\x63loudkms.googleapis.com/KeyRing\x12;projects/{project}/locations/{location}/keyRings/{key_ring}\"\xa8\x08\n\tCryptoKey\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12;\n\x07primary\x18\x02 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x03\x12\x45\n\x07purpose\x18\x03 \x01(\x0e\x32/.google.cloud.kms.v1.CryptoKey.CryptoKeyPurposeB\x03\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\x12next_rotation_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x0frotation_period\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12G\n\x10version_template\x18\x0b \x01(\x0b\x32-.google.cloud.kms.v1.CryptoKeyVersionTemplate\x12:\n\x06labels\x18\n \x03(\x0b\x32*.google.cloud.kms.v1.CryptoKey.LabelsEntry\x12\x18\n\x0bimport_only\x18\r \x01(\x08\x42\x03\xe0\x41\x05\x12\x42\n\x1a\x64\x65stroy_scheduled_duration\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x05\x12%\n\x12\x63rypto_key_backend\x18\x0f \x01(\tB\t\xe0\x41\x05\xfa\x41\x03\n\x01*\x12\x61\n key_access_justifications_policy\x18\x11 \x01(\x0b\x32\x32.google.cloud.kms.v1.KeyAccessJustificationsPolicyB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb1\x01\n\x10\x43ryptoKeyPurpose\x12\"\n\x1e\x43RYPTO_KEY_PURPOSE_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x45NCRYPT_DECRYPT\x10\x01\x12\x13\n\x0f\x41SYMMETRIC_SIGN\x10\x05\x12\x16\n\x12\x41SYMMETRIC_DECRYPT\x10\x06\x12\x17\n\x13RAW_ENCRYPT_DECRYPT\x10\x07\x12\x07\n\x03MAC\x10\t\x12\x15\n\x11KEY_ENCAPSULATION\x10\n:{\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}B\x13\n\x11rotation_schedule\"\xb3\x01\n\x18\x43ryptoKeyVersionTemplate\x12>\n\x10protection_level\x18\x01 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12W\n\talgorithm\x18\x03 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x02\"\xb1\x03\n\x17KeyOperationAttestation\x12S\n\x06\x66ormat\x18\x04 \x01(\x0e\x32>.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormatB\x03\xe0\x41\x03\x12\x14\n\x07\x63ontent\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x03\x12X\n\x0b\x63\x65rt_chains\x18\x06 \x01(\x0b\x32>.google.cloud.kms.v1.KeyOperationAttestation.CertificateChainsB\x03\xe0\x41\x03\x1a\x64\n\x11\x43\x65rtificateChains\x12\x14\n\x0c\x63\x61vium_certs\x18\x01 \x03(\t\x12\x19\n\x11google_card_certs\x18\x02 \x03(\t\x12\x1e\n\x16google_partition_certs\x18\x03 \x03(\t\"k\n\x11\x41ttestationFormat\x12\"\n\x1e\x41TTESTATION_FORMAT_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43\x41VIUM_V1_COMPRESSED\x10\x03\x12\x18\n\x14\x43\x41VIUM_V2_COMPRESSED\x10\x04\"\xe7\x13\n\x10\x43ryptoKeyVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12J\n\x05state\x18\x03 \x01(\x0e\x32;.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState\x12\x43\n\x10protection_level\x18\x07 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x03\xe0\x41\x03\x12W\n\talgorithm\x18\n \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x03\x12\x46\n\x0b\x61ttestation\x18\x08 \x01(\x0b\x32,.google.cloud.kms.v1.KeyOperationAttestationB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rgenerate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12;\n\x12\x64\x65stroy_event_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x17\n\nimport_job\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0bimport_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x15import_failure_reason\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12&\n\x19generation_failure_reason\x18\x13 \x01(\tB\x03\xe0\x41\x03\x12\x30\n#external_destruction_failure_reason\x18\x14 \x01(\tB\x03\xe0\x41\x03\x12^\n!external_protection_level_options\x18\x11 \x01(\x0b\x32\x33.google.cloud.kms.v1.ExternalProtectionLevelOptions\x12\x1e\n\x11reimport_eligible\x18\x12 \x01(\x08\x42\x03\xe0\x41\x03\"\xc8\x08\n\x19\x43ryptoKeyVersionAlgorithm\x12,\n(CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED\x10\x00\x12\x1f\n\x1bGOOGLE_SYMMETRIC_ENCRYPTION\x10\x01\x12\x0f\n\x0b\x41\x45S_128_GCM\x10)\x12\x0f\n\x0b\x41\x45S_256_GCM\x10\x13\x12\x0f\n\x0b\x41\x45S_128_CBC\x10*\x12\x0f\n\x0b\x41\x45S_256_CBC\x10+\x12\x0f\n\x0b\x41\x45S_128_CTR\x10,\x12\x0f\n\x0b\x41\x45S_256_CTR\x10-\x12\x1c\n\x18RSA_SIGN_PSS_2048_SHA256\x10\x02\x12\x1c\n\x18RSA_SIGN_PSS_3072_SHA256\x10\x03\x12\x1c\n\x18RSA_SIGN_PSS_4096_SHA256\x10\x04\x12\x1c\n\x18RSA_SIGN_PSS_4096_SHA512\x10\x0f\x12\x1e\n\x1aRSA_SIGN_PKCS1_2048_SHA256\x10\x05\x12\x1e\n\x1aRSA_SIGN_PKCS1_3072_SHA256\x10\x06\x12\x1e\n\x1aRSA_SIGN_PKCS1_4096_SHA256\x10\x07\x12\x1e\n\x1aRSA_SIGN_PKCS1_4096_SHA512\x10\x10\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_2048\x10\x1c\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_3072\x10\x1d\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_4096\x10\x1e\x12 \n\x1cRSA_DECRYPT_OAEP_2048_SHA256\x10\x08\x12 \n\x1cRSA_DECRYPT_OAEP_3072_SHA256\x10\t\x12 \n\x1cRSA_DECRYPT_OAEP_4096_SHA256\x10\n\x12 \n\x1cRSA_DECRYPT_OAEP_4096_SHA512\x10\x11\x12\x1e\n\x1aRSA_DECRYPT_OAEP_2048_SHA1\x10%\x12\x1e\n\x1aRSA_DECRYPT_OAEP_3072_SHA1\x10&\x12\x1e\n\x1aRSA_DECRYPT_OAEP_4096_SHA1\x10\'\x12\x17\n\x13\x45\x43_SIGN_P256_SHA256\x10\x0c\x12\x17\n\x13\x45\x43_SIGN_P384_SHA384\x10\r\x12\x1c\n\x18\x45\x43_SIGN_SECP256K1_SHA256\x10\x1f\x12\x13\n\x0f\x45\x43_SIGN_ED25519\x10(\x12\x0f\n\x0bHMAC_SHA256\x10 \x12\r\n\tHMAC_SHA1\x10!\x12\x0f\n\x0bHMAC_SHA384\x10\"\x12\x0f\n\x0bHMAC_SHA512\x10#\x12\x0f\n\x0bHMAC_SHA224\x10$\x12!\n\x1d\x45XTERNAL_SYMMETRIC_ENCRYPTION\x10\x12\x12\x0e\n\nML_KEM_768\x10/\x12\x0f\n\x0bML_KEM_1024\x10\x30\x12\r\n\tKEM_XWING\x10?\x12\x15\n\x11PQ_SIGN_ML_DSA_65\x10\x38\x12\x1d\n\x19PQ_SIGN_SLH_DSA_SHA2_128S\x10\x39\"\x9b\x02\n\x15\x43ryptoKeyVersionState\x12(\n$CRYPTO_KEY_VERSION_STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12PENDING_GENERATION\x10\x05\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03\x12\x15\n\x11\x44\x45STROY_SCHEDULED\x10\x04\x12\x12\n\x0ePENDING_IMPORT\x10\x06\x12\x11\n\rIMPORT_FAILED\x10\x07\x12\x15\n\x11GENERATION_FAILED\x10\x08\x12 \n\x1cPENDING_EXTERNAL_DESTRUCTION\x10\t\x12\x1f\n\x1b\x45XTERNAL_DESTRUCTION_FAILED\x10\n\"I\n\x14\x43ryptoKeyVersionView\x12\'\n#CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46ULL\x10\x01:\xaa\x01\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}\"U\n\x0f\x43hecksummedData\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x34\n\x0f\x63rc32c_checksum\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"\x8c\x05\n\tPublicKey\x12\x0b\n\x03pem\x18\x01 \x01(\t\x12R\n\talgorithm\x18\x02 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm\x12/\n\npem_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x0c\n\x04name\x18\x04 \x01(\t\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12I\n\x11public_key_format\x18\x07 \x01(\x0e\x32..google.cloud.kms.v1.PublicKey.PublicKeyFormat\x12\x38\n\npublic_key\x18\x08 \x01(\x0b\x32$.google.cloud.kms.v1.ChecksummedData\"i\n\x0fPublicKeyFormat\x12!\n\x1dPUBLIC_KEY_FORMAT_UNSPECIFIED\x10\x00\x12\x07\n\x03PEM\x10\x01\x12\x07\n\x03\x44\x45R\x10\x02\x12\x0c\n\x08NIST_PQC\x10\x03\x12\x13\n\x0fXWING_RAW_BYTES\x10\x04:\xae\x01\xea\x41\xaa\x01\n!cloudkms.googleapis.com/PublicKey\x12\x84\x01projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}/publicKey\"\xfb\x08\n\tImportJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12J\n\rimport_method\x18\x02 \x01(\x0e\x32+.google.cloud.kms.v1.ImportJob.ImportMethodB\x06\xe0\x41\x02\xe0\x41\x05\x12\x46\n\x10protection_level\x18\t \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x06\xe0\x41\x02\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rgenerate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12:\n\x11\x65xpire_event_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x05state\x18\x06 \x01(\x0e\x32-.google.cloud.kms.v1.ImportJob.ImportJobStateB\x03\xe0\x41\x03\x12I\n\npublic_key\x18\x07 \x01(\x0b\x32\x30.google.cloud.kms.v1.ImportJob.WrappingPublicKeyB\x03\xe0\x41\x03\x12\x46\n\x0b\x61ttestation\x18\x08 \x01(\x0b\x32,.google.cloud.kms.v1.KeyOperationAttestationB\x03\xe0\x41\x03\x12%\n\x12\x63rypto_key_backend\x18\x0b \x01(\tB\t\xe0\x41\x05\xfa\x41\x03\n\x01*\x1a \n\x11WrappingPublicKey\x12\x0b\n\x03pem\x18\x01 \x01(\t\"\xe5\x01\n\x0cImportMethod\x12\x1d\n\x19IMPORT_METHOD_UNSPECIFIED\x10\x00\x12\x1e\n\x1aRSA_OAEP_3072_SHA1_AES_256\x10\x01\x12\x1e\n\x1aRSA_OAEP_4096_SHA1_AES_256\x10\x02\x12 \n\x1cRSA_OAEP_3072_SHA256_AES_256\x10\x03\x12 \n\x1cRSA_OAEP_4096_SHA256_AES_256\x10\x04\x12\x18\n\x14RSA_OAEP_3072_SHA256\x10\x05\x12\x18\n\x14RSA_OAEP_4096_SHA256\x10\x06\"c\n\x0eImportJobState\x12 \n\x1cIMPORT_JOB_STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12PENDING_GENERATION\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x45XPIRED\x10\x03:{\xea\x41x\n!cloudkms.googleapis.com/ImportJob\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}\"[\n\x1e\x45xternalProtectionLevelOptions\x12\x18\n\x10\x65xternal_key_uri\x18\x01 \x01(\t\x12\x1f\n\x17\x65km_connection_key_path\x18\x02 \x01(\t\"b\n\x1dKeyAccessJustificationsPolicy\x12\x41\n\x16\x61llowed_access_reasons\x18\x01 \x03(\x0e\x32!.google.cloud.kms.v1.AccessReason*\x81\x01\n\x0fProtectionLevel\x12 \n\x1cPROTECTION_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08SOFTWARE\x10\x01\x12\x07\n\x03HSM\x10\x02\x12\x0c\n\x08\x45XTERNAL\x10\x03\x12\x10\n\x0c\x45XTERNAL_VPC\x10\x04\x12\x15\n\x11HSM_SINGLE_TENANT\x10\x05*\xb3\x03\n\x0c\x41\x63\x63\x65ssReason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x43USTOMER_INITIATED_SUPPORT\x10\x01\x12\x1c\n\x18GOOGLE_INITIATED_SERVICE\x10\x02\x12\x1c\n\x18THIRD_PARTY_DATA_REQUEST\x10\x03\x12\x1b\n\x17GOOGLE_INITIATED_REVIEW\x10\x04\x12\x1d\n\x19\x43USTOMER_INITIATED_ACCESS\x10\x05\x12%\n!GOOGLE_INITIATED_SYSTEM_OPERATION\x10\x06\x12\x17\n\x13REASON_NOT_EXPECTED\x10\x07\x12*\n\"MODIFIED_CUSTOMER_INITIATED_ACCESS\x10\x08\x1a\x02\x08\x01\x12\x32\n*MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION\x10\t\x1a\x02\x08\x01\x12\'\n#GOOGLE_RESPONSE_TO_PRODUCTION_ALERT\x10\n\x12*\n&CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING\x10\x0b\x42\x85\x01\n\x17\x63om.google.cloud.kms.v1B\x11KmsResourcesProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1b\x06proto3" +descriptor_data = "\n#google/cloud/kms/v1/resources.proto\x12\x13google.cloud.kms.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xb5\x01\n\x07KeyRing\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:a\xea\x41^\n\x1f\x63loudkms.googleapis.com/KeyRing\x12;projects/{project}/locations/{location}/keyRings/{key_ring}\"\xa8\x08\n\tCryptoKey\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12;\n\x07primary\x18\x02 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x03\x12\x45\n\x07purpose\x18\x03 \x01(\x0e\x32/.google.cloud.kms.v1.CryptoKey.CryptoKeyPurposeB\x03\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\x12next_rotation_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x0frotation_period\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12G\n\x10version_template\x18\x0b \x01(\x0b\x32-.google.cloud.kms.v1.CryptoKeyVersionTemplate\x12:\n\x06labels\x18\n \x03(\x0b\x32*.google.cloud.kms.v1.CryptoKey.LabelsEntry\x12\x18\n\x0bimport_only\x18\r \x01(\x08\x42\x03\xe0\x41\x05\x12\x42\n\x1a\x64\x65stroy_scheduled_duration\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x05\x12%\n\x12\x63rypto_key_backend\x18\x0f \x01(\tB\t\xe0\x41\x05\xfa\x41\x03\n\x01*\x12\x61\n key_access_justifications_policy\x18\x11 \x01(\x0b\x32\x32.google.cloud.kms.v1.KeyAccessJustificationsPolicyB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb1\x01\n\x10\x43ryptoKeyPurpose\x12\"\n\x1e\x43RYPTO_KEY_PURPOSE_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x45NCRYPT_DECRYPT\x10\x01\x12\x13\n\x0f\x41SYMMETRIC_SIGN\x10\x05\x12\x16\n\x12\x41SYMMETRIC_DECRYPT\x10\x06\x12\x17\n\x13RAW_ENCRYPT_DECRYPT\x10\x07\x12\x07\n\x03MAC\x10\t\x12\x15\n\x11KEY_ENCAPSULATION\x10\n:{\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}B\x13\n\x11rotation_schedule\"\xb3\x01\n\x18\x43ryptoKeyVersionTemplate\x12>\n\x10protection_level\x18\x01 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12W\n\talgorithm\x18\x03 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x02\"\xb1\x03\n\x17KeyOperationAttestation\x12S\n\x06\x66ormat\x18\x04 \x01(\x0e\x32>.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormatB\x03\xe0\x41\x03\x12\x14\n\x07\x63ontent\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x03\x12X\n\x0b\x63\x65rt_chains\x18\x06 \x01(\x0b\x32>.google.cloud.kms.v1.KeyOperationAttestation.CertificateChainsB\x03\xe0\x41\x03\x1a\x64\n\x11\x43\x65rtificateChains\x12\x14\n\x0c\x63\x61vium_certs\x18\x01 \x03(\t\x12\x19\n\x11google_card_certs\x18\x02 \x03(\t\x12\x1e\n\x16google_partition_certs\x18\x03 \x03(\t\"k\n\x11\x41ttestationFormat\x12\"\n\x1e\x41TTESTATION_FORMAT_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43\x41VIUM_V1_COMPRESSED\x10\x03\x12\x18\n\x14\x43\x41VIUM_V2_COMPRESSED\x10\x04\"\xe7\x13\n\x10\x43ryptoKeyVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12J\n\x05state\x18\x03 \x01(\x0e\x32;.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState\x12\x43\n\x10protection_level\x18\x07 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x03\xe0\x41\x03\x12W\n\talgorithm\x18\n \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x03\x12\x46\n\x0b\x61ttestation\x18\x08 \x01(\x0b\x32,.google.cloud.kms.v1.KeyOperationAttestationB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rgenerate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12;\n\x12\x64\x65stroy_event_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x17\n\nimport_job\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0bimport_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x15import_failure_reason\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12&\n\x19generation_failure_reason\x18\x13 \x01(\tB\x03\xe0\x41\x03\x12\x30\n#external_destruction_failure_reason\x18\x14 \x01(\tB\x03\xe0\x41\x03\x12^\n!external_protection_level_options\x18\x11 \x01(\x0b\x32\x33.google.cloud.kms.v1.ExternalProtectionLevelOptions\x12\x1e\n\x11reimport_eligible\x18\x12 \x01(\x08\x42\x03\xe0\x41\x03\"\xc8\x08\n\x19\x43ryptoKeyVersionAlgorithm\x12,\n(CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED\x10\x00\x12\x1f\n\x1bGOOGLE_SYMMETRIC_ENCRYPTION\x10\x01\x12\x0f\n\x0b\x41\x45S_128_GCM\x10)\x12\x0f\n\x0b\x41\x45S_256_GCM\x10\x13\x12\x0f\n\x0b\x41\x45S_128_CBC\x10*\x12\x0f\n\x0b\x41\x45S_256_CBC\x10+\x12\x0f\n\x0b\x41\x45S_128_CTR\x10,\x12\x0f\n\x0b\x41\x45S_256_CTR\x10-\x12\x1c\n\x18RSA_SIGN_PSS_2048_SHA256\x10\x02\x12\x1c\n\x18RSA_SIGN_PSS_3072_SHA256\x10\x03\x12\x1c\n\x18RSA_SIGN_PSS_4096_SHA256\x10\x04\x12\x1c\n\x18RSA_SIGN_PSS_4096_SHA512\x10\x0f\x12\x1e\n\x1aRSA_SIGN_PKCS1_2048_SHA256\x10\x05\x12\x1e\n\x1aRSA_SIGN_PKCS1_3072_SHA256\x10\x06\x12\x1e\n\x1aRSA_SIGN_PKCS1_4096_SHA256\x10\x07\x12\x1e\n\x1aRSA_SIGN_PKCS1_4096_SHA512\x10\x10\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_2048\x10\x1c\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_3072\x10\x1d\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_4096\x10\x1e\x12 \n\x1cRSA_DECRYPT_OAEP_2048_SHA256\x10\x08\x12 \n\x1cRSA_DECRYPT_OAEP_3072_SHA256\x10\t\x12 \n\x1cRSA_DECRYPT_OAEP_4096_SHA256\x10\n\x12 \n\x1cRSA_DECRYPT_OAEP_4096_SHA512\x10\x11\x12\x1e\n\x1aRSA_DECRYPT_OAEP_2048_SHA1\x10%\x12\x1e\n\x1aRSA_DECRYPT_OAEP_3072_SHA1\x10&\x12\x1e\n\x1aRSA_DECRYPT_OAEP_4096_SHA1\x10\'\x12\x17\n\x13\x45\x43_SIGN_P256_SHA256\x10\x0c\x12\x17\n\x13\x45\x43_SIGN_P384_SHA384\x10\r\x12\x1c\n\x18\x45\x43_SIGN_SECP256K1_SHA256\x10\x1f\x12\x13\n\x0f\x45\x43_SIGN_ED25519\x10(\x12\x0f\n\x0bHMAC_SHA256\x10 \x12\r\n\tHMAC_SHA1\x10!\x12\x0f\n\x0bHMAC_SHA384\x10\"\x12\x0f\n\x0bHMAC_SHA512\x10#\x12\x0f\n\x0bHMAC_SHA224\x10$\x12!\n\x1d\x45XTERNAL_SYMMETRIC_ENCRYPTION\x10\x12\x12\x0e\n\nML_KEM_768\x10/\x12\x0f\n\x0bML_KEM_1024\x10\x30\x12\r\n\tKEM_XWING\x10?\x12\x15\n\x11PQ_SIGN_ML_DSA_65\x10\x38\x12\x1d\n\x19PQ_SIGN_SLH_DSA_SHA2_128S\x10\x39\"\x9b\x02\n\x15\x43ryptoKeyVersionState\x12(\n$CRYPTO_KEY_VERSION_STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12PENDING_GENERATION\x10\x05\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03\x12\x15\n\x11\x44\x45STROY_SCHEDULED\x10\x04\x12\x12\n\x0ePENDING_IMPORT\x10\x06\x12\x11\n\rIMPORT_FAILED\x10\x07\x12\x15\n\x11GENERATION_FAILED\x10\x08\x12 \n\x1cPENDING_EXTERNAL_DESTRUCTION\x10\t\x12\x1f\n\x1b\x45XTERNAL_DESTRUCTION_FAILED\x10\n\"I\n\x14\x43ryptoKeyVersionView\x12\'\n#CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46ULL\x10\x01:\xaa\x01\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}\"U\n\x0f\x43hecksummedData\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x34\n\x0f\x63rc32c_checksum\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"\x8c\x05\n\tPublicKey\x12\x0b\n\x03pem\x18\x01 \x01(\t\x12R\n\talgorithm\x18\x02 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm\x12/\n\npem_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x0c\n\x04name\x18\x04 \x01(\t\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12I\n\x11public_key_format\x18\x07 \x01(\x0e\x32..google.cloud.kms.v1.PublicKey.PublicKeyFormat\x12\x38\n\npublic_key\x18\x08 \x01(\x0b\x32$.google.cloud.kms.v1.ChecksummedData\"i\n\x0fPublicKeyFormat\x12!\n\x1dPUBLIC_KEY_FORMAT_UNSPECIFIED\x10\x00\x12\x07\n\x03PEM\x10\x01\x12\x07\n\x03\x44\x45R\x10\x02\x12\x0c\n\x08NIST_PQC\x10\x03\x12\x13\n\x0fXWING_RAW_BYTES\x10\x04:\xae\x01\xea\x41\xaa\x01\n!cloudkms.googleapis.com/PublicKey\x12\x84\x01projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}/publicKey\"\xfb\x08\n\tImportJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12J\n\rimport_method\x18\x02 \x01(\x0e\x32+.google.cloud.kms.v1.ImportJob.ImportMethodB\x06\xe0\x41\x02\xe0\x41\x05\x12\x46\n\x10protection_level\x18\t \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x06\xe0\x41\x02\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rgenerate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12:\n\x11\x65xpire_event_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x05state\x18\x06 \x01(\x0e\x32-.google.cloud.kms.v1.ImportJob.ImportJobStateB\x03\xe0\x41\x03\x12I\n\npublic_key\x18\x07 \x01(\x0b\x32\x30.google.cloud.kms.v1.ImportJob.WrappingPublicKeyB\x03\xe0\x41\x03\x12\x46\n\x0b\x61ttestation\x18\x08 \x01(\x0b\x32,.google.cloud.kms.v1.KeyOperationAttestationB\x03\xe0\x41\x03\x12%\n\x12\x63rypto_key_backend\x18\x0b \x01(\tB\t\xe0\x41\x05\xfa\x41\x03\n\x01*\x1a \n\x11WrappingPublicKey\x12\x0b\n\x03pem\x18\x01 \x01(\t\"\xe5\x01\n\x0cImportMethod\x12\x1d\n\x19IMPORT_METHOD_UNSPECIFIED\x10\x00\x12\x1e\n\x1aRSA_OAEP_3072_SHA1_AES_256\x10\x01\x12\x1e\n\x1aRSA_OAEP_4096_SHA1_AES_256\x10\x02\x12 \n\x1cRSA_OAEP_3072_SHA256_AES_256\x10\x03\x12 \n\x1cRSA_OAEP_4096_SHA256_AES_256\x10\x04\x12\x18\n\x14RSA_OAEP_3072_SHA256\x10\x05\x12\x18\n\x14RSA_OAEP_4096_SHA256\x10\x06\"c\n\x0eImportJobState\x12 \n\x1cIMPORT_JOB_STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12PENDING_GENERATION\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x45XPIRED\x10\x03:{\xea\x41x\n!cloudkms.googleapis.com/ImportJob\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}\"[\n\x1e\x45xternalProtectionLevelOptions\x12\x18\n\x10\x65xternal_key_uri\x18\x01 \x01(\t\x12\x1f\n\x17\x65km_connection_key_path\x18\x02 \x01(\t\"b\n\x1dKeyAccessJustificationsPolicy\x12\x41\n\x16\x61llowed_access_reasons\x18\x01 \x03(\x0e\x32!.google.cloud.kms.v1.AccessReason\"\xb9\x02\n\x0fRetiredResource\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x1e\n\x11original_resource\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rresource_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\x9d\x01\xea\x41\x99\x01\n\'cloudkms.googleapis.com/RetiredResource\x12Kprojects/{project}/locations/{location}/retiredResources/{retired_resource}*\x10retiredResources2\x0fretiredResource*\x81\x01\n\x0fProtectionLevel\x12 \n\x1cPROTECTION_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08SOFTWARE\x10\x01\x12\x07\n\x03HSM\x10\x02\x12\x0c\n\x08\x45XTERNAL\x10\x03\x12\x10\n\x0c\x45XTERNAL_VPC\x10\x04\x12\x15\n\x11HSM_SINGLE_TENANT\x10\x05*\xb3\x03\n\x0c\x41\x63\x63\x65ssReason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x43USTOMER_INITIATED_SUPPORT\x10\x01\x12\x1c\n\x18GOOGLE_INITIATED_SERVICE\x10\x02\x12\x1c\n\x18THIRD_PARTY_DATA_REQUEST\x10\x03\x12\x1b\n\x17GOOGLE_INITIATED_REVIEW\x10\x04\x12\x1d\n\x19\x43USTOMER_INITIATED_ACCESS\x10\x05\x12%\n!GOOGLE_INITIATED_SYSTEM_OPERATION\x10\x06\x12\x17\n\x13REASON_NOT_EXPECTED\x10\x07\x12*\n\"MODIFIED_CUSTOMER_INITIATED_ACCESS\x10\x08\x1a\x02\x08\x01\x12\x32\n*MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION\x10\t\x1a\x02\x08\x01\x12\'\n#GOOGLE_RESPONSE_TO_PRODUCTION_ALERT\x10\n\x12*\n&CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING\x10\x0b\x42\x85\x01\n\x17\x63om.google.cloud.kms.v1B\x11KmsResourcesProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -64,6 +64,7 @@ module V1 ImportJob::ImportJobState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportJob.ImportJobState").enummodule ExternalProtectionLevelOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ExternalProtectionLevelOptions").msgclass KeyAccessJustificationsPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyAccessJustificationsPolicy").msgclass + RetiredResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RetiredResource").msgclass ProtectionLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ProtectionLevel").enummodule AccessReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AccessReason").enummodule end diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb index 268eafe71d05..688dad631edd 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb @@ -9,11 +9,13 @@ require 'google/api/field_behavior_pb' require 'google/api/resource_pb' require 'google/cloud/kms/v1/resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' require 'google/protobuf/field_mask_pb' require 'google/protobuf/wrappers_pb' -descriptor_data = "\n!google/cloud/kms/v1/service.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/kms/v1/resources.proto\x1a google/protobuf/field_mask.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xad\x01\n\x13ListKeyRingsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xff\x01\n\x15ListCryptoKeysRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12P\n\x0cversion_view\x18\x04 \x01(\x0e\x32:.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"\x80\x02\n\x1cListCryptoKeyVersionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12H\n\x04view\x18\x04 \x01(\x0e\x32:.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"\xad\x01\n\x15ListImportJobsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"t\n\x14ListKeyRingsResponse\x12/\n\tkey_rings\x18\x01 \x03(\x0b\x32\x1c.google.cloud.kms.v1.KeyRing\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"z\n\x16ListCryptoKeysResponse\x12\x33\n\x0b\x63rypto_keys\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKey\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x90\x01\n\x1dListCryptoKeyVersionsResponse\x12\x42\n\x13\x63rypto_key_versions\x18\x01 \x03(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"z\n\x16ListImportJobsResponse\x12\x33\n\x0bimport_jobs\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.ImportJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"J\n\x11GetKeyRingRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\"N\n\x13GetCryptoKeyRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\\\n\x1aGetCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\xa5\x01\n\x13GetPublicKeyRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12N\n\x11public_key_format\x18\x02 \x01(\x0e\x32..google.cloud.kms.v1.PublicKey.PublicKeyFormatB\x03\xe0\x41\x01\"N\n\x13GetImportJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/ImportJob\"\xa0\x01\n\x14\x43reateKeyRingRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x18\n\x0bkey_ring_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x08key_ring\x18\x03 \x01(\x0b\x32\x1c.google.cloud.kms.v1.KeyRingB\x03\xe0\x41\x02\"\xcd\x01\n\x16\x43reateCryptoKeyRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x1a\n\rcrypto_key_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\ncrypto_key\x18\x03 \x01(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKeyB\x03\xe0\x41\x02\x12%\n\x1dskip_initial_version_creation\x18\x05 \x01(\x08\"\xa2\x01\n\x1d\x43reateCryptoKeyVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x46\n\x12\x63rypto_key_version\x18\x02 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x02\"\xf0\x02\n\x1dImportCryptoKeyVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12L\n\x12\x63rypto_key_version\x18\x06 \x01(\tB0\xe0\x41\x01\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12W\n\talgorithm\x18\x02 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x02\x12\x17\n\nimport_job\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0bwrapped_key\x18\x08 \x01(\x0c\x42\x03\xe0\x41\x01\x12\"\n\x13rsa_aes_wrapped_key\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x01H\x00\x42\x16\n\x14wrapped_key_material\"\xa6\x01\n\x16\x43reateImportJobRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x1a\n\rimport_job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\nimport_job\x18\x03 \x01(\x0b\x32\x1e.google.cloud.kms.v1.ImportJobB\x03\xe0\x41\x02\"\x87\x01\n\x16UpdateCryptoKeyRequest\x12\x37\n\ncrypto_key\x18\x01 \x01(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKeyB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x9d\x01\n\x1dUpdateCryptoKeyVersionRequest\x12\x46\n\x12\x63rypto_key_version\x18\x01 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x83\x01\n$UpdateCryptoKeyPrimaryVersionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\"\n\x15\x63rypto_key_version_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"`\n\x1e\x44\x65stroyCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"`\n\x1eRestoreCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\xf9\x01\n\x0e\x45ncryptRequest\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x16\n\tplaintext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12:\n\x10plaintext_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x08 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x9b\x02\n\x0e\x44\x65\x63ryptRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12;\n\x11\x63iphertext_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x06 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xe2\x02\n\x11RawEncryptRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tplaintext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12:\n\x10plaintext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\"\n\x15initialization_vector\x18\x06 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x46\n\x1cinitialization_vector_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xf8\x02\n\x11RawDecryptRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12\"\n\x15initialization_vector\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x12\n\ntag_length\x18\x05 \x01(\x05\x12;\n\x11\x63iphertext_crc32c\x18\x06 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x46\n\x1cinitialization_vector_crc32c\x18\x08 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x8c\x02\n\x15\x41symmetricSignRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x30\n\x06\x64igest\x18\x03 \x01(\x0b\x32\x1b.google.cloud.kms.v1.DigestB\x03\xe0\x41\x01\x12\x37\n\rdigest_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x11\n\x04\x64\x61ta\x18\x06 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xb0\x01\n\x18\x41symmetricDecryptRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x17\n\nciphertext\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x02\x12;\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x9a\x01\n\x0eMacSignRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xe4\x01\n\x10MacVerifyRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x10\n\x03mac\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x34\n\nmac_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xaa\x01\n\x12\x44\x65\x63\x61psulateRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12;\n\x11\x63iphertext_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x84\x01\n\x1aGenerateRandomBytesRequest\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x14\n\x0clength_bytes\x18\x02 \x01(\x05\x12>\n\x10protection_level\x18\x03 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\x85\x02\n\x0f\x45ncryptResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nciphertext\x18\x02 \x01(\x0c\x12\x36\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12!\n\x19verified_plaintext_crc32c\x18\x05 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x06 \x01(\x08\x12>\n\x10protection_level\x18\x07 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xb1\x01\n\x0f\x44\x65\x63ryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x14\n\x0cused_primary\x18\x03 \x01(\x08\x12>\n\x10protection_level\x18\x04 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xad\x03\n\x12RawEncryptResponse\x12\x12\n\nciphertext\x18\x01 \x01(\x0c\x12\x1d\n\x15initialization_vector\x18\x02 \x01(\x0c\x12\x12\n\ntag_length\x18\x03 \x01(\x05\x12\x36\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x41\n\x1cinitialization_vector_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12!\n\x19verified_plaintext_crc32c\x18\x06 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x07 \x01(\x08\x12-\n%verified_initialization_vector_crc32c\x18\n \x01(\x08\x12\x0c\n\x04name\x18\x08 \x01(\t\x12>\n\x10protection_level\x18\t \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xa8\x02\n\x12RawDecryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12>\n\x10protection_level\x18\x03 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12\"\n\x1averified_ciphertext_crc32c\x18\x04 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x05 \x01(\x08\x12-\n%verified_initialization_vector_crc32c\x18\x06 \x01(\x08\"\xee\x01\n\x16\x41symmetricSignResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\x35\n\x10signature_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x1e\n\x16verified_digest_crc32c\x18\x03 \x01(\x08\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x1c\n\x14verified_data_crc32c\x18\x05 \x01(\x08\x12>\n\x10protection_level\x18\x06 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xc9\x01\n\x19\x41symmetricDecryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\"\n\x1averified_ciphertext_crc32c\x18\x03 \x01(\x08\x12>\n\x10protection_level\x18\x04 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xbb\x01\n\x0fMacSignResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03mac\x18\x02 \x01(\x0c\x12/\n\nmac_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x1c\n\x14verified_data_crc32c\x18\x04 \x01(\x08\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xd1\x01\n\x11MacVerifyResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x1c\n\x14verified_data_crc32c\x18\x03 \x01(\x08\x12\x1b\n\x13verified_mac_crc32c\x18\x04 \x01(\x08\x12\"\n\x1averified_success_integrity\x18\x05 \x01(\x08\x12>\n\x10protection_level\x18\x06 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xda\x01\n\x13\x44\x65\x63\x61psulateResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rshared_secret\x18\x02 \x01(\x0c\x12!\n\x14shared_secret_crc32c\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12\"\n\x1averified_ciphertext_crc32c\x18\x04 \x01(\x08\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x17\n\x15_shared_secret_crc32c\"]\n\x1bGenerateRandomBytesResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x30\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"H\n\x06\x44igest\x12\x10\n\x06sha256\x18\x01 \x01(\x0cH\x00\x12\x10\n\x06sha384\x18\x02 \x01(\x0cH\x00\x12\x10\n\x06sha512\x18\x03 \x01(\x0cH\x00\x42\x08\n\x06\x64igest\"e\n\x10LocationMetadata\x12\x15\n\rhsm_available\x18\x01 \x01(\x08\x12\x15\n\rekm_available\x18\x02 \x01(\x08\x12#\n\x1bhsm_single_tenant_available\x18\x03 \x01(\x08\x32\xd9/\n\x14KeyManagementService\x12\xa2\x01\n\x0cListKeyRings\x12(.google.cloud.kms.v1.ListKeyRingsRequest\x1a).google.cloud.kms.v1.ListKeyRingsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/keyRings\x12\xb5\x01\n\x0eListCryptoKeys\x12*.google.cloud.kms.v1.ListCryptoKeysRequest\x1a+.google.cloud.kms.v1.ListCryptoKeysResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys\x12\xde\x01\n\x15ListCryptoKeyVersions\x12\x31.google.cloud.kms.v1.ListCryptoKeyVersionsRequest\x1a\x32.google.cloud.kms.v1.ListCryptoKeyVersionsResponse\"^\xda\x41\x06parent\x82\xd3\xe4\x93\x02O\x12M/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions\x12\xb5\x01\n\x0eListImportJobs\x12*.google.cloud.kms.v1.ListImportJobsRequest\x1a+.google.cloud.kms.v1.ListImportJobsResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs\x12\x8f\x01\n\nGetKeyRing\x12&.google.cloud.kms.v1.GetKeyRingRequest\x1a\x1c.google.cloud.kms.v1.KeyRing\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/keyRings/*}\x12\xa2\x01\n\x0cGetCryptoKey\x12(.google.cloud.kms.v1.GetCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}\x12\xcb\x01\n\x13GetCryptoKeyVersion\x12/.google.cloud.kms.v1.GetCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\\\xda\x41\x04name\x82\xd3\xe4\x93\x02O\x12M/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}\x12\xc0\x01\n\x0cGetPublicKey\x12(.google.cloud.kms.v1.GetPublicKeyRequest\x1a\x1e.google.cloud.kms.v1.PublicKey\"f\xda\x41\x04name\x82\xd3\xe4\x93\x02Y\x12W/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}/publicKey\x12\xa2\x01\n\x0cGetImportJob\x12(.google.cloud.kms.v1.GetImportJobRequest\x1a\x1e.google.cloud.kms.v1.ImportJob\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/keyRings/*/importJobs/*}\x12\xb6\x01\n\rCreateKeyRing\x12).google.cloud.kms.v1.CreateKeyRingRequest\x1a\x1c.google.cloud.kms.v1.KeyRing\"\\\xda\x41\x1bparent,key_ring_id,key_ring\x82\xd3\xe4\x93\x02\x38\",/v1/{parent=projects/*/locations/*}/keyRings:\x08key_ring\x12\xcf\x01\n\x0f\x43reateCryptoKey\x12+.google.cloud.kms.v1.CreateCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"o\xda\x41\x1fparent,crypto_key_id,crypto_key\x82\xd3\xe4\x93\x02G\"9/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys:\ncrypto_key\x12\xfb\x01\n\x16\x43reateCryptoKeyVersion\x12\x32.google.cloud.kms.v1.CreateCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\x85\x01\xda\x41\x19parent,crypto_key_version\x82\xd3\xe4\x93\x02\x63\"M/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:\x12\x63rypto_key_version\x12\xd4\x01\n\x16ImportCryptoKeyVersion\x12\x32.google.cloud.kms.v1.ImportCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"_\x82\xd3\xe4\x93\x02Y\"T/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:import:\x01*\x12\xcf\x01\n\x0f\x43reateImportJob\x12+.google.cloud.kms.v1.CreateImportJobRequest\x1a\x1e.google.cloud.kms.v1.ImportJob\"o\xda\x41\x1fparent,import_job_id,import_job\x82\xd3\xe4\x93\x02G\"9/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs:\nimport_job\x12\xd1\x01\n\x0fUpdateCryptoKey\x12+.google.cloud.kms.v1.UpdateCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"q\xda\x41\x16\x63rypto_key,update_mask\x82\xd3\xe4\x93\x02R2D/v1/{crypto_key.name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:\ncrypto_key\x12\x93\x02\n\x16UpdateCryptoKeyVersion\x12\x32.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\x9d\x01\xda\x41\x1e\x63rypto_key_version,update_mask\x82\xd3\xe4\x93\x02v2`/v1/{crypto_key_version.name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:\x12\x63rypto_key_version\x12\xf2\x01\n\x1dUpdateCryptoKeyPrimaryVersion\x12\x39.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"v\xda\x41\x1aname,crypto_key_version_id\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:updatePrimaryVersion:\x01*\x12\xde\x01\n\x17\x44\x65stroyCryptoKeyVersion\x12\x33.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:destroy:\x01*\x12\xde\x01\n\x17RestoreCryptoKeyVersion\x12\x33.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:restore:\x01*\x12\xb4\x01\n\x07\x45ncrypt\x12#.google.cloud.kms.v1.EncryptRequest\x1a$.google.cloud.kms.v1.EncryptResponse\"^\xda\x41\x0ename,plaintext\x82\xd3\xe4\x93\x02G\"B/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/**}:encrypt:\x01*\x12\xb4\x01\n\x07\x44\x65\x63rypt\x12#.google.cloud.kms.v1.DecryptRequest\x1a$.google.cloud.kms.v1.DecryptResponse\"^\xda\x41\x0fname,ciphertext\x82\xd3\xe4\x93\x02\x46\"A/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:decrypt:\x01*\x12\xc2\x01\n\nRawEncrypt\x12&.google.cloud.kms.v1.RawEncryptRequest\x1a\'.google.cloud.kms.v1.RawEncryptResponse\"c\x82\xd3\xe4\x93\x02]\"X/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawEncrypt:\x01*\x12\xc2\x01\n\nRawDecrypt\x12&.google.cloud.kms.v1.RawDecryptRequest\x1a\'.google.cloud.kms.v1.RawDecryptResponse\"c\x82\xd3\xe4\x93\x02]\"X/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawDecrypt:\x01*\x12\xe0\x01\n\x0e\x41symmetricSign\x12*.google.cloud.kms.v1.AsymmetricSignRequest\x1a+.google.cloud.kms.v1.AsymmetricSignResponse\"u\xda\x41\x0bname,digest\x82\xd3\xe4\x93\x02\x61\"\\/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricSign:\x01*\x12\xf0\x01\n\x11\x41symmetricDecrypt\x12-.google.cloud.kms.v1.AsymmetricDecryptRequest\x1a..google.cloud.kms.v1.AsymmetricDecryptResponse\"|\xda\x41\x0fname,ciphertext\x82\xd3\xe4\x93\x02\x64\"_/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricDecrypt:\x01*\x12\xc2\x01\n\x07MacSign\x12#.google.cloud.kms.v1.MacSignRequest\x1a$.google.cloud.kms.v1.MacSignResponse\"l\xda\x41\tname,data\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macSign:\x01*\x12\xce\x01\n\tMacVerify\x12%.google.cloud.kms.v1.MacVerifyRequest\x1a&.google.cloud.kms.v1.MacVerifyResponse\"r\xda\x41\rname,data,mac\x82\xd3\xe4\x93\x02\\\"W/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macVerify:\x01*\x12\xc6\x01\n\x0b\x44\x65\x63\x61psulate\x12\'.google.cloud.kms.v1.DecapsulateRequest\x1a(.google.cloud.kms.v1.DecapsulateResponse\"d\x82\xd3\xe4\x93\x02^\"Y/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:decapsulate:\x01*\x12\xe7\x01\n\x13GenerateRandomBytes\x12/.google.cloud.kms.v1.GenerateRandomBytesRequest\x1a\x30.google.cloud.kms.v1.GenerateRandomBytesResponse\"m\xda\x41&location,length_bytes,protection_level\x82\xd3\xe4\x93\x02>\"9/v1/{location=projects/*/locations/*}:generateRandomBytes:\x01*\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsB|\n\x17\x63om.google.cloud.kms.v1B\x08KmsProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1b\x06proto3" +descriptor_data = "\n!google/cloud/kms/v1/service.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/kms/v1/resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xad\x01\n\x13ListKeyRingsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xff\x01\n\x15ListCryptoKeysRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12P\n\x0cversion_view\x18\x04 \x01(\x0e\x32:.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"\x80\x02\n\x1cListCryptoKeyVersionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12H\n\x04view\x18\x04 \x01(\x0e\x32:.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"\xad\x01\n\x15ListImportJobsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x8f\x01\n\x1bListRetiredResourcesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'cloudkms.googleapis.com/RetiredResource\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"t\n\x14ListKeyRingsResponse\x12/\n\tkey_rings\x18\x01 \x03(\x0b\x32\x1c.google.cloud.kms.v1.KeyRing\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"z\n\x16ListCryptoKeysResponse\x12\x33\n\x0b\x63rypto_keys\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKey\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x90\x01\n\x1dListCryptoKeyVersionsResponse\x12\x42\n\x13\x63rypto_key_versions\x18\x01 \x03(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"z\n\x16ListImportJobsResponse\x12\x33\n\x0bimport_jobs\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.ImportJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x8c\x01\n\x1cListRetiredResourcesResponse\x12?\n\x11retired_resources\x18\x01 \x03(\x0b\x32$.google.cloud.kms.v1.RetiredResource\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x03\"J\n\x11GetKeyRingRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\"N\n\x13GetCryptoKeyRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\\\n\x1aGetCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\xa5\x01\n\x13GetPublicKeyRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12N\n\x11public_key_format\x18\x02 \x01(\x0e\x32..google.cloud.kms.v1.PublicKey.PublicKeyFormatB\x03\xe0\x41\x01\"N\n\x13GetImportJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/ImportJob\"Z\n\x19GetRetiredResourceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'cloudkms.googleapis.com/RetiredResource\"\xa0\x01\n\x14\x43reateKeyRingRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x18\n\x0bkey_ring_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x08key_ring\x18\x03 \x01(\x0b\x32\x1c.google.cloud.kms.v1.KeyRingB\x03\xe0\x41\x02\"\xcd\x01\n\x16\x43reateCryptoKeyRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x1a\n\rcrypto_key_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\ncrypto_key\x18\x03 \x01(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKeyB\x03\xe0\x41\x02\x12%\n\x1dskip_initial_version_creation\x18\x05 \x01(\x08\"\xa2\x01\n\x1d\x43reateCryptoKeyVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x46\n\x12\x63rypto_key_version\x18\x02 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x02\"Q\n\x16\x44\x65leteCryptoKeyRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"_\n\x1d\x44\x65leteCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\xf0\x02\n\x1dImportCryptoKeyVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12L\n\x12\x63rypto_key_version\x18\x06 \x01(\tB0\xe0\x41\x01\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12W\n\talgorithm\x18\x02 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x02\x12\x17\n\nimport_job\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0bwrapped_key\x18\x08 \x01(\x0c\x42\x03\xe0\x41\x01\x12\"\n\x13rsa_aes_wrapped_key\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x01H\x00\x42\x16\n\x14wrapped_key_material\"\xa6\x01\n\x16\x43reateImportJobRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x1a\n\rimport_job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\nimport_job\x18\x03 \x01(\x0b\x32\x1e.google.cloud.kms.v1.ImportJobB\x03\xe0\x41\x02\"\x87\x01\n\x16UpdateCryptoKeyRequest\x12\x37\n\ncrypto_key\x18\x01 \x01(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKeyB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x9d\x01\n\x1dUpdateCryptoKeyVersionRequest\x12\x46\n\x12\x63rypto_key_version\x18\x01 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x83\x01\n$UpdateCryptoKeyPrimaryVersionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\"\n\x15\x63rypto_key_version_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"`\n\x1e\x44\x65stroyCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"`\n\x1eRestoreCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\xf9\x01\n\x0e\x45ncryptRequest\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x16\n\tplaintext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12:\n\x10plaintext_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x08 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x9b\x02\n\x0e\x44\x65\x63ryptRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12;\n\x11\x63iphertext_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x06 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xe2\x02\n\x11RawEncryptRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tplaintext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12:\n\x10plaintext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\"\n\x15initialization_vector\x18\x06 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x46\n\x1cinitialization_vector_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xf8\x02\n\x11RawDecryptRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12\"\n\x15initialization_vector\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x12\n\ntag_length\x18\x05 \x01(\x05\x12;\n\x11\x63iphertext_crc32c\x18\x06 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x46\n\x1cinitialization_vector_crc32c\x18\x08 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x8c\x02\n\x15\x41symmetricSignRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x30\n\x06\x64igest\x18\x03 \x01(\x0b\x32\x1b.google.cloud.kms.v1.DigestB\x03\xe0\x41\x01\x12\x37\n\rdigest_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x11\n\x04\x64\x61ta\x18\x06 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xb0\x01\n\x18\x41symmetricDecryptRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x17\n\nciphertext\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x02\x12;\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x9a\x01\n\x0eMacSignRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xe4\x01\n\x10MacVerifyRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x10\n\x03mac\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x34\n\nmac_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xaa\x01\n\x12\x44\x65\x63\x61psulateRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12;\n\x11\x63iphertext_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x84\x01\n\x1aGenerateRandomBytesRequest\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x14\n\x0clength_bytes\x18\x02 \x01(\x05\x12>\n\x10protection_level\x18\x03 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\x85\x02\n\x0f\x45ncryptResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nciphertext\x18\x02 \x01(\x0c\x12\x36\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12!\n\x19verified_plaintext_crc32c\x18\x05 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x06 \x01(\x08\x12>\n\x10protection_level\x18\x07 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xb1\x01\n\x0f\x44\x65\x63ryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x14\n\x0cused_primary\x18\x03 \x01(\x08\x12>\n\x10protection_level\x18\x04 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xad\x03\n\x12RawEncryptResponse\x12\x12\n\nciphertext\x18\x01 \x01(\x0c\x12\x1d\n\x15initialization_vector\x18\x02 \x01(\x0c\x12\x12\n\ntag_length\x18\x03 \x01(\x05\x12\x36\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x41\n\x1cinitialization_vector_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12!\n\x19verified_plaintext_crc32c\x18\x06 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x07 \x01(\x08\x12-\n%verified_initialization_vector_crc32c\x18\n \x01(\x08\x12\x0c\n\x04name\x18\x08 \x01(\t\x12>\n\x10protection_level\x18\t \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xa8\x02\n\x12RawDecryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12>\n\x10protection_level\x18\x03 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12\"\n\x1averified_ciphertext_crc32c\x18\x04 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x05 \x01(\x08\x12-\n%verified_initialization_vector_crc32c\x18\x06 \x01(\x08\"\xee\x01\n\x16\x41symmetricSignResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\x35\n\x10signature_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x1e\n\x16verified_digest_crc32c\x18\x03 \x01(\x08\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x1c\n\x14verified_data_crc32c\x18\x05 \x01(\x08\x12>\n\x10protection_level\x18\x06 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xc9\x01\n\x19\x41symmetricDecryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\"\n\x1averified_ciphertext_crc32c\x18\x03 \x01(\x08\x12>\n\x10protection_level\x18\x04 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xbb\x01\n\x0fMacSignResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03mac\x18\x02 \x01(\x0c\x12/\n\nmac_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x1c\n\x14verified_data_crc32c\x18\x04 \x01(\x08\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xd1\x01\n\x11MacVerifyResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x1c\n\x14verified_data_crc32c\x18\x03 \x01(\x08\x12\x1b\n\x13verified_mac_crc32c\x18\x04 \x01(\x08\x12\"\n\x1averified_success_integrity\x18\x05 \x01(\x08\x12>\n\x10protection_level\x18\x06 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xda\x01\n\x13\x44\x65\x63\x61psulateResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rshared_secret\x18\x02 \x01(\x0c\x12!\n\x14shared_secret_crc32c\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12\"\n\x1averified_ciphertext_crc32c\x18\x04 \x01(\x08\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x17\n\x15_shared_secret_crc32c\"]\n\x1bGenerateRandomBytesResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x30\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"H\n\x06\x44igest\x12\x10\n\x06sha256\x18\x01 \x01(\x0cH\x00\x12\x10\n\x06sha384\x18\x02 \x01(\x0cH\x00\x12\x10\n\x06sha512\x18\x03 \x01(\x0cH\x00\x42\x08\n\x06\x64igest\"e\n\x10LocationMetadata\x12\x15\n\rhsm_available\x18\x01 \x01(\x08\x12\x15\n\rekm_available\x18\x02 \x01(\x08\x12#\n\x1bhsm_single_tenant_available\x18\x03 \x01(\x08\"d\n\x17\x44\x65leteCryptoKeyMetadata\x12I\n\x10retired_resource\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'cloudkms.googleapis.com/RetiredResource\" \n\x1e\x44\x65leteCryptoKeyVersionMetadata2\xb4\x36\n\x14KeyManagementService\x12\xa2\x01\n\x0cListKeyRings\x12(.google.cloud.kms.v1.ListKeyRingsRequest\x1a).google.cloud.kms.v1.ListKeyRingsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/keyRings\x12\xb5\x01\n\x0eListCryptoKeys\x12*.google.cloud.kms.v1.ListCryptoKeysRequest\x1a+.google.cloud.kms.v1.ListCryptoKeysResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys\x12\xde\x01\n\x15ListCryptoKeyVersions\x12\x31.google.cloud.kms.v1.ListCryptoKeyVersionsRequest\x1a\x32.google.cloud.kms.v1.ListCryptoKeyVersionsResponse\"^\xda\x41\x06parent\x82\xd3\xe4\x93\x02O\x12M/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions\x12\xb5\x01\n\x0eListImportJobs\x12*.google.cloud.kms.v1.ListImportJobsRequest\x1a+.google.cloud.kms.v1.ListImportJobsResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs\x12\xc2\x01\n\x14ListRetiredResources\x12\x30.google.cloud.kms.v1.ListRetiredResourcesRequest\x1a\x31.google.cloud.kms.v1.ListRetiredResourcesResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/retiredResources\x12\x8f\x01\n\nGetKeyRing\x12&.google.cloud.kms.v1.GetKeyRingRequest\x1a\x1c.google.cloud.kms.v1.KeyRing\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/keyRings/*}\x12\xa2\x01\n\x0cGetCryptoKey\x12(.google.cloud.kms.v1.GetCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}\x12\xcb\x01\n\x13GetCryptoKeyVersion\x12/.google.cloud.kms.v1.GetCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\\\xda\x41\x04name\x82\xd3\xe4\x93\x02O\x12M/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}\x12\xc0\x01\n\x0cGetPublicKey\x12(.google.cloud.kms.v1.GetPublicKeyRequest\x1a\x1e.google.cloud.kms.v1.PublicKey\"f\xda\x41\x04name\x82\xd3\xe4\x93\x02Y\x12W/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}/publicKey\x12\xa2\x01\n\x0cGetImportJob\x12(.google.cloud.kms.v1.GetImportJobRequest\x1a\x1e.google.cloud.kms.v1.ImportJob\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/keyRings/*/importJobs/*}\x12\xaf\x01\n\x12GetRetiredResource\x12..google.cloud.kms.v1.GetRetiredResourceRequest\x1a$.google.cloud.kms.v1.RetiredResource\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/retiredResources/*}\x12\xb6\x01\n\rCreateKeyRing\x12).google.cloud.kms.v1.CreateKeyRingRequest\x1a\x1c.google.cloud.kms.v1.KeyRing\"\\\xda\x41\x1bparent,key_ring_id,key_ring\x82\xd3\xe4\x93\x02\x38\",/v1/{parent=projects/*/locations/*}/keyRings:\x08key_ring\x12\xcf\x01\n\x0f\x43reateCryptoKey\x12+.google.cloud.kms.v1.CreateCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"o\xda\x41\x1fparent,crypto_key_id,crypto_key\x82\xd3\xe4\x93\x02G\"9/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys:\ncrypto_key\x12\xfb\x01\n\x16\x43reateCryptoKeyVersion\x12\x32.google.cloud.kms.v1.CreateCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\x85\x01\xda\x41\x19parent,crypto_key_version\x82\xd3\xe4\x93\x02\x63\"M/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:\x12\x63rypto_key_version\x12\xda\x01\n\x0f\x44\x65leteCryptoKey\x12+.google.cloud.kms.v1.DeleteCryptoKeyRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteCryptoKeyMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}\x12\x84\x02\n\x16\x44\x65leteCryptoKeyVersion\x12\x32.google.cloud.kms.v1.DeleteCryptoKeyVersionRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41\x37\n\x15google.protobuf.Empty\x12\x1e\x44\x65leteCryptoKeyVersionMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02O*M/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}\x12\xd4\x01\n\x16ImportCryptoKeyVersion\x12\x32.google.cloud.kms.v1.ImportCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"_\x82\xd3\xe4\x93\x02Y\"T/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:import:\x01*\x12\xcf\x01\n\x0f\x43reateImportJob\x12+.google.cloud.kms.v1.CreateImportJobRequest\x1a\x1e.google.cloud.kms.v1.ImportJob\"o\xda\x41\x1fparent,import_job_id,import_job\x82\xd3\xe4\x93\x02G\"9/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs:\nimport_job\x12\xd1\x01\n\x0fUpdateCryptoKey\x12+.google.cloud.kms.v1.UpdateCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"q\xda\x41\x16\x63rypto_key,update_mask\x82\xd3\xe4\x93\x02R2D/v1/{crypto_key.name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:\ncrypto_key\x12\x93\x02\n\x16UpdateCryptoKeyVersion\x12\x32.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\x9d\x01\xda\x41\x1e\x63rypto_key_version,update_mask\x82\xd3\xe4\x93\x02v2`/v1/{crypto_key_version.name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:\x12\x63rypto_key_version\x12\xf2\x01\n\x1dUpdateCryptoKeyPrimaryVersion\x12\x39.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"v\xda\x41\x1aname,crypto_key_version_id\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:updatePrimaryVersion:\x01*\x12\xde\x01\n\x17\x44\x65stroyCryptoKeyVersion\x12\x33.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:destroy:\x01*\x12\xde\x01\n\x17RestoreCryptoKeyVersion\x12\x33.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:restore:\x01*\x12\xb4\x01\n\x07\x45ncrypt\x12#.google.cloud.kms.v1.EncryptRequest\x1a$.google.cloud.kms.v1.EncryptResponse\"^\xda\x41\x0ename,plaintext\x82\xd3\xe4\x93\x02G\"B/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/**}:encrypt:\x01*\x12\xb4\x01\n\x07\x44\x65\x63rypt\x12#.google.cloud.kms.v1.DecryptRequest\x1a$.google.cloud.kms.v1.DecryptResponse\"^\xda\x41\x0fname,ciphertext\x82\xd3\xe4\x93\x02\x46\"A/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:decrypt:\x01*\x12\xc2\x01\n\nRawEncrypt\x12&.google.cloud.kms.v1.RawEncryptRequest\x1a\'.google.cloud.kms.v1.RawEncryptResponse\"c\x82\xd3\xe4\x93\x02]\"X/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawEncrypt:\x01*\x12\xc2\x01\n\nRawDecrypt\x12&.google.cloud.kms.v1.RawDecryptRequest\x1a\'.google.cloud.kms.v1.RawDecryptResponse\"c\x82\xd3\xe4\x93\x02]\"X/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawDecrypt:\x01*\x12\xe0\x01\n\x0e\x41symmetricSign\x12*.google.cloud.kms.v1.AsymmetricSignRequest\x1a+.google.cloud.kms.v1.AsymmetricSignResponse\"u\xda\x41\x0bname,digest\x82\xd3\xe4\x93\x02\x61\"\\/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricSign:\x01*\x12\xf0\x01\n\x11\x41symmetricDecrypt\x12-.google.cloud.kms.v1.AsymmetricDecryptRequest\x1a..google.cloud.kms.v1.AsymmetricDecryptResponse\"|\xda\x41\x0fname,ciphertext\x82\xd3\xe4\x93\x02\x64\"_/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricDecrypt:\x01*\x12\xc2\x01\n\x07MacSign\x12#.google.cloud.kms.v1.MacSignRequest\x1a$.google.cloud.kms.v1.MacSignResponse\"l\xda\x41\tname,data\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macSign:\x01*\x12\xce\x01\n\tMacVerify\x12%.google.cloud.kms.v1.MacVerifyRequest\x1a&.google.cloud.kms.v1.MacVerifyResponse\"r\xda\x41\rname,data,mac\x82\xd3\xe4\x93\x02\\\"W/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macVerify:\x01*\x12\xc6\x01\n\x0b\x44\x65\x63\x61psulate\x12\'.google.cloud.kms.v1.DecapsulateRequest\x1a(.google.cloud.kms.v1.DecapsulateResponse\"d\x82\xd3\xe4\x93\x02^\"Y/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:decapsulate:\x01*\x12\xe7\x01\n\x13GenerateRandomBytes\x12/.google.cloud.kms.v1.GenerateRandomBytesRequest\x1a\x30.google.cloud.kms.v1.GenerateRandomBytesResponse\"m\xda\x41&location,length_bytes,protection_level\x82\xd3\xe4\x93\x02>\"9/v1/{location=projects/*/locations/*}:generateRandomBytes:\x01*\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsB|\n\x17\x63om.google.cloud.kms.v1B\x08KmsProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -50,18 +52,23 @@ module V1 ListCryptoKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeysRequest").msgclass ListCryptoKeyVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeyVersionsRequest").msgclass ListImportJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListImportJobsRequest").msgclass + ListRetiredResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListRetiredResourcesRequest").msgclass ListKeyRingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListKeyRingsResponse").msgclass ListCryptoKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeysResponse").msgclass ListCryptoKeyVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeyVersionsResponse").msgclass ListImportJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListImportJobsResponse").msgclass + ListRetiredResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListRetiredResourcesResponse").msgclass GetKeyRingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetKeyRingRequest").msgclass GetCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetCryptoKeyRequest").msgclass GetCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetCryptoKeyVersionRequest").msgclass GetPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetPublicKeyRequest").msgclass GetImportJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetImportJobRequest").msgclass + GetRetiredResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetRetiredResourceRequest").msgclass CreateKeyRingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateKeyRingRequest").msgclass CreateCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateCryptoKeyRequest").msgclass CreateCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateCryptoKeyVersionRequest").msgclass + DeleteCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyRequest").msgclass + DeleteCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyVersionRequest").msgclass ImportCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportCryptoKeyVersionRequest").msgclass CreateImportJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateImportJobRequest").msgclass UpdateCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateCryptoKeyRequest").msgclass @@ -91,6 +98,8 @@ module V1 GenerateRandomBytesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GenerateRandomBytesResponse").msgclass Digest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.Digest").msgclass LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.LocationMetadata").msgclass + DeleteCryptoKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyMetadata").msgclass + DeleteCryptoKeyVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyVersionMetadata").msgclass end end end diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb index 16a20b470f57..c9422e1adb2c 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb @@ -52,6 +52,10 @@ class Service rpc :ListCryptoKeyVersions, ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse # Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. rpc :ListImportJobs, ::Google::Cloud::Kms::V1::ListImportJobsRequest, ::Google::Cloud::Kms::V1::ListImportJobsResponse + # Lists the [RetiredResources][google.cloud.kms.v1.RetiredResource] which are + # the records of deleted [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + # RetiredResources prevent the reuse of these resource names after deletion. + rpc :ListRetiredResources, ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse # Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. rpc :GetKeyRing, ::Google::Cloud::Kms::V1::GetKeyRingRequest, ::Google::Cloud::Kms::V1::KeyRing # Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as @@ -70,6 +74,10 @@ class Service rpc :GetPublicKey, ::Google::Cloud::Kms::V1::GetPublicKeyRequest, ::Google::Cloud::Kms::V1::PublicKey # Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. rpc :GetImportJob, ::Google::Cloud::Kms::V1::GetImportJobRequest, ::Google::Cloud::Kms::V1::ImportJob + # Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] + # resource, which represents the record of a deleted + # [CryptoKey][google.cloud.kms.v1.CryptoKey]. + rpc :GetRetiredResource, ::Google::Cloud::Kms::V1::GetRetiredResourceRequest, ::Google::Cloud::Kms::V1::RetiredResource # Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and # Location. rpc :CreateKeyRing, ::Google::Cloud::Kms::V1::CreateKeyRingRequest, ::Google::Cloud::Kms::V1::KeyRing @@ -87,6 +95,25 @@ class Service # [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to # [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. rpc :CreateCryptoKeyVersion, ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion + # Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. + # All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must + # have been previously deleted using + # [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. + # The specified crypto key will be immediately and permanently deleted upon + # calling this method. This action cannot be undone. + rpc :DeleteCryptoKey, ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, ::Google::Longrunning::Operation + # Permanently deletes the given + # [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if + # the version has not been previously imported and if its + # [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of + # [DESTROYED][CryptoKeyVersionState.DESTROYED], + # [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or + # [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. + # Successfully imported + # [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted + # at this time. The specified version will be immediately and permanently + # deleted upon calling this method. This action cannot be undone. + rpc :DeleteCryptoKeyVersion, ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, ::Google::Longrunning::Operation # Import wrapped key material into a # [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. # diff --git a/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb b/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb index ce5fe8d69970..1b0b5c5ac5b4 100644 --- a/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb +++ b/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb @@ -1015,6 +1015,32 @@ class KeyAccessJustificationsPolicy extend ::Google::Protobuf::MessageExts::ClassMethods end + # A RetiredResource resource represents the record of a deleted + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. Its purpose is to provide + # visibility into retained user data and to prevent reuse of these names for + # new {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name for this + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} in the format + # `projects/*/locations/*/retiredResources/*`. + # @!attribute [r] original_resource + # @return [::String] + # Output only. The full resource name of the original + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that was deleted in the format + # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + # @!attribute [r] resource_type + # @return [::String] + # Output only. The resource type of the original deleted resource. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the original resource was deleted and this + # RetiredResource record was created. + class RetiredResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} specifies how # cryptographic operations are performed. For more information, see [Protection # levels] (https://cloud.google.com/kms/docs/algorithms#protection_levels). diff --git a/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb b/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb index 2f6398db1a6b..a82f7bc916fc 100644 --- a/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb +++ b/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb @@ -173,6 +173,32 @@ class ListImportJobsRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources KeyManagementService.ListRetiredResources}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project-specific location holding the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}, in the format + # `projects/*/locations/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Optional limit on the number of + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} to be included in + # the response. Further + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} can subsequently be + # obtained by including the + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Optional pagination token, returned earlier via + # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token}. + class ListRetiredResourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Response message for # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings KeyManagementService.ListKeyRings}. # @!attribute [rw] key_rings @@ -266,6 +292,25 @@ class ListImportJobsResponse extend ::Google::Protobuf::MessageExts::ClassMethods end + # Response message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources KeyManagementService.ListRetiredResources}. + # @!attribute [rw] retired_resources + # @return [::Array<::Google::Cloud::Kms::V1::RetiredResource>] + # The list of {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Pass this value in + # {::Google::Cloud::Kms::V1::ListRetiredResourcesRequest#page_token ListRetiredResourcesRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} + # that matched the query. + class ListRetiredResourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Request message for # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_key_ring KeyManagementService.GetKeyRing}. # @!attribute [rw] name @@ -330,6 +375,17 @@ class GetImportJobRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_retired_resource KeyManagementService.GetRetiredResource}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::RetiredResource#name name} of the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} to get. + class GetRetiredResourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Request message for # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_key_ring KeyManagementService.CreateKeyRing}. # @!attribute [rw] parent @@ -395,6 +451,28 @@ class CreateCryptoKeyVersionRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key KeyManagementService.DeleteCryptoKey}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to delete. + class DeleteCryptoKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the + # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to delete. + class DeleteCryptoKeyVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Request message for # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version KeyManagementService.ImportCryptoKeyVersion}. # @!attribute [rw] parent @@ -1801,6 +1879,28 @@ class LocationMetadata include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # Represents the metadata of the + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key KeyManagementService.DeleteCryptoKey} + # long-running operation. + # @!attribute [r] retired_resource + # @return [::String] + # Output only. The resource name of the + # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} created as a result + # of this operation, in the format + # `projects/*/locations/*/retiredResources/*`. + class DeleteCryptoKeyMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the + # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion} + # long-running operation. + class DeleteCryptoKeyVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end end end diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key.rb b/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key.rb similarity index 100% rename from owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key.rb rename to google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key.rb diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key_version.rb b/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key_version.rb similarity index 100% rename from owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key_version.rb rename to google-cloud-kms-v1/snippets/key_management_service/delete_crypto_key_version.rb diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_retired_resource.rb b/google-cloud-kms-v1/snippets/key_management_service/get_retired_resource.rb similarity index 100% rename from owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_retired_resource.rb rename to google-cloud-kms-v1/snippets/key_management_service/get_retired_resource.rb diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_retired_resources.rb b/google-cloud-kms-v1/snippets/key_management_service/list_retired_resources.rb similarity index 100% rename from owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_retired_resources.rb rename to google-cloud-kms-v1/snippets/key_management_service/list_retired_resources.rb diff --git a/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json b/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json index 5c0e02e18832..511fb452cb81 100644 --- a/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json +++ b/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json @@ -1051,6 +1051,46 @@ } ] }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_ListRetiredResources_sync", + "title": "Snippet for the list_retired_resources call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources.", + "file": "key_management_service/list_retired_resources.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_retired_resources", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::ListRetiredResourcesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::ListRetiredResourcesResponse", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "ListRetiredResources", + "full_name": "google.cloud.kms.v1.KeyManagementService.ListRetiredResources", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, { "region_tag": "cloudkms_v1_generated_KeyManagementService_GetKeyRing_sync", "title": "Snippet for the get_key_ring call in the KeyManagementService service", @@ -1251,6 +1291,46 @@ } ] }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_GetRetiredResource_sync", + "title": "Snippet for the get_retired_resource call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_retired_resource.", + "file": "key_management_service/get_retired_resource.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_retired_resource", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_retired_resource", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::GetRetiredResourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Kms::V1::RetiredResource", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "GetRetiredResource", + "full_name": "google.cloud.kms.v1.KeyManagementService.GetRetiredResource", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, { "region_tag": "cloudkms_v1_generated_KeyManagementService_CreateKeyRing_sync", "title": "Snippet for the create_key_ring call in the KeyManagementService service", @@ -1371,6 +1451,86 @@ } ] }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_DeleteCryptoKey_sync", + "title": "Snippet for the delete_crypto_key call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key.", + "file": "key_management_service/delete_crypto_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_crypto_key", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "DeleteCryptoKey", + "full_name": "google.cloud.kms.v1.KeyManagementService.DeleteCryptoKey", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudkms_v1_generated_KeyManagementService_DeleteCryptoKeyVersion_sync", + "title": "Snippet for the delete_crypto_key_version call in the KeyManagementService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version.", + "file": "key_management_service/delete_crypto_key_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_crypto_key_version", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "KeyManagementService::Client", + "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" + }, + "method": { + "short_name": "DeleteCryptoKeyVersion", + "full_name": "google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion", + "service": { + "short_name": "KeyManagementService", + "full_name": "google.cloud.kms.v1.KeyManagementService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, { "region_tag": "cloudkms_v1_generated_KeyManagementService_ImportCryptoKeyVersion_sync", "title": "Snippet for the import_crypto_key_version call in the KeyManagementService service", diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_operations_test.rb b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_operations_test.rb similarity index 100% rename from owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_operations_test.rb rename to google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_operations_test.rb diff --git a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb index 776b634e6d95..e94ca4c37aa4 100644 --- a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb +++ b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb @@ -100,4 +100,16 @@ def test_location_path assert_equal "projects/value0/locations/value1", path end end + + def test_retired_resource_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.retired_resource_path project: "value0", location: "value1", retired_resource: "value2" + assert_equal "projects/value0/locations/value1/retiredResources/value2", path + end + end end diff --git a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb index 4086edffcdcc..992b6805e790 100644 --- a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb +++ b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb @@ -312,6 +312,62 @@ def test_list_import_jobs end end + def test_list_retired_resources + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_retired_resources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_list_retired_resources_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_retired_resources_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_retired_resources parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_retired_resources ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_retired_resources(::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_retired_resources_client_stub.call_count + end + end + end + def test_get_key_ring # Create test objects. client_result = ::Google::Cloud::Kms::V1::KeyRing.new @@ -583,6 +639,60 @@ def test_get_import_job end end + def test_get_retired_resource + # Create test objects. + client_result = ::Google::Cloud::Kms::V1::RetiredResource.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_retired_resource_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_retired_resource_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_retired_resource_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_retired_resource({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_retired_resource name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_retired_resource ::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_retired_resource({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_retired_resource(::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_retired_resource_client_stub.call_count + end + end + end + def test_create_key_ring # Create test objects. client_result = ::Google::Cloud::Kms::V1::KeyRing.new @@ -751,6 +861,114 @@ def test_create_crypto_key_version end end + def test_delete_crypto_key + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_crypto_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_delete_crypto_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_crypto_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_crypto_key({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_crypto_key name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_crypto_key ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_crypto_key({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_crypto_key(::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_crypto_key_client_stub.call_count + end + end + end + + def test_delete_crypto_key_version + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_delete_crypto_key_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_crypto_key_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_crypto_key_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_crypto_key_version ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_crypto_key_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_crypto_key_version(::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_crypto_key_version_client_stub.call_count + end + end + end + def test_import_crypto_key_version # Create test objects. client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new diff --git a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb index eaa0c3691cd8..a09e48109b6a 100644 --- a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb +++ b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb @@ -351,6 +351,73 @@ def test_list_import_jobs end end + def test_list_retired_resources + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_retired_resources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_retired_resources, name + assert_kind_of ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_retired_resources_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_retired_resources parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_retired_resources ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_retired_resources(::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_retired_resources_client_stub.call_rpc_count + end + end + def test_get_key_ring # Create GRPC objects. grpc_response = ::Google::Cloud::Kms::V1::KeyRing.new @@ -643,6 +710,64 @@ def test_get_import_job end end + def test_get_retired_resource + # Create GRPC objects. + grpc_response = ::Google::Cloud::Kms::V1::RetiredResource.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_retired_resource_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_retired_resource, name + assert_kind_of ::Google::Cloud::Kms::V1::GetRetiredResourceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_retired_resource_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_retired_resource({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_retired_resource name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_retired_resource ::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_retired_resource({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_retired_resource(::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_retired_resource_client_stub.call_rpc_count + end + end + def test_create_key_ring # Create GRPC objects. grpc_response = ::Google::Cloud::Kms::V1::KeyRing.new @@ -829,6 +954,132 @@ def test_create_crypto_key_version end end + def test_delete_crypto_key + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_crypto_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_crypto_key, name + assert_kind_of ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_crypto_key_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_crypto_key({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_crypto_key name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_crypto_key ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_crypto_key({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_crypto_key(::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_crypto_key_client_stub.call_rpc_count + end + end + + def test_delete_crypto_key_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_crypto_key_version, name + assert_kind_of ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_crypto_key_version_client_stub do + # Create client + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_crypto_key_version({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_crypto_key_version name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_crypto_key_version ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_crypto_key_version({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_crypto_key_version(::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_crypto_key_version_client_stub.call_rpc_count + end + end + def test_import_crypto_key_version # Create GRPC objects. grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new @@ -1948,4 +2199,18 @@ def test_credentials assert_equal creds, client.configure.credentials end end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Kms::V1::KeyManagementService::Operations, client.operations_client + end end diff --git a/owl-bot-staging/google-cloud-kms-v1/.gitignore b/owl-bot-staging/google-cloud-kms-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-kms-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-kms-v1/.repo-metadata.json deleted file mode 100644 index d4b8f3bbfab4..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudkms.googleapis.com", - "api_shortname": "cloudkms", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-kms-v1/latest", - "distribution_name": "google-cloud-kms-v1", - "is_cloud": true, - "language": "ruby", - "name": "cloudkms", - "name_pretty": "Cloud Key Management Service (KMS) V1 API", - "product_documentation": "https://cloud.google.com/kms", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications. Note that google-cloud-kms-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-kms instead. See the readme for more details.", - "ruby-cloud-env-prefix": "KMS", - "ruby-cloud-product-url": "https://cloud.google.com/kms", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-kms-v1/.rubocop.yml b/owl-bot-staging/google-cloud-kms-v1/.rubocop.yml deleted file mode 100644 index 7508e22a5467..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-kms-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-kms-v1.rb" diff --git a/owl-bot-staging/google-cloud-kms-v1/.toys.rb b/owl-bot-staging/google-cloud-kms-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-kms-v1/.yardopts b/owl-bot-staging/google-cloud-kms-v1/.yardopts deleted file mode 100644 index 732be9f951a1..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Key Management Service (KMS) V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-kms-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-kms-v1/AUTHENTICATION.md deleted file mode 100644 index 8dc26289ab3d..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-kms-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-kms-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/kms/v1" - -client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/kms/v1" - -::Google::Cloud::Kms::V1::Autokey::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Kms::V1::Autokey::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-kms-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/kms/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Kms::V1::Autokey::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-kms-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-kms-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-kms-v1/Gemfile b/owl-bot-staging/google-cloud-kms-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-kms-v1/LICENSE.md b/owl-bot-staging/google-cloud-kms-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-kms-v1/README.md b/owl-bot-staging/google-cloud-kms-v1/README.md deleted file mode 100644 index a0be04ec409f..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Cloud Key Management Service (KMS) V1 API - -Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Cloud Key Management Service (KMS) V1 API. Most users should consider using -the main client gem, -[google-cloud-kms](https://rubygems.org/gems/google-cloud-kms). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-kms-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudkms.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/kms/v1" - -client = ::Google::Cloud::Kms::V1::Autokey::Client.new -request = ::Google::Cloud::Kms::V1::CreateKeyHandleRequest.new # (request fields as keyword arguments...) -response = client.create_key_handle request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-kms-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/kms) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/kms/v1" -require "logger" - -client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-kms`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-kms-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-kms`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-kms-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-kms-v1/Rakefile b/owl-bot-staging/google-cloud-kms-v1/Rakefile deleted file mode 100644 index 74ec35fdc9bc..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-kms-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["KMS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["KMS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["KMS_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or KMS_TEST_PROJECT=test123 KMS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/kms/v1/autokey/credentials" - ::Google::Cloud::Kms::V1::Autokey::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["KMS_PROJECT"] = project - ENV["KMS_TEST_PROJECT"] = project - ENV["KMS_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-kms-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-kms-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-kms-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-kms-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-kms-v1" - header "google-cloud-kms-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-kms-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-kms-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-kms-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-kms-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-kms-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-kms-v1/gapic_metadata.json deleted file mode 100644 index ea6d2abb953b..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/gapic_metadata.json +++ /dev/null @@ -1,329 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.kms.v1", - "libraryPackage": "::Google::Cloud::Kms::V1", - "services": { - "Autokey": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Kms::V1::Autokey::Client", - "rpcs": { - "CreateKeyHandle": { - "methods": [ - "create_key_handle" - ] - }, - "GetKeyHandle": { - "methods": [ - "get_key_handle" - ] - }, - "ListKeyHandles": { - "methods": [ - "list_key_handles" - ] - } - } - } - } - }, - "AutokeyAdmin": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client", - "rpcs": { - "UpdateAutokeyConfig": { - "methods": [ - "update_autokey_config" - ] - }, - "GetAutokeyConfig": { - "methods": [ - "get_autokey_config" - ] - }, - "ShowEffectiveAutokeyConfig": { - "methods": [ - "show_effective_autokey_config" - ] - } - } - } - } - }, - "EkmService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Kms::V1::EkmService::Client", - "rpcs": { - "ListEkmConnections": { - "methods": [ - "list_ekm_connections" - ] - }, - "GetEkmConnection": { - "methods": [ - "get_ekm_connection" - ] - }, - "CreateEkmConnection": { - "methods": [ - "create_ekm_connection" - ] - }, - "UpdateEkmConnection": { - "methods": [ - "update_ekm_connection" - ] - }, - "GetEkmConfig": { - "methods": [ - "get_ekm_config" - ] - }, - "UpdateEkmConfig": { - "methods": [ - "update_ekm_config" - ] - }, - "VerifyConnectivity": { - "methods": [ - "verify_connectivity" - ] - } - } - } - } - }, - "HsmManagement": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Kms::V1::HsmManagement::Client", - "rpcs": { - "ListSingleTenantHsmInstances": { - "methods": [ - "list_single_tenant_hsm_instances" - ] - }, - "GetSingleTenantHsmInstance": { - "methods": [ - "get_single_tenant_hsm_instance" - ] - }, - "CreateSingleTenantHsmInstance": { - "methods": [ - "create_single_tenant_hsm_instance" - ] - }, - "CreateSingleTenantHsmInstanceProposal": { - "methods": [ - "create_single_tenant_hsm_instance_proposal" - ] - }, - "ApproveSingleTenantHsmInstanceProposal": { - "methods": [ - "approve_single_tenant_hsm_instance_proposal" - ] - }, - "ExecuteSingleTenantHsmInstanceProposal": { - "methods": [ - "execute_single_tenant_hsm_instance_proposal" - ] - }, - "GetSingleTenantHsmInstanceProposal": { - "methods": [ - "get_single_tenant_hsm_instance_proposal" - ] - }, - "ListSingleTenantHsmInstanceProposals": { - "methods": [ - "list_single_tenant_hsm_instance_proposals" - ] - }, - "DeleteSingleTenantHsmInstanceProposal": { - "methods": [ - "delete_single_tenant_hsm_instance_proposal" - ] - } - } - } - } - }, - "KeyManagementService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Kms::V1::KeyManagementService::Client", - "rpcs": { - "ListKeyRings": { - "methods": [ - "list_key_rings" - ] - }, - "ListCryptoKeys": { - "methods": [ - "list_crypto_keys" - ] - }, - "ListCryptoKeyVersions": { - "methods": [ - "list_crypto_key_versions" - ] - }, - "ListImportJobs": { - "methods": [ - "list_import_jobs" - ] - }, - "ListRetiredResources": { - "methods": [ - "list_retired_resources" - ] - }, - "GetKeyRing": { - "methods": [ - "get_key_ring" - ] - }, - "GetCryptoKey": { - "methods": [ - "get_crypto_key" - ] - }, - "GetCryptoKeyVersion": { - "methods": [ - "get_crypto_key_version" - ] - }, - "GetPublicKey": { - "methods": [ - "get_public_key" - ] - }, - "GetImportJob": { - "methods": [ - "get_import_job" - ] - }, - "GetRetiredResource": { - "methods": [ - "get_retired_resource" - ] - }, - "CreateKeyRing": { - "methods": [ - "create_key_ring" - ] - }, - "CreateCryptoKey": { - "methods": [ - "create_crypto_key" - ] - }, - "CreateCryptoKeyVersion": { - "methods": [ - "create_crypto_key_version" - ] - }, - "DeleteCryptoKey": { - "methods": [ - "delete_crypto_key" - ] - }, - "DeleteCryptoKeyVersion": { - "methods": [ - "delete_crypto_key_version" - ] - }, - "ImportCryptoKeyVersion": { - "methods": [ - "import_crypto_key_version" - ] - }, - "CreateImportJob": { - "methods": [ - "create_import_job" - ] - }, - "UpdateCryptoKey": { - "methods": [ - "update_crypto_key" - ] - }, - "UpdateCryptoKeyVersion": { - "methods": [ - "update_crypto_key_version" - ] - }, - "UpdateCryptoKeyPrimaryVersion": { - "methods": [ - "update_crypto_key_primary_version" - ] - }, - "DestroyCryptoKeyVersion": { - "methods": [ - "destroy_crypto_key_version" - ] - }, - "RestoreCryptoKeyVersion": { - "methods": [ - "restore_crypto_key_version" - ] - }, - "Encrypt": { - "methods": [ - "encrypt" - ] - }, - "Decrypt": { - "methods": [ - "decrypt" - ] - }, - "RawEncrypt": { - "methods": [ - "raw_encrypt" - ] - }, - "RawDecrypt": { - "methods": [ - "raw_decrypt" - ] - }, - "AsymmetricSign": { - "methods": [ - "asymmetric_sign" - ] - }, - "AsymmetricDecrypt": { - "methods": [ - "asymmetric_decrypt" - ] - }, - "MacSign": { - "methods": [ - "mac_sign" - ] - }, - "MacVerify": { - "methods": [ - "mac_verify" - ] - }, - "Decapsulate": { - "methods": [ - "decapsulate" - ] - }, - "GenerateRandomBytes": { - "methods": [ - "generate_random_bytes" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-kms-v1/google-cloud-kms-v1.gemspec b/owl-bot-staging/google-cloud-kms-v1/google-cloud-kms-v1.gemspec deleted file mode 100644 index d06423433584..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/google-cloud-kms-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/kms/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-kms-v1" - gem.version = Google::Cloud::Kms::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications. Note that google-cloud-kms-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-kms instead. See the readme for more details." - gem.summary = "Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "google-iam-v1", "~> 1.3" -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google-cloud-kms-v1.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google-cloud-kms-v1.rb deleted file mode 100644 index b5a53b03e81a..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google-cloud-kms-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/kms/v1" diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1.rb deleted file mode 100644 index 1f600fafd863..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/kms/v1/autokey" -require "google/cloud/kms/v1/autokey_admin" -require "google/cloud/kms/v1/ekm_service" -require "google/cloud/kms/v1/hsm_management" -require "google/cloud/kms/v1/key_management_service" -require "google/cloud/kms/v1/version" - -module Google - module Cloud - module Kms - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/kms/v1" - # client = ::Google::Cloud::Kms::V1::Autokey::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/kms/v1" - # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/kms/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey.rb deleted file mode 100644 index dfeee69aef4f..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/kms/v1/version" - -require "google/cloud/kms/v1/autokey/credentials" -require "google/cloud/kms/v1/autokey/paths" -require "google/cloud/kms/v1/autokey/operations" -require "google/cloud/kms/v1/autokey/client" -require "google/cloud/kms/v1/autokey/rest" - -module Google - module Cloud - module Kms - module V1 - ## - # Provides interfaces for using [Cloud KMS - # Autokey](https://cloud.google.com/kms/help/autokey) to provision new - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer Managed - # Encryption Key (CMEK) use, on-demand. To support certain client tooling, this - # feature is modeled around a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} - # resource: creating a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in a resource - # project and given location triggers Cloud KMS Autokey to provision a - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the configured key project and - # the same location. - # - # Prior to use in a given resource project, - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config UpdateAutokeyConfig} - # should have been called on an ancestor folder, setting the key project where - # Cloud KMS Autokey should create new - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. See documentation for additional - # prerequisites. To check what key project, if any, is currently configured on - # a resource project's ancestor folder, see - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/kms/v1/autokey" - # client = ::Google::Cloud::Kms::V1::Autokey::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/kms/v1/autokey/rest" - # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new - # - module Autokey - end - end - end - end -end - -helper_path = ::File.join __dir__, "autokey", "helpers.rb" -require "google/cloud/kms/v1/autokey/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/client.rb deleted file mode 100644 index ff375568d05e..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/client.rb +++ /dev/null @@ -1,782 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/kms/v1/autokey_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module Kms - module V1 - module Autokey - ## - # Client for the Autokey service. - # - # Provides interfaces for using [Cloud KMS - # Autokey](https://cloud.google.com/kms/help/autokey) to provision new - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer Managed - # Encryption Key (CMEK) use, on-demand. To support certain client tooling, this - # feature is modeled around a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} - # resource: creating a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in a resource - # project and given location triggers Cloud KMS Autokey to provision a - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the configured key project and - # the same location. - # - # Prior to use in a given resource project, - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config UpdateAutokeyConfig} - # should have been called on an ancestor folder, setting the key project where - # Cloud KMS Autokey should create new - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. See documentation for additional - # prerequisites. To check what key project, if any, is currently configured on - # a resource project's ancestor folder, see - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :autokey_stub - - ## - # Configure the Autokey Client class. - # - # See {::Google::Cloud::Kms::V1::Autokey::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Autokey clients - # ::Google::Cloud::Kms::V1::Autokey::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Kms", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_key_handle.timeout = 60.0 - - default_config.rpcs.get_key_handle.timeout = 60.0 - default_config.rpcs.get_key_handle.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_key_handles.timeout = 60.0 - default_config.rpcs.list_key_handles.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Autokey Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Kms::V1::Autokey::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @autokey_stub.universe_domain - end - - ## - # Create a new Autokey client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Kms::V1::Autokey::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Autokey client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/kms/v1/autokey_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @autokey_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Kms::V1::Autokey::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @autokey_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @autokey_stub.endpoint - config.universe_domain = @autokey_stub.universe_domain - config.logger = @autokey_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @autokey_stub.endpoint - config.universe_domain = @autokey_stub.universe_domain - config.logger = @autokey_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Kms::V1::Autokey::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @autokey_stub.logger - end - - # Service calls - - ## - # Creates a new {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}, triggering the - # provisioning of a new {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} for CMEK - # use with the given resource type in the configured key project and the same - # location. GetOperation should - # be used to resolve the resulting long-running operation and get the - # resulting {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} and - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # @overload create_key_handle(request, options = nil) - # Pass arguments to `create_key_handle` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateKeyHandleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateKeyHandleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_key_handle(parent: nil, key_handle_id: nil, key_handle: nil) - # Pass arguments to `create_key_handle` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the resource project and location to create the - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in, e.g. - # `projects/{PROJECT_ID}/locations/{LOCATION}`. - # @param key_handle_id [::String] - # Optional. Id of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}. Must be - # unique to the resource project and location. If not provided by the caller, - # a new UUID is used. - # @param key_handle [::Google::Cloud::Kms::V1::KeyHandle, ::Hash] - # Required. {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::Autokey::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateKeyHandleRequest.new - # - # # Call the create_key_handle method. - # result = client.create_key_handle request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_key_handle request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateKeyHandleRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_key_handle.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_key_handle.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_key_handle.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_stub.call_rpc :create_key_handle, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}. - # - # @overload get_key_handle(request, options = nil) - # Pass arguments to `get_key_handle` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetKeyHandleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetKeyHandleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_key_handle(name: nil) - # Pass arguments to `get_key_handle` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} resource, - # e.g. - # `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::KeyHandle] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::KeyHandle] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::Autokey::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetKeyHandleRequest.new - # - # # Call the get_key_handle method. - # result = client.get_key_handle request - # - # # The returned object is of type Google::Cloud::Kms::V1::KeyHandle. - # p result - # - def get_key_handle request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetKeyHandleRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_key_handle.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_key_handle.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_key_handle.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_stub.call_rpc :get_key_handle, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}. - # - # @overload list_key_handles(request, options = nil) - # Pass arguments to `list_key_handles` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListKeyHandlesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListKeyHandlesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_key_handles(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_key_handles` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the resource project and location from which to list - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. - # `projects/{PROJECT_ID}/locations/{LOCATION}`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} to include in the response. The - # service may return fewer than this value. Further - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} can subsequently be obtained by - # including the - # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token} - # in a subsequent request. If unspecified, at most 100 - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} will be returned. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token}. - # @param filter [::String] - # Optional. Filter to apply when listing - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. - # `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::KeyHandle>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::KeyHandle>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::Autokey::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListKeyHandlesRequest.new - # - # # Call the list_key_handles method. - # result = client.list_key_handles request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::KeyHandle. - # p item - # end - # - def list_key_handles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListKeyHandlesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_key_handles.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_key_handles.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_key_handles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_stub.call_rpc :list_key_handles, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @autokey_stub, :list_key_handles, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Autokey API. - # - # This class represents the configuration for Autokey, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Kms::V1::Autokey::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_key_handle to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Kms::V1::Autokey::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_key_handle.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_key_handle.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Autokey API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_key_handle` - # @return [::Gapic::Config::Method] - # - attr_reader :create_key_handle - ## - # RPC-specific configuration for `get_key_handle` - # @return [::Gapic::Config::Method] - # - attr_reader :get_key_handle - ## - # RPC-specific configuration for `list_key_handles` - # @return [::Gapic::Config::Method] - # - attr_reader :list_key_handles - - # @private - def initialize parent_rpcs = nil - create_key_handle_config = parent_rpcs.create_key_handle if parent_rpcs.respond_to? :create_key_handle - @create_key_handle = ::Gapic::Config::Method.new create_key_handle_config - get_key_handle_config = parent_rpcs.get_key_handle if parent_rpcs.respond_to? :get_key_handle - @get_key_handle = ::Gapic::Config::Method.new get_key_handle_config - list_key_handles_config = parent_rpcs.list_key_handles if parent_rpcs.respond_to? :list_key_handles - @list_key_handles = ::Gapic::Config::Method.new list_key_handles_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/credentials.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/credentials.rb deleted file mode 100644 index ccc21283af92..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Kms - module V1 - module Autokey - # Credentials for the Autokey API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudkms" - ] - self.env_vars = [ - "KMS_CREDENTIALS", - "KMS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "KMS_CREDENTIALS_JSON", - "KMS_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/operations.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/operations.rb deleted file mode 100644 index 00d39d6e60f0..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Kms - module V1 - module Autokey - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Autokey Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the Autokey Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/paths.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/paths.rb deleted file mode 100644 index c003a9763469..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/paths.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - module Autokey - # Path helper methods for the Autokey API. - module Paths - ## - # Create a fully-qualified CryptoKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_key_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified KeyHandle resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyHandles/{key_handle}` - # - # @param project [String] - # @param location [String] - # @param key_handle [String] - # - # @return [::String] - def key_handle_path project:, location:, key_handle: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyHandles/#{key_handle}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest.rb deleted file mode 100644 index 9bd8b68c5498..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/kms/v1/version" -require "google/cloud/kms/v1/bindings_override" - -require "google/cloud/kms/v1/autokey/credentials" -require "google/cloud/kms/v1/autokey/paths" -require "google/cloud/kms/v1/autokey/rest/operations" -require "google/cloud/kms/v1/autokey/rest/client" - -module Google - module Cloud - module Kms - module V1 - ## - # Provides interfaces for using [Cloud KMS - # Autokey](https://cloud.google.com/kms/help/autokey) to provision new - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer Managed - # Encryption Key (CMEK) use, on-demand. To support certain client tooling, this - # feature is modeled around a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} - # resource: creating a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in a resource - # project and given location triggers Cloud KMS Autokey to provision a - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the configured key project and - # the same location. - # - # Prior to use in a given resource project, - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config UpdateAutokeyConfig} - # should have been called on an ancestor folder, setting the key project where - # Cloud KMS Autokey should create new - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. See documentation for additional - # prerequisites. To check what key project, if any, is currently configured on - # a resource project's ancestor folder, see - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/kms/v1/autokey/rest" - # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new - # - module Autokey - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/kms/v1/autokey/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/client.rb deleted file mode 100644 index 224f33b3ac5e..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/client.rb +++ /dev/null @@ -1,727 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/kms/v1/autokey_pb" -require "google/cloud/kms/v1/autokey/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module Kms - module V1 - module Autokey - module Rest - ## - # REST client for the Autokey service. - # - # Provides interfaces for using [Cloud KMS - # Autokey](https://cloud.google.com/kms/help/autokey) to provision new - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer Managed - # Encryption Key (CMEK) use, on-demand. To support certain client tooling, this - # feature is modeled around a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} - # resource: creating a {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in a resource - # project and given location triggers Cloud KMS Autokey to provision a - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the configured key project and - # the same location. - # - # Prior to use in a given resource project, - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client#update_autokey_config UpdateAutokeyConfig} - # should have been called on an ancestor folder, setting the key project where - # Cloud KMS Autokey should create new - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. See documentation for additional - # prerequisites. To check what key project, if any, is currently configured on - # a resource project's ancestor folder, see - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :autokey_stub - - ## - # Configure the Autokey Client class. - # - # See {::Google::Cloud::Kms::V1::Autokey::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Autokey clients - # ::Google::Cloud::Kms::V1::Autokey::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Kms", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_key_handle.timeout = 60.0 - - default_config.rpcs.get_key_handle.timeout = 60.0 - default_config.rpcs.get_key_handle.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_key_handles.timeout = 60.0 - default_config.rpcs.list_key_handles.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Autokey Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Kms::V1::Autokey::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @autokey_stub.universe_domain - end - - ## - # Create a new Autokey REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Autokey client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Kms::V1::Autokey::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @autokey_stub = ::Google::Cloud::Kms::V1::Autokey::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @autokey_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @autokey_stub.endpoint - config.universe_domain = @autokey_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @autokey_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @autokey_stub.endpoint - config.universe_domain = @autokey_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @autokey_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Kms::V1::Autokey::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @autokey_stub.logger - end - - # Service calls - - ## - # Creates a new {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}, triggering the - # provisioning of a new {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} for CMEK - # use with the given resource type in the configured key project and the same - # location. GetOperation should - # be used to resolve the resulting long-running operation and get the - # resulting {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} and - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # @overload create_key_handle(request, options = nil) - # Pass arguments to `create_key_handle` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateKeyHandleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateKeyHandleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_key_handle(parent: nil, key_handle_id: nil, key_handle: nil) - # Pass arguments to `create_key_handle` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the resource project and location to create the - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in, e.g. - # `projects/{PROJECT_ID}/locations/{LOCATION}`. - # @param key_handle_id [::String] - # Optional. Id of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}. Must be - # unique to the resource project and location. If not provided by the caller, - # a new UUID is used. - # @param key_handle [::Google::Cloud::Kms::V1::KeyHandle, ::Hash] - # Required. {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::Autokey::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateKeyHandleRequest.new - # - # # Call the create_key_handle method. - # result = client.create_key_handle request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_key_handle request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateKeyHandleRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_key_handle.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_key_handle.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_key_handle.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_stub.create_key_handle request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}. - # - # @overload get_key_handle(request, options = nil) - # Pass arguments to `get_key_handle` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetKeyHandleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetKeyHandleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_key_handle(name: nil) - # Pass arguments to `get_key_handle` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} resource, - # e.g. - # `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::KeyHandle] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::KeyHandle] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::Autokey::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetKeyHandleRequest.new - # - # # Call the get_key_handle method. - # result = client.get_key_handle request - # - # # The returned object is of type Google::Cloud::Kms::V1::KeyHandle. - # p result - # - def get_key_handle request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetKeyHandleRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_key_handle.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_key_handle.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_key_handle.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_stub.get_key_handle request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}. - # - # @overload list_key_handles(request, options = nil) - # Pass arguments to `list_key_handles` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListKeyHandlesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListKeyHandlesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_key_handles(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_key_handles` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the resource project and location from which to list - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. - # `projects/{PROJECT_ID}/locations/{LOCATION}`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} to include in the response. The - # service may return fewer than this value. Further - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} can subsequently be obtained by - # including the - # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token} - # in a subsequent request. If unspecified, at most 100 - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} will be returned. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token}. - # @param filter [::String] - # Optional. Filter to apply when listing - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. - # `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyHandle>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyHandle>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::Autokey::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListKeyHandlesRequest.new - # - # # Call the list_key_handles method. - # result = client.list_key_handles request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::KeyHandle. - # p item - # end - # - def list_key_handles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListKeyHandlesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_key_handles.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_key_handles.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_key_handles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_stub.list_key_handles request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @autokey_stub, :list_key_handles, "key_handles", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Autokey REST API. - # - # This class represents the configuration for Autokey REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Kms::V1::Autokey::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_key_handle to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Kms::V1::Autokey::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_key_handle.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_key_handle.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Autokey API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_key_handle` - # @return [::Gapic::Config::Method] - # - attr_reader :create_key_handle - ## - # RPC-specific configuration for `get_key_handle` - # @return [::Gapic::Config::Method] - # - attr_reader :get_key_handle - ## - # RPC-specific configuration for `list_key_handles` - # @return [::Gapic::Config::Method] - # - attr_reader :list_key_handles - - # @private - def initialize parent_rpcs = nil - create_key_handle_config = parent_rpcs.create_key_handle if parent_rpcs.respond_to? :create_key_handle - @create_key_handle = ::Gapic::Config::Method.new create_key_handle_config - get_key_handle_config = parent_rpcs.get_key_handle if parent_rpcs.respond_to? :get_key_handle - @get_key_handle = ::Gapic::Config::Method.new get_key_handle_config - list_key_handles_config = parent_rpcs.list_key_handles if parent_rpcs.respond_to? :list_key_handles - @list_key_handles = ::Gapic::Config::Method.new list_key_handles_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/operations.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/operations.rb deleted file mode 100644 index c1f85cd9d4ea..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/operations.rb +++ /dev/null @@ -1,925 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Kms - module V1 - module Autokey - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Autokey Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the Autokey Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/service_stub.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/service_stub.rb deleted file mode 100644 index 7c6b2eb2a2bd..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey/rest/service_stub.rb +++ /dev/null @@ -1,265 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/kms/v1/autokey_pb" - -module Google - module Cloud - module Kms - module V1 - module Autokey - module Rest - ## - # REST service stub for the Autokey service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_key_handle REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateKeyHandleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_key_handle request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_key_handle_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_key_handle", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_key_handle REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetKeyHandleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::KeyHandle] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::KeyHandle] - # A result object deserialized from the server's reply - def get_key_handle request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_key_handle_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_key_handle", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::KeyHandle.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_key_handles REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListKeyHandlesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ListKeyHandlesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ListKeyHandlesResponse] - # A result object deserialized from the server's reply - def list_key_handles request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_key_handles_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_key_handles", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ListKeyHandlesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_key_handle REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateKeyHandleRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_key_handle_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/keyHandles", - body: "key_handle", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_key_handle REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetKeyHandleRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_key_handle_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyHandles/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_key_handles REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListKeyHandlesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_key_handles_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/keyHandles", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin.rb deleted file mode 100644 index 45bdc8bdd205..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/kms/v1/version" - -require "google/cloud/kms/v1/autokey_admin/credentials" -require "google/cloud/kms/v1/autokey_admin/paths" -require "google/cloud/kms/v1/autokey_admin/client" -require "google/cloud/kms/v1/autokey_admin/rest" - -module Google - module Cloud - module Kms - module V1 - ## - # Provides interfaces for managing [Cloud KMS - # Autokey](https://cloud.google.com/kms/help/autokey) folder-level - # configurations. A configuration is inherited by all descendent projects. A - # configuration at one folder overrides any other configurations in its - # ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS - # Autokey, so that users working in a descendant project can request - # provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer - # Managed Encryption Key (CMEK) use, on-demand. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/kms/v1/autokey_admin" - # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/kms/v1/autokey_admin/rest" - # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new - # - module AutokeyAdmin - end - end - end - end -end - -helper_path = ::File.join __dir__, "autokey_admin", "helpers.rb" -require "google/cloud/kms/v1/autokey_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/client.rb deleted file mode 100644 index ccd0510f171b..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/client.rb +++ /dev/null @@ -1,727 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/kms/v1/autokey_admin_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module Kms - module V1 - module AutokeyAdmin - ## - # Client for the AutokeyAdmin service. - # - # Provides interfaces for managing [Cloud KMS - # Autokey](https://cloud.google.com/kms/help/autokey) folder-level - # configurations. A configuration is inherited by all descendent projects. A - # configuration at one folder overrides any other configurations in its - # ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS - # Autokey, so that users working in a descendant project can request - # provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer - # Managed Encryption Key (CMEK) use, on-demand. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :autokey_admin_stub - - ## - # Configure the AutokeyAdmin Client class. - # - # See {::Google::Cloud::Kms::V1::AutokeyAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AutokeyAdmin clients - # ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Kms", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.update_autokey_config.timeout = 60.0 - default_config.rpcs.update_autokey_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_autokey_config.timeout = 60.0 - default_config.rpcs.get_autokey_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.show_effective_autokey_config.timeout = 60.0 - default_config.rpcs.show_effective_autokey_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the AutokeyAdmin Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Kms::V1::AutokeyAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @autokey_admin_stub.universe_domain - end - - ## - # Create a new AutokeyAdmin client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AutokeyAdmin client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/kms/v1/autokey_admin_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @autokey_admin_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Kms::V1::AutokeyAdmin::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @autokey_admin_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @autokey_admin_stub.endpoint - config.universe_domain = @autokey_admin_stub.universe_domain - config.logger = @autokey_admin_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @autokey_admin_stub.endpoint - config.universe_domain = @autokey_admin_stub.universe_domain - config.logger = @autokey_admin_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @autokey_admin_stub.logger - end - - # Service calls - - ## - # Updates the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a - # folder. The caller must have both `cloudkms.autokeyConfigs.update` - # permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` - # permission on the provided key project. A - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} creation in the folder's - # descendant projects will use this configuration to determine where to - # create the resulting {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # @overload update_autokey_config(request, options = nil) - # Pass arguments to `update_autokey_config` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_autokey_config(autokey_config: nil, update_mask: nil) - # Pass arguments to `update_autokey_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param autokey_config [::Google::Cloud::Kms::V1::AutokeyConfig, ::Hash] - # Required. {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} with values to - # update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Masks which fields of the - # {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} to update, e.g. - # `keyProject`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::AutokeyConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::AutokeyConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new - # - # # Call the update_autokey_config method. - # result = client.update_autokey_config request - # - # # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. - # p result - # - def update_autokey_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_autokey_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.autokey_config&.name - header_params["autokey_config.name"] = request.autokey_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_autokey_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_autokey_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_admin_stub.call_rpc :update_autokey_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a - # folder. - # - # @overload get_autokey_config(request, options = nil) - # Pass arguments to `get_autokey_config` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetAutokeyConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetAutokeyConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_autokey_config(name: nil) - # Pass arguments to `get_autokey_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} - # resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::AutokeyConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::AutokeyConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new - # - # # Call the get_autokey_config method. - # result = client.get_autokey_config request - # - # # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. - # p result - # - def get_autokey_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_autokey_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_autokey_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_autokey_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_admin_stub.call_rpc :get_autokey_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the effective Cloud KMS Autokey configuration for a given project. - # - # @overload show_effective_autokey_config(request, options = nil) - # Pass arguments to `show_effective_autokey_config` via a request object, either of type - # {::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload show_effective_autokey_config(parent: nil) - # Pass arguments to `show_effective_autokey_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the resource project to the show effective Cloud KMS - # Autokey configuration for. This may be helpful for interrogating the effect - # of nested folder configurations on a given resource project. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new - # - # # Call the show_effective_autokey_config method. - # result = client.show_effective_autokey_config request - # - # # The returned object is of type Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse. - # p result - # - def show_effective_autokey_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.show_effective_autokey_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.show_effective_autokey_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.show_effective_autokey_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_admin_stub.call_rpc :show_effective_autokey_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the AutokeyAdmin API. - # - # This class represents the configuration for AutokeyAdmin, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # update_autokey_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.update_autokey_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.update_autokey_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the AutokeyAdmin API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `update_autokey_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_autokey_config - ## - # RPC-specific configuration for `get_autokey_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_autokey_config - ## - # RPC-specific configuration for `show_effective_autokey_config` - # @return [::Gapic::Config::Method] - # - attr_reader :show_effective_autokey_config - - # @private - def initialize parent_rpcs = nil - update_autokey_config_config = parent_rpcs.update_autokey_config if parent_rpcs.respond_to? :update_autokey_config - @update_autokey_config = ::Gapic::Config::Method.new update_autokey_config_config - get_autokey_config_config = parent_rpcs.get_autokey_config if parent_rpcs.respond_to? :get_autokey_config - @get_autokey_config = ::Gapic::Config::Method.new get_autokey_config_config - show_effective_autokey_config_config = parent_rpcs.show_effective_autokey_config if parent_rpcs.respond_to? :show_effective_autokey_config - @show_effective_autokey_config = ::Gapic::Config::Method.new show_effective_autokey_config_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/credentials.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/credentials.rb deleted file mode 100644 index 3abc17b0de30..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Kms - module V1 - module AutokeyAdmin - # Credentials for the AutokeyAdmin API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudkms" - ] - self.env_vars = [ - "KMS_CREDENTIALS", - "KMS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "KMS_CREDENTIALS_JSON", - "KMS_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/paths.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/paths.rb deleted file mode 100644 index dda918e24dfb..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/paths.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - module AutokeyAdmin - # Path helper methods for the AutokeyAdmin API. - module Paths - ## - # Create a fully-qualified AutokeyConfig resource string. - # - # The resource will be in the following format: - # - # `folders/{folder}/autokeyConfig` - # - # @param folder [String] - # - # @return [::String] - def autokey_config_path folder: - "folders/#{folder}/autokeyConfig" - end - - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest.rb deleted file mode 100644 index 0c3a78fbdad6..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/kms/v1/version" -require "google/cloud/kms/v1/bindings_override" - -require "google/cloud/kms/v1/autokey_admin/credentials" -require "google/cloud/kms/v1/autokey_admin/paths" -require "google/cloud/kms/v1/autokey_admin/rest/client" - -module Google - module Cloud - module Kms - module V1 - ## - # Provides interfaces for managing [Cloud KMS - # Autokey](https://cloud.google.com/kms/help/autokey) folder-level - # configurations. A configuration is inherited by all descendent projects. A - # configuration at one folder overrides any other configurations in its - # ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS - # Autokey, so that users working in a descendant project can request - # provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer - # Managed Encryption Key (CMEK) use, on-demand. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/kms/v1/autokey_admin/rest" - # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new - # - module AutokeyAdmin - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/kms/v1/autokey_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/client.rb deleted file mode 100644 index 328bb34b6385..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/client.rb +++ /dev/null @@ -1,672 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/kms/v1/autokey_admin_pb" -require "google/cloud/kms/v1/autokey_admin/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module Kms - module V1 - module AutokeyAdmin - module Rest - ## - # REST client for the AutokeyAdmin service. - # - # Provides interfaces for managing [Cloud KMS - # Autokey](https://cloud.google.com/kms/help/autokey) folder-level - # configurations. A configuration is inherited by all descendent projects. A - # configuration at one folder overrides any other configurations in its - # ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS - # Autokey, so that users working in a descendant project can request - # provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer - # Managed Encryption Key (CMEK) use, on-demand. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :autokey_admin_stub - - ## - # Configure the AutokeyAdmin Client class. - # - # See {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AutokeyAdmin clients - # ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Kms", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.update_autokey_config.timeout = 60.0 - default_config.rpcs.update_autokey_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_autokey_config.timeout = 60.0 - default_config.rpcs.get_autokey_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.show_effective_autokey_config.timeout = 60.0 - default_config.rpcs.show_effective_autokey_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the AutokeyAdmin Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @autokey_admin_stub.universe_domain - end - - ## - # Create a new AutokeyAdmin REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AutokeyAdmin client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @autokey_admin_stub = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @autokey_admin_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @autokey_admin_stub.endpoint - config.universe_domain = @autokey_admin_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @autokey_admin_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @autokey_admin_stub.endpoint - config.universe_domain = @autokey_admin_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @autokey_admin_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @autokey_admin_stub.logger - end - - # Service calls - - ## - # Updates the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a - # folder. The caller must have both `cloudkms.autokeyConfigs.update` - # permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` - # permission on the provided key project. A - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} creation in the folder's - # descendant projects will use this configuration to determine where to - # create the resulting {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # @overload update_autokey_config(request, options = nil) - # Pass arguments to `update_autokey_config` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_autokey_config(autokey_config: nil, update_mask: nil) - # Pass arguments to `update_autokey_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param autokey_config [::Google::Cloud::Kms::V1::AutokeyConfig, ::Hash] - # Required. {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} with values to - # update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Masks which fields of the - # {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} to update, e.g. - # `keyProject`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::AutokeyConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::AutokeyConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new - # - # # Call the update_autokey_config method. - # result = client.update_autokey_config request - # - # # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. - # p result - # - def update_autokey_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_autokey_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_autokey_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_autokey_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_admin_stub.update_autokey_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a - # folder. - # - # @overload get_autokey_config(request, options = nil) - # Pass arguments to `get_autokey_config` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetAutokeyConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetAutokeyConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_autokey_config(name: nil) - # Pass arguments to `get_autokey_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} - # resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::AutokeyConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::AutokeyConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new - # - # # Call the get_autokey_config method. - # result = client.get_autokey_config request - # - # # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. - # p result - # - def get_autokey_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_autokey_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_autokey_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_autokey_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_admin_stub.get_autokey_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the effective Cloud KMS Autokey configuration for a given project. - # - # @overload show_effective_autokey_config(request, options = nil) - # Pass arguments to `show_effective_autokey_config` via a request object, either of type - # {::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload show_effective_autokey_config(parent: nil) - # Pass arguments to `show_effective_autokey_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the resource project to the show effective Cloud KMS - # Autokey configuration for. This may be helpful for interrogating the effect - # of nested folder configurations on a given resource project. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new - # - # # Call the show_effective_autokey_config method. - # result = client.show_effective_autokey_config request - # - # # The returned object is of type Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse. - # p result - # - def show_effective_autokey_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.show_effective_autokey_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.show_effective_autokey_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.show_effective_autokey_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autokey_admin_stub.show_effective_autokey_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the AutokeyAdmin REST API. - # - # This class represents the configuration for AutokeyAdmin REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # update_autokey_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.update_autokey_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.update_autokey_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the AutokeyAdmin API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `update_autokey_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_autokey_config - ## - # RPC-specific configuration for `get_autokey_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_autokey_config - ## - # RPC-specific configuration for `show_effective_autokey_config` - # @return [::Gapic::Config::Method] - # - attr_reader :show_effective_autokey_config - - # @private - def initialize parent_rpcs = nil - update_autokey_config_config = parent_rpcs.update_autokey_config if parent_rpcs.respond_to? :update_autokey_config - @update_autokey_config = ::Gapic::Config::Method.new update_autokey_config_config - get_autokey_config_config = parent_rpcs.get_autokey_config if parent_rpcs.respond_to? :get_autokey_config - @get_autokey_config = ::Gapic::Config::Method.new get_autokey_config_config - show_effective_autokey_config_config = parent_rpcs.show_effective_autokey_config if parent_rpcs.respond_to? :show_effective_autokey_config - @show_effective_autokey_config = ::Gapic::Config::Method.new show_effective_autokey_config_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/service_stub.rb deleted file mode 100644 index 39ee0ffcfee9..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin/rest/service_stub.rb +++ /dev/null @@ -1,265 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/kms/v1/autokey_admin_pb" - -module Google - module Cloud - module Kms - module V1 - module AutokeyAdmin - module Rest - ## - # REST service stub for the AutokeyAdmin service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the update_autokey_config REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::AutokeyConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::AutokeyConfig] - # A result object deserialized from the server's reply - def update_autokey_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_autokey_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_autokey_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::AutokeyConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_autokey_config REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetAutokeyConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::AutokeyConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::AutokeyConfig] - # A result object deserialized from the server's reply - def get_autokey_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_autokey_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_autokey_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::AutokeyConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the show_effective_autokey_config REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse] - # A result object deserialized from the server's reply - def show_effective_autokey_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_show_effective_autokey_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "show_effective_autokey_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the update_autokey_config REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_autokey_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{autokey_config.name}", - body: "autokey_config", - matches: [ - ["autokey_config.name", %r{^folders/[^/]+/autokeyConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_autokey_config REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetAutokeyConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_autokey_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/autokeyConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the show_effective_autokey_config REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_show_effective_autokey_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}:showEffectiveAutokeyConfig", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_pb.rb deleted file mode 100644 index a0206e2b0b5b..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/kms/v1/autokey_admin.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n\'google/cloud/kms/v1/autokey_admin.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\x93\x01\n\x1aUpdateAutokeyConfigRequest\x12?\n\x0e\x61utokey_config\x18\x01 \x01(\x0b\x32\".google.cloud.kms.v1.AutokeyConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"V\n\x17GetAutokeyConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%cloudkms.googleapis.com/AutokeyConfig\"\xd0\x02\n\rAutokeyConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x0bkey_project\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12<\n\x05state\x18\x04 \x01(\x0e\x32(.google.cloud.kms.v1.AutokeyConfig.StateB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x01\"V\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x17\n\x13KEY_PROJECT_DELETED\x10\x02\x12\x11\n\rUNINITIALIZED\x10\x03:i\xea\x41\x66\n%cloudkms.googleapis.com/AutokeyConfig\x12\x1e\x66olders/{folder}/autokeyConfig*\x0e\x61utokeyConfigs2\rautokeyConfig\"h\n!ShowEffectiveAutokeyConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\"9\n\"ShowEffectiveAutokeyConfigResponse\x12\x13\n\x0bkey_project\x18\x01 \x01(\t2\xc8\x05\n\x0c\x41utokeyAdmin\x12\xd2\x01\n\x13UpdateAutokeyConfig\x12/.google.cloud.kms.v1.UpdateAutokeyConfigRequest\x1a\".google.cloud.kms.v1.AutokeyConfig\"f\xda\x41\x1a\x61utokey_config,update_mask\x82\xd3\xe4\x93\x02\x43\x32\x31/v1/{autokey_config.name=folders/*/autokeyConfig}:\x0e\x61utokey_config\x12\x97\x01\n\x10GetAutokeyConfig\x12,.google.cloud.kms.v1.GetAutokeyConfigRequest\x1a\".google.cloud.kms.v1.AutokeyConfig\"1\xda\x41\x04name\x82\xd3\xe4\x93\x02$\x12\"/v1/{name=folders/*/autokeyConfig}\x12\xd2\x01\n\x1aShowEffectiveAutokeyConfig\x12\x36.google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest\x1a\x37.google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*}:showEffectiveAutokeyConfig\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsBY\n\x17\x63om.google.cloud.kms.v1B\x11\x41utokeyAdminProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspbb\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Kms - module V1 - UpdateAutokeyConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateAutokeyConfigRequest").msgclass - GetAutokeyConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetAutokeyConfigRequest").msgclass - AutokeyConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AutokeyConfig").msgclass - AutokeyConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AutokeyConfig.State").enummodule - ShowEffectiveAutokeyConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ShowEffectiveAutokeyConfigRequest").msgclass - ShowEffectiveAutokeyConfigResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ShowEffectiveAutokeyConfigResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_services_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_services_pb.rb deleted file mode 100644 index 69def3e1b391..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin_services_pb.rb +++ /dev/null @@ -1,63 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/kms/v1/autokey_admin.proto for package 'google.cloud.kms.v1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/kms/v1/autokey_admin_pb' - -module Google - module Cloud - module Kms - module V1 - module AutokeyAdmin - # Provides interfaces for managing [Cloud KMS - # Autokey](https://cloud.google.com/kms/help/autokey) folder-level - # configurations. A configuration is inherited by all descendent projects. A - # configuration at one folder overrides any other configurations in its - # ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS - # Autokey, so that users working in a descendant project can request - # provisioned [CryptoKeys][google.cloud.kms.v1.CryptoKey], ready for Customer - # Managed Encryption Key (CMEK) use, on-demand. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.kms.v1.AutokeyAdmin' - - # Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - # folder. The caller must have both `cloudkms.autokeyConfigs.update` - # permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` - # permission on the provided key project. A - # [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's - # descendant projects will use this configuration to determine where to - # create the resulting [CryptoKey][google.cloud.kms.v1.CryptoKey]. - rpc :UpdateAutokeyConfig, ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest, ::Google::Cloud::Kms::V1::AutokeyConfig - # Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - # folder. - rpc :GetAutokeyConfig, ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest, ::Google::Cloud::Kms::V1::AutokeyConfig - # Returns the effective Cloud KMS Autokey configuration for a given project. - rpc :ShowEffectiveAutokeyConfig, ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest, ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_pb.rb deleted file mode 100644 index e7436313253e..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/kms/v1/autokey.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/longrunning/operations_pb' - - -descriptor_data = "\n!google/cloud/kms/v1/autokey.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\"\xa8\x01\n\x16\x43reateKeyHandleRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x1a\n\rkey_handle_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x37\n\nkey_handle\x18\x03 \x01(\x0b\x32\x1e.google.cloud.kms.v1.KeyHandleB\x03\xe0\x41\x02\"N\n\x13GetKeyHandleRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/KeyHandle\"\xff\x01\n\tKeyHandle\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12:\n\x07kms_key\x18\x03 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12#\n\x16resource_type_selector\x18\x04 \x01(\tB\x03\xe0\x41\x02:~\xea\x41{\n!cloudkms.googleapis.com/KeyHandle\x12?projects/{project}/locations/{location}/keyHandles/{key_handle}*\nkeyHandles2\tkeyHandle\"\x19\n\x17\x43reateKeyHandleMetadata\"\x98\x01\n\x15ListKeyHandlesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"f\n\x16ListKeyHandlesResponse\x12\x33\n\x0bkey_handles\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.KeyHandle\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xb4\x05\n\x07\x41utokey\x12\xeb\x01\n\x0f\x43reateKeyHandle\x12+.google.cloud.kms.v1.CreateKeyHandleRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41$\n\tKeyHandle\x12\x17\x43reateKeyHandleMetadata\xda\x41\x1fparent,key_handle,key_handle_id\x82\xd3\xe4\x93\x02<\"./v1/{parent=projects/*/locations/*}/keyHandles:\nkey_handle\x12\x97\x01\n\x0cGetKeyHandle\x12(.google.cloud.kms.v1.GetKeyHandleRequest\x1a\x1e.google.cloud.kms.v1.KeyHandle\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/keyHandles/*}\x12\xaa\x01\n\x0eListKeyHandles\x12*.google.cloud.kms.v1.ListKeyHandlesRequest\x1a+.google.cloud.kms.v1.ListKeyHandlesResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/keyHandles\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsBT\n\x17\x63om.google.cloud.kms.v1B\x0c\x41utokeyProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspbb\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Kms - module V1 - CreateKeyHandleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateKeyHandleRequest").msgclass - GetKeyHandleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetKeyHandleRequest").msgclass - KeyHandle = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyHandle").msgclass - CreateKeyHandleMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateKeyHandleMetadata").msgclass - ListKeyHandlesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListKeyHandlesRequest").msgclass - ListKeyHandlesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListKeyHandlesResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_services_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_services_pb.rb deleted file mode 100644 index ea3c5fa78db4..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_services_pb.rb +++ /dev/null @@ -1,72 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/kms/v1/autokey.proto for package 'google.cloud.kms.v1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/kms/v1/autokey_pb' - -module Google - module Cloud - module Kms - module V1 - module Autokey - # Provides interfaces for using [Cloud KMS - # Autokey](https://cloud.google.com/kms/help/autokey) to provision new - # [CryptoKeys][google.cloud.kms.v1.CryptoKey], ready for Customer Managed - # Encryption Key (CMEK) use, on-demand. To support certain client tooling, this - # feature is modeled around a [KeyHandle][google.cloud.kms.v1.KeyHandle] - # resource: creating a [KeyHandle][google.cloud.kms.v1.KeyHandle] in a resource - # project and given location triggers Cloud KMS Autokey to provision a - # [CryptoKey][google.cloud.kms.v1.CryptoKey] in the configured key project and - # the same location. - # - # Prior to use in a given resource project, - # [UpdateAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig] - # should have been called on an ancestor folder, setting the key project where - # Cloud KMS Autokey should create new - # [CryptoKeys][google.cloud.kms.v1.CryptoKey]. See documentation for additional - # prerequisites. To check what key project, if any, is currently configured on - # a resource project's ancestor folder, see - # [ShowEffectiveAutokeyConfig][google.cloud.kms.v1.AutokeyAdmin.ShowEffectiveAutokeyConfig]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.kms.v1.Autokey' - - # Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the - # provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK - # use with the given resource type in the configured key project and the same - # location. [GetOperation][google.longrunning.Operations.GetOperation] should - # be used to resolve the resulting long-running operation and get the - # resulting [KeyHandle][google.cloud.kms.v1.KeyHandle] and - # [CryptoKey][google.cloud.kms.v1.CryptoKey]. - rpc :CreateKeyHandle, ::Google::Cloud::Kms::V1::CreateKeyHandleRequest, ::Google::Longrunning::Operation - # Returns the [KeyHandle][google.cloud.kms.v1.KeyHandle]. - rpc :GetKeyHandle, ::Google::Cloud::Kms::V1::GetKeyHandleRequest, ::Google::Cloud::Kms::V1::KeyHandle - # Lists [KeyHandles][google.cloud.kms.v1.KeyHandle]. - rpc :ListKeyHandles, ::Google::Cloud::Kms::V1::ListKeyHandlesRequest, ::Google::Cloud::Kms::V1::ListKeyHandlesResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/bindings_override.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/bindings_override.rb deleted file mode 100644 index c2fbb5e8bbe9..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/bindings_override.rb +++ /dev/null @@ -1,204 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module Kms - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/kms/v1/rest" - # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Kms"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/importJobs/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/importJobs/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/importJobs/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service.rb deleted file mode 100644 index 1c6057f40df4..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/kms/v1/version" - -require "google/cloud/kms/v1/ekm_service/credentials" -require "google/cloud/kms/v1/ekm_service/paths" -require "google/cloud/kms/v1/ekm_service/client" -require "google/cloud/kms/v1/ekm_service/rest" - -module Google - module Cloud - module Kms - module V1 - ## - # Google Cloud Key Management EKM Service - # - # Manages external cryptographic keys and operations using those keys. - # Implements a REST model with the following objects: - # * {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/kms/v1/ekm_service" - # client = ::Google::Cloud::Kms::V1::EkmService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/kms/v1/ekm_service/rest" - # client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new - # - module EkmService - end - end - end - end -end - -helper_path = ::File.join __dir__, "ekm_service", "helpers.rb" -require "google/cloud/kms/v1/ekm_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb deleted file mode 100644 index 42b2a512abe5..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb +++ /dev/null @@ -1,1135 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/kms/v1/ekm_service_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module Kms - module V1 - module EkmService - ## - # Client for the EkmService service. - # - # Google Cloud Key Management EKM Service - # - # Manages external cryptographic keys and operations using those keys. - # Implements a REST model with the following objects: - # * {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :ekm_service_stub - - ## - # Configure the EkmService Client class. - # - # See {::Google::Cloud::Kms::V1::EkmService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EkmService clients - # ::Google::Cloud::Kms::V1::EkmService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Kms", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_ekm_connections.timeout = 60.0 - default_config.rpcs.list_ekm_connections.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_ekm_connection.timeout = 60.0 - default_config.rpcs.get_ekm_connection.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_ekm_connection.timeout = 60.0 - default_config.rpcs.create_ekm_connection.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_ekm_connection.timeout = 60.0 - default_config.rpcs.update_ekm_connection.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EkmService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Kms::V1::EkmService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @ekm_service_stub.universe_domain - end - - ## - # Create a new EkmService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Kms::V1::EkmService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EkmService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/kms/v1/ekm_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @ekm_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Kms::V1::EkmService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @ekm_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @ekm_service_stub.endpoint - config.universe_domain = @ekm_service_stub.universe_domain - config.logger = @ekm_service_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @ekm_service_stub.endpoint - config.universe_domain = @ekm_service_stub.universe_domain - config.logger = @ekm_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @ekm_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::Kms::V1::EkmConnection EkmConnections}. - # - # @overload list_ekm_connections(request, options = nil) - # Pass arguments to `list_ekm_connections` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListEkmConnectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListEkmConnectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_ekm_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_ekm_connections` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to list, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to include in the - # response. Further {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} can - # subsequently be obtained by including the - # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token}. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new - # - # # Call the list_ekm_connections method. - # result = client.list_ekm_connections request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::EkmConnection. - # p item - # end - # - def list_ekm_connections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_ekm_connections.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_ekm_connections.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_ekm_connections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.call_rpc :list_ekm_connections, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @ekm_service_stub, :list_ekm_connections, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. - # - # @overload get_ekm_connection(request, options = nil) - # Pass arguments to `get_ekm_connection` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetEkmConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetEkmConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_ekm_connection(name: nil) - # Pass arguments to `get_ekm_connection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::EkmConnection] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::EkmConnection] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetEkmConnectionRequest.new - # - # # Call the get_ekm_connection method. - # result = client.get_ekm_connection request - # - # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. - # p result - # - def get_ekm_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetEkmConnectionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_ekm_connection.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_ekm_connection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_ekm_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.call_rpc :get_ekm_connection, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} in a given - # Project and Location. - # - # @overload create_ekm_connection(request, options = nil) - # Pass arguments to `create_ekm_connection` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateEkmConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateEkmConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_ekm_connection(parent: nil, ekm_connection_id: nil, ekm_connection: nil) - # Pass arguments to `create_ekm_connection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}, in the format - # `projects/*/locations/*`. - # @param ekm_connection_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. - # @param ekm_connection [::Google::Cloud::Kms::V1::EkmConnection, ::Hash] - # Required. An {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with - # initial field values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::EkmConnection] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::EkmConnection] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new - # - # # Call the create_ekm_connection method. - # result = client.create_ekm_connection request - # - # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. - # p result - # - def create_ekm_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_ekm_connection.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_ekm_connection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_ekm_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.call_rpc :create_ekm_connection, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}'s metadata. - # - # @overload update_ekm_connection(request, options = nil) - # Pass arguments to `update_ekm_connection` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_ekm_connection(ekm_connection: nil, update_mask: nil) - # Pass arguments to `update_ekm_connection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param ekm_connection [::Google::Cloud::Kms::V1::EkmConnection, ::Hash] - # Required. {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with updated - # values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::EkmConnection] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::EkmConnection] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new - # - # # Call the update_ekm_connection method. - # result = client.update_ekm_connection request - # - # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. - # p result - # - def update_ekm_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_ekm_connection.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.ekm_connection&.name - header_params["ekm_connection.name"] = request.ekm_connection.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_ekm_connection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_ekm_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.call_rpc :update_ekm_connection, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} singleton resource - # for a given project and location. - # - # @overload get_ekm_config(request, options = nil) - # Pass arguments to `get_ekm_config` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetEkmConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetEkmConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_ekm_config(name: nil) - # Pass arguments to `get_ekm_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::EkmConfig#name name} of the - # {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::EkmConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::EkmConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetEkmConfigRequest.new - # - # # Call the get_ekm_config method. - # result = client.get_ekm_config request - # - # # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. - # p result - # - def get_ekm_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetEkmConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_ekm_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_ekm_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_ekm_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.call_rpc :get_ekm_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} singleton resource - # for a given project and location. - # - # @overload update_ekm_config(request, options = nil) - # Pass arguments to `update_ekm_config` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateEkmConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateEkmConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_ekm_config(ekm_config: nil, update_mask: nil) - # Pass arguments to `update_ekm_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param ekm_config [::Google::Cloud::Kms::V1::EkmConfig, ::Hash] - # Required. {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::EkmConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::EkmConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new - # - # # Call the update_ekm_config method. - # result = client.update_ekm_config request - # - # # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. - # p result - # - def update_ekm_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_ekm_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.ekm_config&.name - header_params["ekm_config.name"] = request.ekm_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_ekm_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_ekm_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.call_rpc :update_ekm_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Verifies that Cloud KMS can successfully connect to the external key - # manager specified by an {::Google::Cloud::Kms::V1::EkmConnection 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. - # - # @overload verify_connectivity(request, options = nil) - # Pass arguments to `verify_connectivity` via a request object, either of type - # {::Google::Cloud::Kms::V1::VerifyConnectivityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::VerifyConnectivityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload verify_connectivity(name: nil) - # Pass arguments to `verify_connectivity` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to verify. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::VerifyConnectivityRequest.new - # - # # Call the verify_connectivity method. - # result = client.verify_connectivity request - # - # # The returned object is of type Google::Cloud::Kms::V1::VerifyConnectivityResponse. - # p result - # - def verify_connectivity request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::VerifyConnectivityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.verify_connectivity.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.verify_connectivity.timeout, - metadata: metadata, - retry_policy: @config.rpcs.verify_connectivity.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.call_rpc :verify_connectivity, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the EkmService API. - # - # This class represents the configuration for EkmService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Kms::V1::EkmService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_ekm_connections to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Kms::V1::EkmService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_ekm_connections.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_ekm_connections.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the EkmService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_ekm_connections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_ekm_connections - ## - # RPC-specific configuration for `get_ekm_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_ekm_connection - ## - # RPC-specific configuration for `create_ekm_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :create_ekm_connection - ## - # RPC-specific configuration for `update_ekm_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :update_ekm_connection - ## - # RPC-specific configuration for `get_ekm_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_ekm_config - ## - # RPC-specific configuration for `update_ekm_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_ekm_config - ## - # RPC-specific configuration for `verify_connectivity` - # @return [::Gapic::Config::Method] - # - attr_reader :verify_connectivity - - # @private - def initialize parent_rpcs = nil - list_ekm_connections_config = parent_rpcs.list_ekm_connections if parent_rpcs.respond_to? :list_ekm_connections - @list_ekm_connections = ::Gapic::Config::Method.new list_ekm_connections_config - get_ekm_connection_config = parent_rpcs.get_ekm_connection if parent_rpcs.respond_to? :get_ekm_connection - @get_ekm_connection = ::Gapic::Config::Method.new get_ekm_connection_config - create_ekm_connection_config = parent_rpcs.create_ekm_connection if parent_rpcs.respond_to? :create_ekm_connection - @create_ekm_connection = ::Gapic::Config::Method.new create_ekm_connection_config - update_ekm_connection_config = parent_rpcs.update_ekm_connection if parent_rpcs.respond_to? :update_ekm_connection - @update_ekm_connection = ::Gapic::Config::Method.new update_ekm_connection_config - get_ekm_config_config = parent_rpcs.get_ekm_config if parent_rpcs.respond_to? :get_ekm_config - @get_ekm_config = ::Gapic::Config::Method.new get_ekm_config_config - update_ekm_config_config = parent_rpcs.update_ekm_config if parent_rpcs.respond_to? :update_ekm_config - @update_ekm_config = ::Gapic::Config::Method.new update_ekm_config_config - verify_connectivity_config = parent_rpcs.verify_connectivity if parent_rpcs.respond_to? :verify_connectivity - @verify_connectivity = ::Gapic::Config::Method.new verify_connectivity_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/credentials.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/credentials.rb deleted file mode 100644 index f7ad3e219c05..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Kms - module V1 - module EkmService - # Credentials for the EkmService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudkms" - ] - self.env_vars = [ - "KMS_CREDENTIALS", - "KMS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "KMS_CREDENTIALS_JSON", - "KMS_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/paths.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/paths.rb deleted file mode 100644 index de7196b5df1d..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/paths.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - module EkmService - # Path helper methods for the EkmService API. - module Paths - ## - # Create a fully-qualified EkmConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/ekmConfig` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def ekm_config_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/ekmConfig" - end - - ## - # Create a fully-qualified EkmConnection resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/ekmConnections/{ekm_connection}` - # - # @param project [String] - # @param location [String] - # @param ekm_connection [String] - # - # @return [::String] - def ekm_connection_path project:, location:, ekm_connection: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/ekmConnections/#{ekm_connection}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Service resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` - # - # @param project [String] - # @param location [String] - # @param namespace [String] - # @param service [String] - # - # @return [::String] - def service_path project:, location:, namespace:, service: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" - - "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest.rb deleted file mode 100644 index c7b2d679ce67..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/kms/v1/version" -require "google/cloud/kms/v1/bindings_override" - -require "google/cloud/kms/v1/ekm_service/credentials" -require "google/cloud/kms/v1/ekm_service/paths" -require "google/cloud/kms/v1/ekm_service/rest/client" - -module Google - module Cloud - module Kms - module V1 - ## - # Google Cloud Key Management EKM Service - # - # Manages external cryptographic keys and operations using those keys. - # Implements a REST model with the following objects: - # * {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/kms/v1/ekm_service/rest" - # client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new - # - module EkmService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/kms/v1/ekm_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb deleted file mode 100644 index 961ea4ed64e2..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb +++ /dev/null @@ -1,1052 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/kms/v1/ekm_service_pb" -require "google/cloud/kms/v1/ekm_service/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module Kms - module V1 - module EkmService - module Rest - ## - # REST client for the EkmService service. - # - # Google Cloud Key Management EKM Service - # - # Manages external cryptographic keys and operations using those keys. - # Implements a REST model with the following objects: - # * {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :ekm_service_stub - - ## - # Configure the EkmService Client class. - # - # See {::Google::Cloud::Kms::V1::EkmService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EkmService clients - # ::Google::Cloud::Kms::V1::EkmService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Kms", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_ekm_connections.timeout = 60.0 - default_config.rpcs.list_ekm_connections.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_ekm_connection.timeout = 60.0 - default_config.rpcs.get_ekm_connection.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_ekm_connection.timeout = 60.0 - default_config.rpcs.create_ekm_connection.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_ekm_connection.timeout = 60.0 - default_config.rpcs.update_ekm_connection.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EkmService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Kms::V1::EkmService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @ekm_service_stub.universe_domain - end - - ## - # Create a new EkmService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EkmService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @ekm_service_stub = ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @ekm_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @ekm_service_stub.endpoint - config.universe_domain = @ekm_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @ekm_service_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @ekm_service_stub.endpoint - config.universe_domain = @ekm_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @ekm_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @ekm_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::Kms::V1::EkmConnection EkmConnections}. - # - # @overload list_ekm_connections(request, options = nil) - # Pass arguments to `list_ekm_connections` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListEkmConnectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListEkmConnectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_ekm_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_ekm_connections` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to list, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to include in the - # response. Further {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} can - # subsequently be obtained by including the - # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token}. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new - # - # # Call the list_ekm_connections method. - # result = client.list_ekm_connections request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::EkmConnection. - # p item - # end - # - def list_ekm_connections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_ekm_connections.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_ekm_connections.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_ekm_connections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.list_ekm_connections request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @ekm_service_stub, :list_ekm_connections, "ekm_connections", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. - # - # @overload get_ekm_connection(request, options = nil) - # Pass arguments to `get_ekm_connection` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetEkmConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetEkmConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_ekm_connection(name: nil) - # Pass arguments to `get_ekm_connection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EkmConnection] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetEkmConnectionRequest.new - # - # # Call the get_ekm_connection method. - # result = client.get_ekm_connection request - # - # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. - # p result - # - def get_ekm_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetEkmConnectionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_ekm_connection.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_ekm_connection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_ekm_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.get_ekm_connection request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} in a given - # Project and Location. - # - # @overload create_ekm_connection(request, options = nil) - # Pass arguments to `create_ekm_connection` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateEkmConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateEkmConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_ekm_connection(parent: nil, ekm_connection_id: nil, ekm_connection: nil) - # Pass arguments to `create_ekm_connection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}, in the format - # `projects/*/locations/*`. - # @param ekm_connection_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. - # @param ekm_connection [::Google::Cloud::Kms::V1::EkmConnection, ::Hash] - # Required. An {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with - # initial field values. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EkmConnection] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new - # - # # Call the create_ekm_connection method. - # result = client.create_ekm_connection request - # - # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. - # p result - # - def create_ekm_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_ekm_connection.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_ekm_connection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_ekm_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.create_ekm_connection request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}'s metadata. - # - # @overload update_ekm_connection(request, options = nil) - # Pass arguments to `update_ekm_connection` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_ekm_connection(ekm_connection: nil, update_mask: nil) - # Pass arguments to `update_ekm_connection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param ekm_connection [::Google::Cloud::Kms::V1::EkmConnection, ::Hash] - # Required. {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with updated - # values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EkmConnection] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new - # - # # Call the update_ekm_connection method. - # result = client.update_ekm_connection request - # - # # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. - # p result - # - def update_ekm_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_ekm_connection.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_ekm_connection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_ekm_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.update_ekm_connection request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} singleton resource - # for a given project and location. - # - # @overload get_ekm_config(request, options = nil) - # Pass arguments to `get_ekm_config` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetEkmConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetEkmConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_ekm_config(name: nil) - # Pass arguments to `get_ekm_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::EkmConfig#name name} of the - # {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EkmConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EkmConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetEkmConfigRequest.new - # - # # Call the get_ekm_config method. - # result = client.get_ekm_config request - # - # # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. - # p result - # - def get_ekm_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetEkmConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_ekm_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_ekm_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_ekm_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.get_ekm_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} singleton resource - # for a given project and location. - # - # @overload update_ekm_config(request, options = nil) - # Pass arguments to `update_ekm_config` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateEkmConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateEkmConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_ekm_config(ekm_config: nil, update_mask: nil) - # Pass arguments to `update_ekm_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param ekm_config [::Google::Cloud::Kms::V1::EkmConfig, ::Hash] - # Required. {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EkmConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EkmConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new - # - # # Call the update_ekm_config method. - # result = client.update_ekm_config request - # - # # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. - # p result - # - def update_ekm_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_ekm_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_ekm_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_ekm_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.update_ekm_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Verifies that Cloud KMS can successfully connect to the external key - # manager specified by an {::Google::Cloud::Kms::V1::EkmConnection 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. - # - # @overload verify_connectivity(request, options = nil) - # Pass arguments to `verify_connectivity` via a request object, either of type - # {::Google::Cloud::Kms::V1::VerifyConnectivityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::VerifyConnectivityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload verify_connectivity(name: nil) - # Pass arguments to `verify_connectivity` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to verify. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::EkmService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::VerifyConnectivityRequest.new - # - # # Call the verify_connectivity method. - # result = client.verify_connectivity request - # - # # The returned object is of type Google::Cloud::Kms::V1::VerifyConnectivityResponse. - # p result - # - def verify_connectivity request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::VerifyConnectivityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.verify_connectivity.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.verify_connectivity.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.verify_connectivity.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @ekm_service_stub.verify_connectivity request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the EkmService REST API. - # - # This class represents the configuration for EkmService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Kms::V1::EkmService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_ekm_connections to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Kms::V1::EkmService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_ekm_connections.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_ekm_connections.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the EkmService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_ekm_connections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_ekm_connections - ## - # RPC-specific configuration for `get_ekm_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_ekm_connection - ## - # RPC-specific configuration for `create_ekm_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :create_ekm_connection - ## - # RPC-specific configuration for `update_ekm_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :update_ekm_connection - ## - # RPC-specific configuration for `get_ekm_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_ekm_config - ## - # RPC-specific configuration for `update_ekm_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_ekm_config - ## - # RPC-specific configuration for `verify_connectivity` - # @return [::Gapic::Config::Method] - # - attr_reader :verify_connectivity - - # @private - def initialize parent_rpcs = nil - list_ekm_connections_config = parent_rpcs.list_ekm_connections if parent_rpcs.respond_to? :list_ekm_connections - @list_ekm_connections = ::Gapic::Config::Method.new list_ekm_connections_config - get_ekm_connection_config = parent_rpcs.get_ekm_connection if parent_rpcs.respond_to? :get_ekm_connection - @get_ekm_connection = ::Gapic::Config::Method.new get_ekm_connection_config - create_ekm_connection_config = parent_rpcs.create_ekm_connection if parent_rpcs.respond_to? :create_ekm_connection - @create_ekm_connection = ::Gapic::Config::Method.new create_ekm_connection_config - update_ekm_connection_config = parent_rpcs.update_ekm_connection if parent_rpcs.respond_to? :update_ekm_connection - @update_ekm_connection = ::Gapic::Config::Method.new update_ekm_connection_config - get_ekm_config_config = parent_rpcs.get_ekm_config if parent_rpcs.respond_to? :get_ekm_config - @get_ekm_config = ::Gapic::Config::Method.new get_ekm_config_config - update_ekm_config_config = parent_rpcs.update_ekm_config if parent_rpcs.respond_to? :update_ekm_config - @update_ekm_config = ::Gapic::Config::Method.new update_ekm_config_config - verify_connectivity_config = parent_rpcs.verify_connectivity if parent_rpcs.respond_to? :verify_connectivity - @verify_connectivity = ::Gapic::Config::Method.new verify_connectivity_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb deleted file mode 100644 index 81e6c86bca0f..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb +++ /dev/null @@ -1,511 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/kms/v1/ekm_service_pb" - -module Google - module Cloud - module Kms - module V1 - module EkmService - module Rest - ## - # REST service stub for the EkmService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_ekm_connections REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListEkmConnectionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ListEkmConnectionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ListEkmConnectionsResponse] - # A result object deserialized from the server's reply - def list_ekm_connections request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_ekm_connections_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_ekm_connections", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ListEkmConnectionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_ekm_connection REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetEkmConnectionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EkmConnection] - # A result object deserialized from the server's reply - def get_ekm_connection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_ekm_connection_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_ekm_connection", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::EkmConnection.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_ekm_connection REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateEkmConnectionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EkmConnection] - # A result object deserialized from the server's reply - def create_ekm_connection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_ekm_connection_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_ekm_connection", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::EkmConnection.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_ekm_connection REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EkmConnection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EkmConnection] - # A result object deserialized from the server's reply - def update_ekm_connection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_ekm_connection_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_ekm_connection", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::EkmConnection.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_ekm_config REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetEkmConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EkmConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EkmConfig] - # A result object deserialized from the server's reply - def get_ekm_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_ekm_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_ekm_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::EkmConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_ekm_config REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateEkmConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EkmConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EkmConfig] - # A result object deserialized from the server's reply - def update_ekm_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_ekm_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_ekm_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::EkmConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the verify_connectivity REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::VerifyConnectivityRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::VerifyConnectivityResponse] - # A result object deserialized from the server's reply - def verify_connectivity request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_verify_connectivity_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "verify_connectivity", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::VerifyConnectivityResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_ekm_connections REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListEkmConnectionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_ekm_connections_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/ekmConnections", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_ekm_connection REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetEkmConnectionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_ekm_connection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_ekm_connection REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateEkmConnectionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_ekm_connection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/ekmConnections", - body: "ekm_connection", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_ekm_connection REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_ekm_connection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{ekm_connection.name}", - body: "ekm_connection", - matches: [ - ["ekm_connection.name", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_ekm_config REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetEkmConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_ekm_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_ekm_config REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateEkmConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_ekm_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{ekm_config.name}", - body: "ekm_config", - matches: [ - ["ekm_config.name", %r{^projects/[^/]+/locations/[^/]+/ekmConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the verify_connectivity REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::VerifyConnectivityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_verify_connectivity_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}:verifyConnectivity", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_pb.rb deleted file mode 100644 index b543f3cec3ad..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_pb.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/kms/v1/ekm_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n%google/cloud/kms/v1/ekm_service.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb3\x01\n\x19ListEkmConnectionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x86\x01\n\x1aListEkmConnectionsResponse\x12;\n\x0f\x65km_connections\x18\x01 \x03(\x0b\x32\".google.cloud.kms.v1.EkmConnection\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"V\n\x17GetEkmConnectionRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%cloudkms.googleapis.com/EkmConnection\"\xb8\x01\n\x1a\x43reateEkmConnectionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x1e\n\x11\x65km_connection_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x0e\x65km_connection\x18\x03 \x01(\x0b\x32\".google.cloud.kms.v1.EkmConnectionB\x03\xe0\x41\x02\"\x93\x01\n\x1aUpdateEkmConnectionRequest\x12?\n\x0e\x65km_connection\x18\x01 \x01(\x0b\x32\".google.cloud.kms.v1.EkmConnectionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"N\n\x13GetEkmConfigRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/EkmConfig\"\x87\x01\n\x16UpdateEkmConfigRequest\x12\x37\n\nekm_config\x18\x01 \x01(\x0b\x32\x1e.google.cloud.kms.v1.EkmConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xbf\x02\n\x0b\x43\x65rtificate\x12\x14\n\x07raw_der\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x13\n\x06parsed\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x12\x13\n\x06issuer\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07subject\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12*\n\x1dsubject_alternative_dns_names\x18\x05 \x03(\tB\x03\xe0\x41\x03\x12\x38\n\x0fnot_before_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x37\n\x0enot_after_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1a\n\rserial_number\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12sha256_fingerprint\x18\t \x01(\tB\x03\xe0\x41\x03\"\xe2\x05\n\rEkmConnection\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12R\n\x11service_resolvers\x18\x03 \x03(\x0b\x32\x32.google.cloud.kms.v1.EkmConnection.ServiceResolverB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12V\n\x13key_management_mode\x18\x06 \x01(\x0e\x32\x34.google.cloud.kms.v1.EkmConnection.KeyManagementModeB\x03\xe0\x41\x01\x12\x1e\n\x11\x63rypto_space_path\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xde\x01\n\x0fServiceResolver\x12R\n\x19service_directory_service\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12\x1c\n\x0f\x65ndpoint_filter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08hostname\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x42\n\x13server_certificates\x18\x04 \x03(\x0b\x32 .google.cloud.kms.v1.CertificateB\x03\xe0\x41\x02\"S\n\x11KeyManagementMode\x12#\n\x1fKEY_MANAGEMENT_MODE_UNSPECIFIED\x10\x00\x12\n\n\x06MANUAL\x10\x01\x12\r\n\tCLOUD_KMS\x10\x02:s\xea\x41p\n%cloudkms.googleapis.com/EkmConnection\x12Gprojects/{project}/locations/{location}/ekmConnections/{ekm_connection}\"\xc8\x01\n\tEkmConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12M\n\x16\x64\x65\x66\x61ult_ekm_connection\x18\x02 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%cloudkms.googleapis.com/EkmConnection:Y\xea\x41V\n!cloudkms.googleapis.com/EkmConfig\x12\x31projects/{project}/locations/{location}/ekmConfig\"X\n\x19VerifyConnectivityRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%cloudkms.googleapis.com/EkmConnection\"\x1c\n\x1aVerifyConnectivityResponse2\xdc\x0b\n\nEkmService\x12\xba\x01\n\x12ListEkmConnections\x12..google.cloud.kms.v1.ListEkmConnectionsRequest\x1a/.google.cloud.kms.v1.ListEkmConnectionsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/ekmConnections\x12\xa7\x01\n\x10GetEkmConnection\x12,.google.cloud.kms.v1.GetEkmConnectionRequest\x1a\".google.cloud.kms.v1.EkmConnection\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/ekmConnections/*}\x12\xe0\x01\n\x13\x43reateEkmConnection\x12/.google.cloud.kms.v1.CreateEkmConnectionRequest\x1a\".google.cloud.kms.v1.EkmConnection\"t\xda\x41\'parent,ekm_connection_id,ekm_connection\x82\xd3\xe4\x93\x02\x44\"2/v1/{parent=projects/*/locations/*}/ekmConnections:\x0e\x65km_connection\x12\xe2\x01\n\x13UpdateEkmConnection\x12/.google.cloud.kms.v1.UpdateEkmConnectionRequest\x1a\".google.cloud.kms.v1.EkmConnection\"v\xda\x41\x1a\x65km_connection,update_mask\x82\xd3\xe4\x93\x02S2A/v1/{ekm_connection.name=projects/*/locations/*/ekmConnections/*}:\x0e\x65km_connection\x12\x94\x01\n\x0cGetEkmConfig\x12(.google.cloud.kms.v1.GetEkmConfigRequest\x1a\x1e.google.cloud.kms.v1.EkmConfig\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/ekmConfig}\x12\xc3\x01\n\x0fUpdateEkmConfig\x12+.google.cloud.kms.v1.UpdateEkmConfigRequest\x1a\x1e.google.cloud.kms.v1.EkmConfig\"c\xda\x41\x16\x65km_config,update_mask\x82\xd3\xe4\x93\x02\x44\x32\x36/v1/{ekm_config.name=projects/*/locations/*/ekmConfig}:\nekm_config\x12\xcb\x01\n\x12VerifyConnectivity\x12..google.cloud.kms.v1.VerifyConnectivityRequest\x1a/.google.cloud.kms.v1.VerifyConnectivityResponse\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1/{name=projects/*/locations/*/ekmConnections/*}:verifyConnectivity\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsB\x82\x02\n\x17\x63om.google.cloud.kms.v1B\x0f\x45kmServiceProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Kms - module V1 - ListEkmConnectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListEkmConnectionsRequest").msgclass - ListEkmConnectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListEkmConnectionsResponse").msgclass - GetEkmConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetEkmConnectionRequest").msgclass - CreateEkmConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateEkmConnectionRequest").msgclass - UpdateEkmConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateEkmConnectionRequest").msgclass - GetEkmConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetEkmConfigRequest").msgclass - UpdateEkmConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateEkmConfigRequest").msgclass - Certificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.Certificate").msgclass - EkmConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EkmConnection").msgclass - EkmConnection::ServiceResolver = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EkmConnection.ServiceResolver").msgclass - EkmConnection::KeyManagementMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EkmConnection.KeyManagementMode").enummodule - EkmConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EkmConfig").msgclass - VerifyConnectivityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.VerifyConnectivityRequest").msgclass - VerifyConnectivityResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.VerifyConnectivityResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_services_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_services_pb.rb deleted file mode 100644 index cdb76dbd1f63..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service_services_pb.rb +++ /dev/null @@ -1,69 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/kms/v1/ekm_service.proto for package 'google.cloud.kms.v1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/kms/v1/ekm_service_pb' - -module Google - module Cloud - module Kms - module V1 - module EkmService - # Google Cloud Key Management EKM Service - # - # Manages external cryptographic keys and operations using those keys. - # Implements a REST model with the following objects: - # * [EkmConnection][google.cloud.kms.v1.EkmConnection] - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.kms.v1.EkmService' - - # Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. - rpc :ListEkmConnections, ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest, ::Google::Cloud::Kms::V1::ListEkmConnectionsResponse - # Returns metadata for a given - # [EkmConnection][google.cloud.kms.v1.EkmConnection]. - rpc :GetEkmConnection, ::Google::Cloud::Kms::V1::GetEkmConnectionRequest, ::Google::Cloud::Kms::V1::EkmConnection - # Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given - # Project and Location. - rpc :CreateEkmConnection, ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest, ::Google::Cloud::Kms::V1::EkmConnection - # Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata. - rpc :UpdateEkmConnection, ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest, ::Google::Cloud::Kms::V1::EkmConnection - # Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource - # for a given project and location. - rpc :GetEkmConfig, ::Google::Cloud::Kms::V1::GetEkmConfigRequest, ::Google::Cloud::Kms::V1::EkmConfig - # Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource - # for a given project and location. - rpc :UpdateEkmConfig, ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest, ::Google::Cloud::Kms::V1::EkmConfig - # 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. - rpc :VerifyConnectivity, ::Google::Cloud::Kms::V1::VerifyConnectivityRequest, ::Google::Cloud::Kms::V1::VerifyConnectivityResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management.rb deleted file mode 100644 index 8b25b31605e1..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/kms/v1/version" - -require "google/cloud/kms/v1/hsm_management/credentials" -require "google/cloud/kms/v1/hsm_management/paths" -require "google/cloud/kms/v1/hsm_management/operations" -require "google/cloud/kms/v1/hsm_management/client" -require "google/cloud/kms/v1/hsm_management/rest" - -module Google - module Cloud - module Kms - module V1 - ## - # Google Cloud HSM Management Service - # - # Provides interfaces for managing HSM instances. - # - # Implements a REST model with the following objects: - # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/kms/v1/hsm_management" - # client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/kms/v1/hsm_management/rest" - # client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - module HsmManagement - end - end - end - end -end - -helper_path = ::File.join __dir__, "hsm_management", "helpers.rb" -require "google/cloud/kms/v1/hsm_management/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/client.rb deleted file mode 100644 index f5e81374e6e4..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/client.rb +++ /dev/null @@ -1,1477 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/kms/v1/hsm_management_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module Kms - module V1 - module HsmManagement - ## - # Client for the HsmManagement service. - # - # Google Cloud HSM Management Service - # - # Provides interfaces for managing HSM instances. - # - # Implements a REST model with the following objects: - # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :hsm_management_stub - - ## - # Configure the HsmManagement Client class. - # - # See {::Google::Cloud::Kms::V1::HsmManagement::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all HsmManagement clients - # ::Google::Cloud::Kms::V1::HsmManagement::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Kms", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_single_tenant_hsm_instances.timeout = 60.0 - default_config.rpcs.list_single_tenant_hsm_instances.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_single_tenant_hsm_instance.timeout = 60.0 - default_config.rpcs.get_single_tenant_hsm_instance.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_single_tenant_hsm_instance.timeout = 60.0 - default_config.rpcs.create_single_tenant_hsm_instance.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_single_tenant_hsm_instance_proposal.timeout = 60.0 - default_config.rpcs.create_single_tenant_hsm_instance_proposal.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.approve_single_tenant_hsm_instance_proposal.timeout = 60.0 - default_config.rpcs.approve_single_tenant_hsm_instance_proposal.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.execute_single_tenant_hsm_instance_proposal.timeout = 60.0 - default_config.rpcs.execute_single_tenant_hsm_instance_proposal.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_single_tenant_hsm_instance_proposal.timeout = 60.0 - default_config.rpcs.get_single_tenant_hsm_instance_proposal.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_single_tenant_hsm_instance_proposals.timeout = 60.0 - default_config.rpcs.list_single_tenant_hsm_instance_proposals.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_single_tenant_hsm_instance_proposal.timeout = 60.0 - default_config.rpcs.delete_single_tenant_hsm_instance_proposal.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the HsmManagement Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Kms::V1::HsmManagement::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @hsm_management_stub.universe_domain - end - - ## - # Create a new HsmManagement client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the HsmManagement client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/kms/v1/hsm_management_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @hsm_management_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Kms::V1::HsmManagement::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @hsm_management_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @hsm_management_stub.endpoint - config.universe_domain = @hsm_management_stub.universe_domain - config.logger = @hsm_management_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @hsm_management_stub.endpoint - config.universe_domain = @hsm_management_stub.universe_domain - config.logger = @hsm_management_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Kms::V1::HsmManagement::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @hsm_management_stub.logger - end - - # Service calls - - ## - # Lists - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances}. - # - # @overload list_single_tenant_hsm_instances(request, options = nil) - # Pass arguments to `list_single_tenant_hsm_instances` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_single_tenant_hsm_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) - # Pass arguments to `list_single_tenant_hsm_instances` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to - # list, in the format `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to - # include in the response. Further - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} can - # subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token}. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # @param show_deleted [::Boolean] - # Optional. If set to true, - # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances HsmManagement.ListSingleTenantHsmInstances} - # will also return - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} in - # DELETED state. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new - # - # # Call the list_single_tenant_hsm_instances method. - # result = client.list_single_tenant_hsm_instances request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstance. - # p item - # end - # - def list_single_tenant_hsm_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_single_tenant_hsm_instances.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_single_tenant_hsm_instances.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_single_tenant_hsm_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.call_rpc :list_single_tenant_hsm_instances, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @hsm_management_stub, :list_single_tenant_hsm_instances, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # - # @overload get_single_tenant_hsm_instance(request, options = nil) - # Pass arguments to `get_single_tenant_hsm_instance` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_single_tenant_hsm_instance(name: nil) - # Pass arguments to `get_single_tenant_hsm_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of - # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new - # - # # Call the get_single_tenant_hsm_instance method. - # result = client.get_single_tenant_hsm_instance request - # - # # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstance. - # p result - # - def get_single_tenant_hsm_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_single_tenant_hsm_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_single_tenant_hsm_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_single_tenant_hsm_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.call_rpc :get_single_tenant_hsm_instance, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} in a - # given Project and Location. User must create a RegisterTwoFactorAuthKeys - # proposal with this single-tenant HSM instance to finish setup of the - # instance. - # - # @overload create_single_tenant_hsm_instance(request, options = nil) - # Pass arguments to `create_single_tenant_hsm_instance` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_single_tenant_hsm_instance(parent: nil, single_tenant_hsm_instance_id: nil, single_tenant_hsm_instance: nil) - # Pass arguments to `create_single_tenant_hsm_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}, in - # the format `projects/*/locations/*`. - # @param single_tenant_hsm_instance_id [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. - # @param single_tenant_hsm_instance [::Google::Cloud::Kms::V1::SingleTenantHsmInstance, ::Hash] - # Required. An - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} with - # initial field values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new - # - # # Call the create_single_tenant_hsm_instance method. - # result = client.create_single_tenant_hsm_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_single_tenant_hsm_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_single_tenant_hsm_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_single_tenant_hsm_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_single_tenant_hsm_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.call_rpc :create_single_tenant_hsm_instance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # for a given - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # - # @overload create_single_tenant_hsm_instance_proposal(request, options = nil) - # Pass arguments to `create_single_tenant_hsm_instance_proposal` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_single_tenant_hsm_instance_proposal(parent: nil, single_tenant_hsm_instance_proposal_id: nil, single_tenant_hsm_instance_proposal: nil) - # Pass arguments to `create_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of - # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # associated with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. - # @param single_tenant_hsm_instance_proposal_id [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. - # @param single_tenant_hsm_instance_proposal [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal, ::Hash] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new - # - # # Call the create_single_tenant_hsm_instance_proposal method. - # result = client.create_single_tenant_hsm_instance_proposal request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_single_tenant_hsm_instance_proposal request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_single_tenant_hsm_instance_proposal.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_single_tenant_hsm_instance_proposal.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_single_tenant_hsm_instance_proposal.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.call_rpc :create_single_tenant_hsm_instance_proposal, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Approves a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # for a given - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The - # proposal must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::State::PENDING PENDING} - # state. - # - # @overload approve_single_tenant_hsm_instance_proposal(request, options = nil) - # Pass arguments to `approve_single_tenant_hsm_instance_proposal` via a request object, either of type - # {::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload approve_single_tenant_hsm_instance_proposal(name: nil, quorum_reply: nil, required_action_quorum_reply: nil) - # Pass arguments to `approve_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to approve. - # @param quorum_reply [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::QuorumReply, ::Hash] - # Required. The reply to - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters QuorumParameters} - # for approving the proposal. - # - # Note: The following parameters are mutually exclusive: `quorum_reply`, `required_action_quorum_reply`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param required_action_quorum_reply [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::RequiredActionQuorumReply, ::Hash] - # Required. The reply to - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters RequiredActionQuorumParameters} - # for approving the proposal. - # - # Note: The following parameters are mutually exclusive: `required_action_quorum_reply`, `quorum_reply`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new - # - # # Call the approve_single_tenant_hsm_instance_proposal method. - # result = client.approve_single_tenant_hsm_instance_proposal request - # - # # The returned object is of type Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse. - # p result - # - def approve_single_tenant_hsm_instance_proposal request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.approve_single_tenant_hsm_instance_proposal.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.approve_single_tenant_hsm_instance_proposal.timeout, - metadata: metadata, - retry_policy: @config.rpcs.approve_single_tenant_hsm_instance_proposal.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.call_rpc :approve_single_tenant_hsm_instance_proposal, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Executes a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # for a given - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The - # proposal must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::State::APPROVED APPROVED} - # state. - # - # @overload execute_single_tenant_hsm_instance_proposal(request, options = nil) - # Pass arguments to `execute_single_tenant_hsm_instance_proposal` via a request object, either of type - # {::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload execute_single_tenant_hsm_instance_proposal(name: nil) - # Pass arguments to `execute_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to execute. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new - # - # # Call the execute_single_tenant_hsm_instance_proposal method. - # result = client.execute_single_tenant_hsm_instance_proposal request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def execute_single_tenant_hsm_instance_proposal request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.execute_single_tenant_hsm_instance_proposal.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.execute_single_tenant_hsm_instance_proposal.timeout, - metadata: metadata, - retry_policy: @config.rpcs.execute_single_tenant_hsm_instance_proposal.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.call_rpc :execute_single_tenant_hsm_instance_proposal, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. - # - # @overload get_single_tenant_hsm_instance_proposal(request, options = nil) - # Pass arguments to `get_single_tenant_hsm_instance_proposal` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_single_tenant_hsm_instance_proposal(name: nil) - # Pass arguments to `get_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new - # - # # Call the get_single_tenant_hsm_instance_proposal method. - # result = client.get_single_tenant_hsm_instance_proposal request - # - # # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. - # p result - # - def get_single_tenant_hsm_instance_proposal request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_single_tenant_hsm_instance_proposal.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_single_tenant_hsm_instance_proposal.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_single_tenant_hsm_instance_proposal.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.call_rpc :get_single_tenant_hsm_instance_proposal, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. - # - # @overload list_single_tenant_hsm_instance_proposals(request, options = nil) - # Pass arguments to `list_single_tenant_hsm_instance_proposals` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_single_tenant_hsm_instance_proposals(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) - # Pass arguments to `list_single_tenant_hsm_instance_proposals` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the single tenant HSM instance associated - # with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # to list, in the format `projects/*/locations/*/singleTenantHsmInstances/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # to include in the response. Further - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # can subsequently be obtained by including the - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token}. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # @param show_deleted [::Boolean] - # Optional. If set to true, - # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals HsmManagement.ListSingleTenantHsmInstanceProposals} - # will also return - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # in DELETED state. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new - # - # # Call the list_single_tenant_hsm_instance_proposals method. - # result = client.list_single_tenant_hsm_instance_proposals request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. - # p item - # end - # - def list_single_tenant_hsm_instance_proposals request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_single_tenant_hsm_instance_proposals.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_single_tenant_hsm_instance_proposals.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_single_tenant_hsm_instance_proposals.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.call_rpc :list_single_tenant_hsm_instance_proposals, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @hsm_management_stub, :list_single_tenant_hsm_instance_proposals, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. - # - # @overload delete_single_tenant_hsm_instance_proposal(request, options = nil) - # Pass arguments to `delete_single_tenant_hsm_instance_proposal` via a request object, either of type - # {::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_single_tenant_hsm_instance_proposal(name: nil) - # Pass arguments to `delete_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new - # - # # Call the delete_single_tenant_hsm_instance_proposal method. - # result = client.delete_single_tenant_hsm_instance_proposal request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_single_tenant_hsm_instance_proposal request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_single_tenant_hsm_instance_proposal.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_single_tenant_hsm_instance_proposal.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_single_tenant_hsm_instance_proposal.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.call_rpc :delete_single_tenant_hsm_instance_proposal, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the HsmManagement API. - # - # This class represents the configuration for HsmManagement, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Kms::V1::HsmManagement::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_single_tenant_hsm_instances to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Kms::V1::HsmManagement::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_single_tenant_hsm_instances.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_single_tenant_hsm_instances.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the HsmManagement API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_single_tenant_hsm_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_single_tenant_hsm_instances - ## - # RPC-specific configuration for `get_single_tenant_hsm_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_single_tenant_hsm_instance - ## - # RPC-specific configuration for `create_single_tenant_hsm_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_single_tenant_hsm_instance - ## - # RPC-specific configuration for `create_single_tenant_hsm_instance_proposal` - # @return [::Gapic::Config::Method] - # - attr_reader :create_single_tenant_hsm_instance_proposal - ## - # RPC-specific configuration for `approve_single_tenant_hsm_instance_proposal` - # @return [::Gapic::Config::Method] - # - attr_reader :approve_single_tenant_hsm_instance_proposal - ## - # RPC-specific configuration for `execute_single_tenant_hsm_instance_proposal` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_single_tenant_hsm_instance_proposal - ## - # RPC-specific configuration for `get_single_tenant_hsm_instance_proposal` - # @return [::Gapic::Config::Method] - # - attr_reader :get_single_tenant_hsm_instance_proposal - ## - # RPC-specific configuration for `list_single_tenant_hsm_instance_proposals` - # @return [::Gapic::Config::Method] - # - attr_reader :list_single_tenant_hsm_instance_proposals - ## - # RPC-specific configuration for `delete_single_tenant_hsm_instance_proposal` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_single_tenant_hsm_instance_proposal - - # @private - def initialize parent_rpcs = nil - list_single_tenant_hsm_instances_config = parent_rpcs.list_single_tenant_hsm_instances if parent_rpcs.respond_to? :list_single_tenant_hsm_instances - @list_single_tenant_hsm_instances = ::Gapic::Config::Method.new list_single_tenant_hsm_instances_config - get_single_tenant_hsm_instance_config = parent_rpcs.get_single_tenant_hsm_instance if parent_rpcs.respond_to? :get_single_tenant_hsm_instance - @get_single_tenant_hsm_instance = ::Gapic::Config::Method.new get_single_tenant_hsm_instance_config - create_single_tenant_hsm_instance_config = parent_rpcs.create_single_tenant_hsm_instance if parent_rpcs.respond_to? :create_single_tenant_hsm_instance - @create_single_tenant_hsm_instance = ::Gapic::Config::Method.new create_single_tenant_hsm_instance_config - create_single_tenant_hsm_instance_proposal_config = parent_rpcs.create_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :create_single_tenant_hsm_instance_proposal - @create_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new create_single_tenant_hsm_instance_proposal_config - approve_single_tenant_hsm_instance_proposal_config = parent_rpcs.approve_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :approve_single_tenant_hsm_instance_proposal - @approve_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new approve_single_tenant_hsm_instance_proposal_config - execute_single_tenant_hsm_instance_proposal_config = parent_rpcs.execute_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :execute_single_tenant_hsm_instance_proposal - @execute_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new execute_single_tenant_hsm_instance_proposal_config - get_single_tenant_hsm_instance_proposal_config = parent_rpcs.get_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :get_single_tenant_hsm_instance_proposal - @get_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new get_single_tenant_hsm_instance_proposal_config - list_single_tenant_hsm_instance_proposals_config = parent_rpcs.list_single_tenant_hsm_instance_proposals if parent_rpcs.respond_to? :list_single_tenant_hsm_instance_proposals - @list_single_tenant_hsm_instance_proposals = ::Gapic::Config::Method.new list_single_tenant_hsm_instance_proposals_config - delete_single_tenant_hsm_instance_proposal_config = parent_rpcs.delete_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :delete_single_tenant_hsm_instance_proposal - @delete_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new delete_single_tenant_hsm_instance_proposal_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/credentials.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/credentials.rb deleted file mode 100644 index e3f5b6f3339a..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Kms - module V1 - module HsmManagement - # Credentials for the HsmManagement API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudkms" - ] - self.env_vars = [ - "KMS_CREDENTIALS", - "KMS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "KMS_CREDENTIALS_JSON", - "KMS_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/operations.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/operations.rb deleted file mode 100644 index 09268949700c..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Kms - module V1 - module HsmManagement - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the HsmManagement Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the HsmManagement Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/paths.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/paths.rb deleted file mode 100644 index efa4231cc1e2..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/paths.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - module HsmManagement - # Path helper methods for the HsmManagement API. - module Paths - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified SingleTenantHsmInstance resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/singleTenantHsmInstances/{single_tenant_hsm_instance}` - # - # @param project [String] - # @param location [String] - # @param single_tenant_hsm_instance [String] - # - # @return [::String] - def single_tenant_hsm_instance_path project:, location:, single_tenant_hsm_instance: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/singleTenantHsmInstances/#{single_tenant_hsm_instance}" - end - - ## - # Create a fully-qualified SingleTenantHsmInstanceProposal resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/singleTenantHsmInstances/{single_tenant_hsm_instance}/proposals/{proposal}` - # - # @param project [String] - # @param location [String] - # @param single_tenant_hsm_instance [String] - # @param proposal [String] - # - # @return [::String] - def single_tenant_hsm_instance_proposal_path project:, location:, single_tenant_hsm_instance:, proposal: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "single_tenant_hsm_instance cannot contain /" if single_tenant_hsm_instance.to_s.include? "/" - - "projects/#{project}/locations/#{location}/singleTenantHsmInstances/#{single_tenant_hsm_instance}/proposals/#{proposal}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest.rb deleted file mode 100644 index a12ced4da408..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/kms/v1/version" -require "google/cloud/kms/v1/bindings_override" - -require "google/cloud/kms/v1/hsm_management/credentials" -require "google/cloud/kms/v1/hsm_management/paths" -require "google/cloud/kms/v1/hsm_management/rest/operations" -require "google/cloud/kms/v1/hsm_management/rest/client" - -module Google - module Cloud - module Kms - module V1 - ## - # Google Cloud HSM Management Service - # - # Provides interfaces for managing HSM instances. - # - # Implements a REST model with the following objects: - # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/kms/v1/hsm_management/rest" - # client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - module HsmManagement - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/kms/v1/hsm_management/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/client.rb deleted file mode 100644 index be33b81210c6..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/client.rb +++ /dev/null @@ -1,1380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/kms/v1/hsm_management_pb" -require "google/cloud/kms/v1/hsm_management/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module Kms - module V1 - module HsmManagement - module Rest - ## - # REST client for the HsmManagement service. - # - # Google Cloud HSM Management Service - # - # Provides interfaces for managing HSM instances. - # - # Implements a REST model with the following objects: - # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # * {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :hsm_management_stub - - ## - # Configure the HsmManagement Client class. - # - # See {::Google::Cloud::Kms::V1::HsmManagement::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all HsmManagement clients - # ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Kms", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_single_tenant_hsm_instances.timeout = 60.0 - default_config.rpcs.list_single_tenant_hsm_instances.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_single_tenant_hsm_instance.timeout = 60.0 - default_config.rpcs.get_single_tenant_hsm_instance.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_single_tenant_hsm_instance.timeout = 60.0 - default_config.rpcs.create_single_tenant_hsm_instance.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_single_tenant_hsm_instance_proposal.timeout = 60.0 - default_config.rpcs.create_single_tenant_hsm_instance_proposal.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.approve_single_tenant_hsm_instance_proposal.timeout = 60.0 - default_config.rpcs.approve_single_tenant_hsm_instance_proposal.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.execute_single_tenant_hsm_instance_proposal.timeout = 60.0 - default_config.rpcs.execute_single_tenant_hsm_instance_proposal.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_single_tenant_hsm_instance_proposal.timeout = 60.0 - default_config.rpcs.get_single_tenant_hsm_instance_proposal.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_single_tenant_hsm_instance_proposals.timeout = 60.0 - default_config.rpcs.list_single_tenant_hsm_instance_proposals.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_single_tenant_hsm_instance_proposal.timeout = 60.0 - default_config.rpcs.delete_single_tenant_hsm_instance_proposal.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the HsmManagement Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Kms::V1::HsmManagement::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @hsm_management_stub.universe_domain - end - - ## - # Create a new HsmManagement REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the HsmManagement client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @hsm_management_stub = ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @hsm_management_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @hsm_management_stub.endpoint - config.universe_domain = @hsm_management_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @hsm_management_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @hsm_management_stub.endpoint - config.universe_domain = @hsm_management_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @hsm_management_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Kms::V1::HsmManagement::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @hsm_management_stub.logger - end - - # Service calls - - ## - # Lists - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances}. - # - # @overload list_single_tenant_hsm_instances(request, options = nil) - # Pass arguments to `list_single_tenant_hsm_instances` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_single_tenant_hsm_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) - # Pass arguments to `list_single_tenant_hsm_instances` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to - # list, in the format `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to - # include in the response. Further - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} can - # subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token}. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # @param show_deleted [::Boolean] - # Optional. If set to true, - # {::Google::Cloud::Kms::V1::HsmManagement::Rest::Client#list_single_tenant_hsm_instances HsmManagement.ListSingleTenantHsmInstances} - # will also return - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} in - # DELETED state. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new - # - # # Call the list_single_tenant_hsm_instances method. - # result = client.list_single_tenant_hsm_instances request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstance. - # p item - # end - # - def list_single_tenant_hsm_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_single_tenant_hsm_instances.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_single_tenant_hsm_instances.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_single_tenant_hsm_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.list_single_tenant_hsm_instances request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @hsm_management_stub, :list_single_tenant_hsm_instances, "single_tenant_hsm_instances", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # - # @overload get_single_tenant_hsm_instance(request, options = nil) - # Pass arguments to `get_single_tenant_hsm_instance` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_single_tenant_hsm_instance(name: nil) - # Pass arguments to `get_single_tenant_hsm_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of - # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new - # - # # Call the get_single_tenant_hsm_instance method. - # result = client.get_single_tenant_hsm_instance request - # - # # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstance. - # p result - # - def get_single_tenant_hsm_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_single_tenant_hsm_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_single_tenant_hsm_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_single_tenant_hsm_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.get_single_tenant_hsm_instance request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} in a - # given Project and Location. User must create a RegisterTwoFactorAuthKeys - # proposal with this single-tenant HSM instance to finish setup of the - # instance. - # - # @overload create_single_tenant_hsm_instance(request, options = nil) - # Pass arguments to `create_single_tenant_hsm_instance` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_single_tenant_hsm_instance(parent: nil, single_tenant_hsm_instance_id: nil, single_tenant_hsm_instance: nil) - # Pass arguments to `create_single_tenant_hsm_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}, in - # the format `projects/*/locations/*`. - # @param single_tenant_hsm_instance_id [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. - # @param single_tenant_hsm_instance [::Google::Cloud::Kms::V1::SingleTenantHsmInstance, ::Hash] - # Required. An - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} with - # initial field values. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new - # - # # Call the create_single_tenant_hsm_instance method. - # result = client.create_single_tenant_hsm_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_single_tenant_hsm_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_single_tenant_hsm_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_single_tenant_hsm_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_single_tenant_hsm_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.create_single_tenant_hsm_instance request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # for a given - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # - # @overload create_single_tenant_hsm_instance_proposal(request, options = nil) - # Pass arguments to `create_single_tenant_hsm_instance_proposal` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_single_tenant_hsm_instance_proposal(parent: nil, single_tenant_hsm_instance_proposal_id: nil, single_tenant_hsm_instance_proposal: nil) - # Pass arguments to `create_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of - # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # associated with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. - # @param single_tenant_hsm_instance_proposal_id [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. - # @param single_tenant_hsm_instance_proposal [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal, ::Hash] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new - # - # # Call the create_single_tenant_hsm_instance_proposal method. - # result = client.create_single_tenant_hsm_instance_proposal request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_single_tenant_hsm_instance_proposal request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_single_tenant_hsm_instance_proposal.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_single_tenant_hsm_instance_proposal.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_single_tenant_hsm_instance_proposal.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.create_single_tenant_hsm_instance_proposal request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Approves a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # for a given - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The - # proposal must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::State::PENDING PENDING} - # state. - # - # @overload approve_single_tenant_hsm_instance_proposal(request, options = nil) - # Pass arguments to `approve_single_tenant_hsm_instance_proposal` via a request object, either of type - # {::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload approve_single_tenant_hsm_instance_proposal(name: nil, quorum_reply: nil, required_action_quorum_reply: nil) - # Pass arguments to `approve_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to approve. - # @param quorum_reply [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::QuorumReply, ::Hash] - # Required. The reply to - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters QuorumParameters} - # for approving the proposal. - # - # Note: The following parameters are mutually exclusive: `quorum_reply`, `required_action_quorum_reply`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param required_action_quorum_reply [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::RequiredActionQuorumReply, ::Hash] - # Required. The reply to - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters RequiredActionQuorumParameters} - # for approving the proposal. - # - # Note: The following parameters are mutually exclusive: `required_action_quorum_reply`, `quorum_reply`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new - # - # # Call the approve_single_tenant_hsm_instance_proposal method. - # result = client.approve_single_tenant_hsm_instance_proposal request - # - # # The returned object is of type Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse. - # p result - # - def approve_single_tenant_hsm_instance_proposal request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.approve_single_tenant_hsm_instance_proposal.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.approve_single_tenant_hsm_instance_proposal.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.approve_single_tenant_hsm_instance_proposal.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.approve_single_tenant_hsm_instance_proposal request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Executes a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # for a given - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The - # proposal must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::State::APPROVED APPROVED} - # state. - # - # @overload execute_single_tenant_hsm_instance_proposal(request, options = nil) - # Pass arguments to `execute_single_tenant_hsm_instance_proposal` via a request object, either of type - # {::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload execute_single_tenant_hsm_instance_proposal(name: nil) - # Pass arguments to `execute_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to execute. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new - # - # # Call the execute_single_tenant_hsm_instance_proposal method. - # result = client.execute_single_tenant_hsm_instance_proposal request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def execute_single_tenant_hsm_instance_proposal request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.execute_single_tenant_hsm_instance_proposal.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.execute_single_tenant_hsm_instance_proposal.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.execute_single_tenant_hsm_instance_proposal.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.execute_single_tenant_hsm_instance_proposal request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. - # - # @overload get_single_tenant_hsm_instance_proposal(request, options = nil) - # Pass arguments to `get_single_tenant_hsm_instance_proposal` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_single_tenant_hsm_instance_proposal(name: nil) - # Pass arguments to `get_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new - # - # # Call the get_single_tenant_hsm_instance_proposal method. - # result = client.get_single_tenant_hsm_instance_proposal request - # - # # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. - # p result - # - def get_single_tenant_hsm_instance_proposal request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_single_tenant_hsm_instance_proposal.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_single_tenant_hsm_instance_proposal.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_single_tenant_hsm_instance_proposal.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.get_single_tenant_hsm_instance_proposal request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. - # - # @overload list_single_tenant_hsm_instance_proposals(request, options = nil) - # Pass arguments to `list_single_tenant_hsm_instance_proposals` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_single_tenant_hsm_instance_proposals(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) - # Pass arguments to `list_single_tenant_hsm_instance_proposals` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the single tenant HSM instance associated - # with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # to list, in the format `projects/*/locations/*/singleTenantHsmInstances/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # to include in the response. Further - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # can subsequently be obtained by including the - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token}. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # @param show_deleted [::Boolean] - # Optional. If set to true, - # {::Google::Cloud::Kms::V1::HsmManagement::Rest::Client#list_single_tenant_hsm_instance_proposals HsmManagement.ListSingleTenantHsmInstanceProposals} - # will also return - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # in DELETED state. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new - # - # # Call the list_single_tenant_hsm_instance_proposals method. - # result = client.list_single_tenant_hsm_instance_proposals request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. - # p item - # end - # - def list_single_tenant_hsm_instance_proposals request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_single_tenant_hsm_instance_proposals.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_single_tenant_hsm_instance_proposals.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_single_tenant_hsm_instance_proposals.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.list_single_tenant_hsm_instance_proposals request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @hsm_management_stub, :list_single_tenant_hsm_instance_proposals, "single_tenant_hsm_instance_proposals", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. - # - # @overload delete_single_tenant_hsm_instance_proposal(request, options = nil) - # Pass arguments to `delete_single_tenant_hsm_instance_proposal` via a request object, either of type - # {::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_single_tenant_hsm_instance_proposal(name: nil) - # Pass arguments to `delete_single_tenant_hsm_instance_proposal` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new - # - # # Call the delete_single_tenant_hsm_instance_proposal method. - # result = client.delete_single_tenant_hsm_instance_proposal request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_single_tenant_hsm_instance_proposal request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_single_tenant_hsm_instance_proposal.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_single_tenant_hsm_instance_proposal.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_single_tenant_hsm_instance_proposal.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @hsm_management_stub.delete_single_tenant_hsm_instance_proposal request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the HsmManagement REST API. - # - # This class represents the configuration for HsmManagement REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Kms::V1::HsmManagement::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_single_tenant_hsm_instances to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_single_tenant_hsm_instances.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_single_tenant_hsm_instances.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the HsmManagement API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_single_tenant_hsm_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_single_tenant_hsm_instances - ## - # RPC-specific configuration for `get_single_tenant_hsm_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_single_tenant_hsm_instance - ## - # RPC-specific configuration for `create_single_tenant_hsm_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_single_tenant_hsm_instance - ## - # RPC-specific configuration for `create_single_tenant_hsm_instance_proposal` - # @return [::Gapic::Config::Method] - # - attr_reader :create_single_tenant_hsm_instance_proposal - ## - # RPC-specific configuration for `approve_single_tenant_hsm_instance_proposal` - # @return [::Gapic::Config::Method] - # - attr_reader :approve_single_tenant_hsm_instance_proposal - ## - # RPC-specific configuration for `execute_single_tenant_hsm_instance_proposal` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_single_tenant_hsm_instance_proposal - ## - # RPC-specific configuration for `get_single_tenant_hsm_instance_proposal` - # @return [::Gapic::Config::Method] - # - attr_reader :get_single_tenant_hsm_instance_proposal - ## - # RPC-specific configuration for `list_single_tenant_hsm_instance_proposals` - # @return [::Gapic::Config::Method] - # - attr_reader :list_single_tenant_hsm_instance_proposals - ## - # RPC-specific configuration for `delete_single_tenant_hsm_instance_proposal` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_single_tenant_hsm_instance_proposal - - # @private - def initialize parent_rpcs = nil - list_single_tenant_hsm_instances_config = parent_rpcs.list_single_tenant_hsm_instances if parent_rpcs.respond_to? :list_single_tenant_hsm_instances - @list_single_tenant_hsm_instances = ::Gapic::Config::Method.new list_single_tenant_hsm_instances_config - get_single_tenant_hsm_instance_config = parent_rpcs.get_single_tenant_hsm_instance if parent_rpcs.respond_to? :get_single_tenant_hsm_instance - @get_single_tenant_hsm_instance = ::Gapic::Config::Method.new get_single_tenant_hsm_instance_config - create_single_tenant_hsm_instance_config = parent_rpcs.create_single_tenant_hsm_instance if parent_rpcs.respond_to? :create_single_tenant_hsm_instance - @create_single_tenant_hsm_instance = ::Gapic::Config::Method.new create_single_tenant_hsm_instance_config - create_single_tenant_hsm_instance_proposal_config = parent_rpcs.create_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :create_single_tenant_hsm_instance_proposal - @create_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new create_single_tenant_hsm_instance_proposal_config - approve_single_tenant_hsm_instance_proposal_config = parent_rpcs.approve_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :approve_single_tenant_hsm_instance_proposal - @approve_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new approve_single_tenant_hsm_instance_proposal_config - execute_single_tenant_hsm_instance_proposal_config = parent_rpcs.execute_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :execute_single_tenant_hsm_instance_proposal - @execute_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new execute_single_tenant_hsm_instance_proposal_config - get_single_tenant_hsm_instance_proposal_config = parent_rpcs.get_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :get_single_tenant_hsm_instance_proposal - @get_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new get_single_tenant_hsm_instance_proposal_config - list_single_tenant_hsm_instance_proposals_config = parent_rpcs.list_single_tenant_hsm_instance_proposals if parent_rpcs.respond_to? :list_single_tenant_hsm_instance_proposals - @list_single_tenant_hsm_instance_proposals = ::Gapic::Config::Method.new list_single_tenant_hsm_instance_proposals_config - delete_single_tenant_hsm_instance_proposal_config = parent_rpcs.delete_single_tenant_hsm_instance_proposal if parent_rpcs.respond_to? :delete_single_tenant_hsm_instance_proposal - @delete_single_tenant_hsm_instance_proposal = ::Gapic::Config::Method.new delete_single_tenant_hsm_instance_proposal_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/operations.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/operations.rb deleted file mode 100644 index 7d4e9ac3d2ea..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/operations.rb +++ /dev/null @@ -1,925 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Kms - module V1 - module HsmManagement - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the HsmManagement Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the HsmManagement Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/service_stub.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/service_stub.rb deleted file mode 100644 index 9fd2de9e936f..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management/rest/service_stub.rb +++ /dev/null @@ -1,634 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/kms/v1/hsm_management_pb" - -module Google - module Cloud - module Kms - module V1 - module HsmManagement - module Rest - ## - # REST service stub for the HsmManagement service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_single_tenant_hsm_instances REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse] - # A result object deserialized from the server's reply - def list_single_tenant_hsm_instances request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_single_tenant_hsm_instances_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_single_tenant_hsm_instances", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_single_tenant_hsm_instance REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] - # A result object deserialized from the server's reply - def get_single_tenant_hsm_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_single_tenant_hsm_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_single_tenant_hsm_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::SingleTenantHsmInstance.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_single_tenant_hsm_instance REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_single_tenant_hsm_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_single_tenant_hsm_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_single_tenant_hsm_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_single_tenant_hsm_instance_proposal REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_single_tenant_hsm_instance_proposal request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_single_tenant_hsm_instance_proposal_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_single_tenant_hsm_instance_proposal", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the approve_single_tenant_hsm_instance_proposal REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse] - # A result object deserialized from the server's reply - def approve_single_tenant_hsm_instance_proposal request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_approve_single_tenant_hsm_instance_proposal_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "approve_single_tenant_hsm_instance_proposal", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the execute_single_tenant_hsm_instance_proposal REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def execute_single_tenant_hsm_instance_proposal request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_execute_single_tenant_hsm_instance_proposal_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "execute_single_tenant_hsm_instance_proposal", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_single_tenant_hsm_instance_proposal REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] - # A result object deserialized from the server's reply - def get_single_tenant_hsm_instance_proposal request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_single_tenant_hsm_instance_proposal_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_single_tenant_hsm_instance_proposal", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_single_tenant_hsm_instance_proposals REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse] - # A result object deserialized from the server's reply - def list_single_tenant_hsm_instance_proposals request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_single_tenant_hsm_instance_proposals_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_single_tenant_hsm_instance_proposals", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_single_tenant_hsm_instance_proposal REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_single_tenant_hsm_instance_proposal request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_single_tenant_hsm_instance_proposal_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_single_tenant_hsm_instance_proposal", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_single_tenant_hsm_instances REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_single_tenant_hsm_instances_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/singleTenantHsmInstances", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_single_tenant_hsm_instance REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_single_tenant_hsm_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_single_tenant_hsm_instance REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_single_tenant_hsm_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/singleTenantHsmInstances", - body: "single_tenant_hsm_instance", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_single_tenant_hsm_instance_proposal REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_single_tenant_hsm_instance_proposal_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/proposals", - body: "single_tenant_hsm_instance_proposal", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the approve_single_tenant_hsm_instance_proposal REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_approve_single_tenant_hsm_instance_proposal_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:approve", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/proposals/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the execute_single_tenant_hsm_instance_proposal REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_execute_single_tenant_hsm_instance_proposal_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:execute", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/proposals/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_single_tenant_hsm_instance_proposal REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_single_tenant_hsm_instance_proposal_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/proposals/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_single_tenant_hsm_instance_proposals REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_single_tenant_hsm_instance_proposals_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/proposals", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_single_tenant_hsm_instance_proposal REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_single_tenant_hsm_instance_proposal_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/singleTenantHsmInstances/[^/]+/proposals/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_pb.rb deleted file mode 100644 index 887f95ec2d0e..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_pb.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/kms/v1/hsm_management.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n(google/cloud/kms/v1/hsm_management.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa9\x07\n\x17SingleTenantHsmInstance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x05state\x18\x03 \x01(\x0e\x32\x32.google.cloud.kms.v1.SingleTenantHsmInstance.StateB\x03\xe0\x41\x03\x12Q\n\x0bquorum_auth\x18\x04 \x01(\x0b\x32\x37.google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuthB\x03\xe0\x41\x02\x12\x34\n\x0b\x64\x65lete_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12J\n\"unrefreshed_duration_until_disable\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12\x35\n\x0c\x64isable_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a~\n\nQuorumAuth\x12!\n\x14total_approver_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12$\n\x17required_approver_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\'\n\x1atwo_factor_public_key_pems\x18\x03 \x03(\tB\x03\xe0\x41\x03\"\xa6\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12(\n$PENDING_TWO_FACTOR_AUTH_REGISTRATION\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03\x12\r\n\tDISABLING\x10\x04\x12\x0c\n\x08\x44ISABLED\x10\x05\x12\x0c\n\x08\x44\x45LETING\x10\x06\x12\x0b\n\x07\x44\x45LETED\x10\x07\x12\n\n\x06\x46\x41ILED\x10\x08:\xc7\x01\xea\x41\xc3\x01\n/cloudkms.googleapis.com/SingleTenantHsmInstance\x12]projects/{project}/locations/{location}/singleTenantHsmInstances/{single_tenant_hsm_instance}*\x18singleTenantHsmInstances2\x17singleTenantHsmInstance\"\x99\x15\n\x1fSingleTenantHsmInstanceProposal\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x05state\x18\x03 \x01(\x0e\x32:.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.StateB\x03\xe0\x41\x03\x12\x1b\n\x0e\x66\x61ilure_reason\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12g\n\x11quorum_parameters\x18\x05 \x01(\x0b\x32\x45.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.QuorumParametersB\x03\xe0\x41\x03H\x00\x12\x85\x01\n!required_action_quorum_parameters\x18\x0e \x01(\x0b\x32S.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParametersB\x03\xe0\x41\x03H\x00\x12\x31\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12-\n\x03ttl\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x01\x12\x34\n\x0b\x64\x65lete_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\npurge_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12w\n\x1dregister_two_factor_auth_keys\x18\x08 \x01(\x0b\x32N.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RegisterTwoFactorAuthKeysH\x02\x12\x81\x01\n\"disable_single_tenant_hsm_instance\x18\t \x01(\x0b\x32S.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DisableSingleTenantHsmInstanceH\x02\x12\x7f\n!enable_single_tenant_hsm_instance\x18\n \x01(\x0b\x32R.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.EnableSingleTenantHsmInstanceH\x02\x12\x7f\n!delete_single_tenant_hsm_instance\x18\x0b \x01(\x0b\x32R.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DeleteSingleTenantHsmInstanceH\x02\x12\x61\n\x11\x61\x64\x64_quorum_member\x18\x0c \x01(\x0b\x32\x44.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.AddQuorumMemberH\x02\x12g\n\x14remove_quorum_member\x18\r \x01(\x0b\x32G.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RemoveQuorumMemberH\x02\x12\x81\x01\n\"refresh_single_tenant_hsm_instance\x18\x11 \x01(\x0b\x32S.google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RefreshSingleTenantHsmInstanceH\x02\x1a\xa3\x01\n\x10QuorumParameters\x12$\n\x17required_approver_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x37\n\nchallenges\x18\x02 \x03(\x0b\x32\x1e.google.cloud.kms.v1.ChallengeB\x03\xe0\x41\x03\x12\x30\n#approved_two_factor_public_key_pems\x18\x03 \x03(\tB\x03\xe0\x41\x03\x1a\xfa\x01\n\x1eRequiredActionQuorumParameters\x12@\n\x13required_challenges\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.ChallengeB\x03\xe0\x41\x03\x12$\n\x17required_approver_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12>\n\x11quorum_challenges\x18\x03 \x03(\x0b\x32\x1e.google.cloud.kms.v1.ChallengeB\x03\xe0\x41\x03\x12\x30\n#approved_two_factor_public_key_pems\x18\x04 \x03(\tB\x03\xe0\x41\x03\x1aj\n\x19RegisterTwoFactorAuthKeys\x12$\n\x17required_approver_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\'\n\x1atwo_factor_public_key_pems\x18\x02 \x03(\tB\x03\xe0\x41\x02\x1a \n\x1e\x44isableSingleTenantHsmInstance\x1a\x1f\n\x1d\x45nableSingleTenantHsmInstance\x1a\x1f\n\x1d\x44\x65leteSingleTenantHsmInstance\x1a\x39\n\x0f\x41\x64\x64QuorumMember\x12&\n\x19two_factor_public_key_pem\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a<\n\x12RemoveQuorumMember\x12&\n\x19two_factor_public_key_pem\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a \n\x1eRefreshSingleTenantHsmInstance\"|\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\x0c\n\x08\x41PPROVED\x10\x03\x12\x0b\n\x07RUNNING\x10\x04\x12\r\n\tSUCCEEDED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x0b\n\x07\x44\x45LETED\x10\x07:\xf4\x01\xea\x41\xf0\x01\n7cloudkms.googleapis.com/SingleTenantHsmInstanceProposal\x12rprojects/{project}/locations/{location}/singleTenantHsmInstances/{single_tenant_hsm_instance}/proposals/{proposal}* singleTenantHsmInstanceProposals2\x1fsingleTenantHsmInstanceProposalB\x15\n\x13\x61pproval_parametersB\x0c\n\nexpirationB\x0b\n\toperation\"@\n\tChallenge\x12\x16\n\tchallenge\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x03\x12\x1b\n\x0epublic_key_pem\x18\x02 \x01(\tB\x03\xe0\x41\x03\"L\n\x0e\x43hallengeReply\x12\x1d\n\x10signed_challenge\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x1b\n\x0epublic_key_pem\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xd8\x01\n#ListSingleTenantHsmInstancesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cshow_deleted\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xa6\x01\n$ListSingleTenantHsmInstancesResponse\x12Q\n\x1bsingle_tenant_hsm_instances\x18\x01 \x03(\x0b\x32,.google.cloud.kms.v1.SingleTenantHsmInstance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"j\n!GetSingleTenantHsmInstanceRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/cloudkms.googleapis.com/SingleTenantHsmInstance\"\xe4\x01\n$CreateSingleTenantHsmInstanceRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12*\n\x1dsingle_tenant_hsm_instance_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12U\n\x1asingle_tenant_hsm_instance\x18\x03 \x01(\x0b\x32,.google.cloud.kms.v1.SingleTenantHsmInstanceB\x03\xe0\x41\x02\"\'\n%CreateSingleTenantHsmInstanceMetadata\"\x94\x02\n,CreateSingleTenantHsmInstanceProposalRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/cloudkms.googleapis.com/SingleTenantHsmInstance\x12\x33\n&single_tenant_hsm_instance_proposal_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x66\n#single_tenant_hsm_instance_proposal\x18\x03 \x01(\x0b\x32\x34.google.cloud.kms.v1.SingleTenantHsmInstanceProposalB\x03\xe0\x41\x02\"/\n-CreateSingleTenantHsmInstanceProposalMetadata\"z\n)GetSingleTenantHsmInstanceProposalRequest\x12M\n\x04name\x18\x01 \x01(\tB?\xe0\x41\x02\xfa\x41\x39\n7cloudkms.googleapis.com/SingleTenantHsmInstanceProposal\"\x97\x05\n-ApproveSingleTenantHsmInstanceProposalRequest\x12M\n\x04name\x18\x01 \x01(\tB?\xe0\x41\x02\xfa\x41\x39\n7cloudkms.googleapis.com/SingleTenantHsmInstanceProposal\x12k\n\x0cquorum_reply\x18\x02 \x01(\x0b\x32N.google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.QuorumReplyB\x03\xe0\x41\x02H\x00\x12\x89\x01\n\x1crequired_action_quorum_reply\x18\x03 \x01(\x0b\x32\\.google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.RequiredActionQuorumReplyB\x03\xe0\x41\x02H\x00\x1aR\n\x0bQuorumReply\x12\x43\n\x11\x63hallenge_replies\x18\x01 \x03(\x0b\x32#.google.cloud.kms.v1.ChallengeReplyB\x03\xe0\x41\x02\x1a\xb5\x01\n\x19RequiredActionQuorumReply\x12L\n\x1arequired_challenge_replies\x18\x01 \x03(\x0b\x32#.google.cloud.kms.v1.ChallengeReplyB\x03\xe0\x41\x02\x12J\n\x18quorum_challenge_replies\x18\x02 \x03(\x0b\x32#.google.cloud.kms.v1.ChallengeReplyB\x03\xe0\x41\x02\x42\x12\n\x10\x61pproval_payload\"0\n.ApproveSingleTenantHsmInstanceProposalResponse\"~\n-ExecuteSingleTenantHsmInstanceProposalRequest\x12M\n\x04name\x18\x01 \x01(\tB?\xe0\x41\x02\xfa\x41\x39\n7cloudkms.googleapis.com/SingleTenantHsmInstanceProposal\"0\n.ExecuteSingleTenantHsmInstanceProposalResponse\"0\n.ExecuteSingleTenantHsmInstanceProposalMetadata\"\xee\x01\n+ListSingleTenantHsmInstanceProposalsRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/cloudkms.googleapis.com/SingleTenantHsmInstance\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cshow_deleted\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xbf\x01\n,ListSingleTenantHsmInstanceProposalsResponse\x12\x62\n$single_tenant_hsm_instance_proposals\x18\x01 \x03(\x0b\x32\x34.google.cloud.kms.v1.SingleTenantHsmInstanceProposal\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"}\n,DeleteSingleTenantHsmInstanceProposalRequest\x12M\n\x04name\x18\x01 \x01(\tB?\xe0\x41\x02\xfa\x41\x39\n7cloudkms.googleapis.com/SingleTenantHsmInstanceProposal2\xa3\x15\n\rHsmManagement\x12\xe2\x01\n\x1cListSingleTenantHsmInstances\x12\x38.google.cloud.kms.v1.ListSingleTenantHsmInstancesRequest\x1a\x39.google.cloud.kms.v1.ListSingleTenantHsmInstancesResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12\x12.google.cloud.kms.v1.GetSingleTenantHsmInstanceProposalRequest\x1a\x34.google.cloud.kms.v1.SingleTenantHsmInstanceProposal\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J\x12H/v1/{name=projects/*/locations/*/singleTenantHsmInstances/*/proposals/*}\x12\x86\x02\n$ListSingleTenantHsmInstanceProposals\x12@.google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsRequest\x1a\x41.google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsResponse\"Y\xda\x41\x06parent\x82\xd3\xe4\x93\x02J\x12H/v1/{parent=projects/*/locations/*/singleTenantHsmInstances/*}/proposals\x12\xdb\x01\n%DeleteSingleTenantHsmInstanceProposal\x12\x41.google.cloud.kms.v1.DeleteSingleTenantHsmInstanceProposalRequest\x1a\x16.google.protobuf.Empty\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J*H/v1/{name=projects/*/locations/*/singleTenantHsmInstances/*/proposals/*}\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsB\x86\x01\n\x17\x63om.google.cloud.kms.v1B\x12HsmManagementProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Kms - module V1 - SingleTenantHsmInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstance").msgclass - SingleTenantHsmInstance::QuorumAuth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuth").msgclass - SingleTenantHsmInstance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstance.State").enummodule - SingleTenantHsmInstanceProposal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal").msgclass - SingleTenantHsmInstanceProposal::QuorumParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.QuorumParameters").msgclass - SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParameters").msgclass - SingleTenantHsmInstanceProposal::RegisterTwoFactorAuthKeys = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RegisterTwoFactorAuthKeys").msgclass - SingleTenantHsmInstanceProposal::DisableSingleTenantHsmInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DisableSingleTenantHsmInstance").msgclass - SingleTenantHsmInstanceProposal::EnableSingleTenantHsmInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.EnableSingleTenantHsmInstance").msgclass - SingleTenantHsmInstanceProposal::DeleteSingleTenantHsmInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DeleteSingleTenantHsmInstance").msgclass - SingleTenantHsmInstanceProposal::AddQuorumMember = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.AddQuorumMember").msgclass - SingleTenantHsmInstanceProposal::RemoveQuorumMember = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RemoveQuorumMember").msgclass - SingleTenantHsmInstanceProposal::RefreshSingleTenantHsmInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RefreshSingleTenantHsmInstance").msgclass - SingleTenantHsmInstanceProposal::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State").enummodule - Challenge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.Challenge").msgclass - ChallengeReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ChallengeReply").msgclass - ListSingleTenantHsmInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListSingleTenantHsmInstancesRequest").msgclass - ListSingleTenantHsmInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListSingleTenantHsmInstancesResponse").msgclass - GetSingleTenantHsmInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetSingleTenantHsmInstanceRequest").msgclass - CreateSingleTenantHsmInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateSingleTenantHsmInstanceRequest").msgclass - CreateSingleTenantHsmInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateSingleTenantHsmInstanceMetadata").msgclass - CreateSingleTenantHsmInstanceProposalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateSingleTenantHsmInstanceProposalRequest").msgclass - CreateSingleTenantHsmInstanceProposalMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateSingleTenantHsmInstanceProposalMetadata").msgclass - GetSingleTenantHsmInstanceProposalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetSingleTenantHsmInstanceProposalRequest").msgclass - ApproveSingleTenantHsmInstanceProposalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest").msgclass - ApproveSingleTenantHsmInstanceProposalRequest::QuorumReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.QuorumReply").msgclass - ApproveSingleTenantHsmInstanceProposalRequest::RequiredActionQuorumReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.RequiredActionQuorumReply").msgclass - ApproveSingleTenantHsmInstanceProposalResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalResponse").msgclass - ExecuteSingleTenantHsmInstanceProposalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalRequest").msgclass - ExecuteSingleTenantHsmInstanceProposalResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalResponse").msgclass - ExecuteSingleTenantHsmInstanceProposalMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalMetadata").msgclass - ListSingleTenantHsmInstanceProposalsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsRequest").msgclass - ListSingleTenantHsmInstanceProposalsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsResponse").msgclass - DeleteSingleTenantHsmInstanceProposalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteSingleTenantHsmInstanceProposalRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_services_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_services_pb.rb deleted file mode 100644 index 06fadfb2ece2..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/hsm_management_services_pb.rb +++ /dev/null @@ -1,91 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/kms/v1/hsm_management.proto for package 'google.cloud.kms.v1' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/kms/v1/hsm_management_pb' - -module Google - module Cloud - module Kms - module V1 - module HsmManagement - # Google Cloud HSM Management Service - # - # Provides interfaces for managing HSM instances. - # - # Implements a REST model with the following objects: - # * [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] - # * [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.kms.v1.HsmManagement' - - # Lists - # [SingleTenantHsmInstances][google.cloud.kms.v1.SingleTenantHsmInstance]. - rpc :ListSingleTenantHsmInstances, ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest, ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse - # Returns metadata for a given - # [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. - rpc :GetSingleTenantHsmInstance, ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest, ::Google::Cloud::Kms::V1::SingleTenantHsmInstance - # Creates a new - # [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] in a - # given Project and Location. User must create a RegisterTwoFactorAuthKeys - # proposal with this single-tenant HSM instance to finish setup of the - # instance. - rpc :CreateSingleTenantHsmInstance, ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest, ::Google::Longrunning::Operation - # Creates a new - # [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] - # for a given - # [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. - rpc :CreateSingleTenantHsmInstanceProposal, ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest, ::Google::Longrunning::Operation - # Approves a - # [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] - # for a given - # [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. The - # proposal must be in the - # [PENDING][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State.PENDING] - # state. - rpc :ApproveSingleTenantHsmInstanceProposal, ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest, ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse - # Executes a - # [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] - # for a given - # [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. The - # proposal must be in the - # [APPROVED][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State.APPROVED] - # state. - rpc :ExecuteSingleTenantHsmInstanceProposal, ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest, ::Google::Longrunning::Operation - # Returns metadata for a given - # [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. - rpc :GetSingleTenantHsmInstanceProposal, ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest, ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal - # Lists - # [SingleTenantHsmInstanceProposals][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. - rpc :ListSingleTenantHsmInstanceProposals, ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest, ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse - # Deletes a - # [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. - rpc :DeleteSingleTenantHsmInstanceProposal, ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb deleted file mode 100644 index 7880115892c2..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/kms/v1/version" - -require "google/cloud/kms/v1/key_management_service/credentials" -require "google/cloud/kms/v1/key_management_service/paths" -require "google/cloud/kms/v1/key_management_service/operations" -require "google/cloud/kms/v1/key_management_service/client" -require "google/cloud/kms/v1/key_management_service/rest" - -module Google - module Cloud - module Kms - module V1 - ## - # Google Cloud Key Management Service - # - # Manages cryptographic keys and operations using those keys. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::Kms::V1::KeyRing KeyRing} - # * {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} - # * {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # * {::Google::Cloud::Kms::V1::ImportJob ImportJob} - # - # If you are using manual gRPC libraries, see - # [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/kms/v1/key_management_service" - # client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/kms/v1/key_management_service/rest" - # client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - module KeyManagementService - end - end - end - end -end - -helper_path = ::File.join __dir__, "key_management_service", "helpers.rb" -require "google/cloud/kms/v1/key_management_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb deleted file mode 100644 index 261bdad1b481..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb +++ /dev/null @@ -1,4498 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/kms/v1/service_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module Kms - module V1 - module KeyManagementService - ## - # Client for the KeyManagementService service. - # - # Google Cloud Key Management Service - # - # Manages cryptographic keys and operations using those keys. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::Kms::V1::KeyRing KeyRing} - # * {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} - # * {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # * {::Google::Cloud::Kms::V1::ImportJob ImportJob} - # - # If you are using manual gRPC libraries, see - # [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :key_management_service_stub - - ## - # Configure the KeyManagementService Client class. - # - # See {::Google::Cloud::Kms::V1::KeyManagementService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all KeyManagementService clients - # ::Google::Cloud::Kms::V1::KeyManagementService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Kms", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_key_rings.timeout = 60.0 - default_config.rpcs.list_key_rings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_crypto_keys.timeout = 60.0 - default_config.rpcs.list_crypto_keys.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_crypto_key_versions.timeout = 60.0 - default_config.rpcs.list_crypto_key_versions.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_import_jobs.timeout = 60.0 - default_config.rpcs.list_import_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_retired_resources.timeout = 60.0 - default_config.rpcs.list_retired_resources.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_key_ring.timeout = 60.0 - default_config.rpcs.get_key_ring.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_crypto_key.timeout = 60.0 - default_config.rpcs.get_crypto_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_crypto_key_version.timeout = 60.0 - default_config.rpcs.get_crypto_key_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_public_key.timeout = 60.0 - default_config.rpcs.get_public_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_import_job.timeout = 60.0 - default_config.rpcs.get_import_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_retired_resource.timeout = 60.0 - default_config.rpcs.get_retired_resource.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_key_ring.timeout = 60.0 - default_config.rpcs.create_key_ring.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_crypto_key.timeout = 60.0 - default_config.rpcs.create_crypto_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_crypto_key_version.timeout = 60.0 - - default_config.rpcs.delete_crypto_key.timeout = 60.0 - default_config.rpcs.delete_crypto_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_crypto_key_version.timeout = 60.0 - default_config.rpcs.delete_crypto_key_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.import_crypto_key_version.timeout = 60.0 - - default_config.rpcs.create_import_job.timeout = 60.0 - default_config.rpcs.create_import_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_crypto_key.timeout = 60.0 - default_config.rpcs.update_crypto_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_crypto_key_version.timeout = 60.0 - default_config.rpcs.update_crypto_key_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_crypto_key_primary_version.timeout = 60.0 - default_config.rpcs.update_crypto_key_primary_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.destroy_crypto_key_version.timeout = 60.0 - default_config.rpcs.destroy_crypto_key_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.restore_crypto_key_version.timeout = 60.0 - default_config.rpcs.restore_crypto_key_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.encrypt.timeout = 60.0 - default_config.rpcs.encrypt.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.decrypt.timeout = 60.0 - default_config.rpcs.decrypt.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.asymmetric_sign.timeout = 60.0 - default_config.rpcs.asymmetric_sign.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.asymmetric_decrypt.timeout = 60.0 - default_config.rpcs.asymmetric_decrypt.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.mac_sign.timeout = 60.0 - default_config.rpcs.mac_sign.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.mac_verify.timeout = 60.0 - default_config.rpcs.mac_verify.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.generate_random_bytes.timeout = 60.0 - default_config.rpcs.generate_random_bytes.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the KeyManagementService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Kms::V1::KeyManagementService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @key_management_service_stub.universe_domain - end - - ## - # Create a new KeyManagementService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the KeyManagementService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/kms/v1/service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @key_management_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Kms::V1::KeyManagementService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @key_management_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @key_management_service_stub.endpoint - config.universe_domain = @key_management_service_stub.universe_domain - config.logger = @key_management_service_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @key_management_service_stub.endpoint - config.universe_domain = @key_management_service_stub.universe_domain - config.logger = @key_management_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Kms::V1::KeyManagementService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @key_management_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::Kms::V1::KeyRing KeyRings}. - # - # @overload list_key_rings(request, options = nil) - # Pass arguments to `list_key_rings` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListKeyRingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListKeyRingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_key_rings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_key_rings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::KeyRing KeyRings} to include in the response. Further - # {::Google::Cloud::Kms::V1::KeyRing KeyRings} can subsequently be obtained by - # including the - # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token}. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListKeyRingsRequest.new - # - # # Call the list_key_rings method. - # result = client.list_key_rings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::KeyRing. - # p item - # end - # - def list_key_rings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListKeyRingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_key_rings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_key_rings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_key_rings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :list_key_rings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @key_management_service_stub, :list_key_rings, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. - # - # @overload list_crypto_keys(request, options = nil) - # Pass arguments to `list_crypto_keys` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListCryptoKeysRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListCryptoKeysRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_crypto_keys(parent: nil, page_size: nil, page_token: nil, version_view: nil, filter: nil, order_by: nil) - # Pass arguments to `list_crypto_keys` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} - # to list, in the format `projects/*/locations/*/keyRings/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} to include in the response. - # Further {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} can subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token}. - # @param version_view [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] - # The fields of the primary version to include in the response. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListCryptoKeysRequest.new - # - # # Call the list_crypto_keys method. - # result = client.list_crypto_keys request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::CryptoKey. - # p item - # end - # - def list_crypto_keys request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListCryptoKeysRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_crypto_keys.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_crypto_keys.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_crypto_keys.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :list_crypto_keys, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @key_management_service_stub, :list_crypto_keys, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. - # - # @overload list_crypto_key_versions(request, options = nil) - # Pass arguments to `list_crypto_key_versions` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_crypto_key_versions(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil, order_by: nil) - # Pass arguments to `list_crypto_key_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to list, in the format - # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} to include in the - # response. Further {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} - # can subsequently be obtained by including the - # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token}. - # @param view [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] - # The fields to include in the response. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new - # - # # Call the list_crypto_key_versions method. - # result = client.list_crypto_key_versions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::CryptoKeyVersion. - # p item - # end - # - def list_crypto_key_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_crypto_key_versions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_crypto_key_versions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_crypto_key_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :list_crypto_key_versions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @key_management_service_stub, :list_crypto_key_versions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. - # - # @overload list_import_jobs(request, options = nil) - # Pass arguments to `list_import_jobs` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListImportJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListImportJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_import_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_import_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} - # to list, in the format `projects/*/locations/*/keyRings/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::ImportJob ImportJobs} to include in the response. - # Further {::Google::Cloud::Kms::V1::ImportJob ImportJobs} can subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token}. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListImportJobsRequest.new - # - # # Call the list_import_jobs method. - # result = client.list_import_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::ImportJob. - # p item - # end - # - def list_import_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListImportJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_import_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_import_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_import_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :list_import_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @key_management_service_stub, :list_import_jobs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} which are - # the records of deleted {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. - # RetiredResources prevent the reuse of these resource names after deletion. - # - # @overload list_retired_resources(request, options = nil) - # Pass arguments to `list_retired_resources` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListRetiredResourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_retired_resources(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_retired_resources` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project-specific location holding the - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} to be included in - # the response. Further - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} can subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new - # - # # Call the list_retired_resources method. - # result = client.list_retired_resources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::RetiredResource. - # p item - # end - # - def list_retired_resources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_retired_resources.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_retired_resources.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_retired_resources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :list_retired_resources, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @key_management_service_stub, :list_retired_resources, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given {::Google::Cloud::Kms::V1::KeyRing KeyRing}. - # - # @overload get_key_ring(request, options = nil) - # Pass arguments to `get_key_ring` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetKeyRingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetKeyRingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_key_ring(name: nil) - # Pass arguments to `get_key_ring` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the - # {::Google::Cloud::Kms::V1::KeyRing KeyRing} to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::KeyRing] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::KeyRing] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetKeyRingRequest.new - # - # # Call the get_key_ring method. - # result = client.get_key_ring request - # - # # The returned object is of type Google::Cloud::Kms::V1::KeyRing. - # p result - # - def get_key_ring request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetKeyRingRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_key_ring.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_key_ring.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_key_ring.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :get_key_ring, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}, as - # well as its {::Google::Cloud::Kms::V1::CryptoKey#primary primary} - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. - # - # @overload get_crypto_key(request, options = nil) - # Pass arguments to `get_crypto_key` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetCryptoKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetCryptoKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_crypto_key(name: nil) - # Pass arguments to `get_crypto_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetCryptoKeyRequest.new - # - # # Call the get_crypto_key method. - # result = client.get_crypto_key request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - # p result - # - def get_crypto_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetCryptoKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_crypto_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_crypto_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_crypto_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :get_crypto_key, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. - # - # @overload get_crypto_key_version(request, options = nil) - # Pass arguments to `get_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_crypto_key_version(name: nil) - # Pass arguments to `get_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new - # - # # Call the get_crypto_key_version method. - # result = client.get_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def get_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_crypto_key_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :get_crypto_key_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the public key for the given - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. The - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_SIGN ASYMMETRIC_SIGN} - # or - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_DECRYPT ASYMMETRIC_DECRYPT}. - # - # @overload get_public_key(request, options = nil) - # Pass arguments to `get_public_key` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetPublicKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetPublicKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_public_key(name: nil, public_key_format: nil) - # Pass arguments to `get_public_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key to get. - # @param public_key_format [::Google::Cloud::Kms::V1::PublicKey::PublicKeyFormat] - # Optional. The {::Google::Cloud::Kms::V1::PublicKey PublicKey} format specified - # by the user. This field is required for PQC algorithms. If specified, the - # public key will be exported through the - # {::Google::Cloud::Kms::V1::PublicKey#public_key public_key} field in the - # requested format. Otherwise, the {::Google::Cloud::Kms::V1::PublicKey#pem pem} - # field will be populated for non-PQC algorithms, and an error will be - # returned for PQC algorithms. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::PublicKey] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::PublicKey] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetPublicKeyRequest.new - # - # # Call the get_public_key method. - # result = client.get_public_key request - # - # # The returned object is of type Google::Cloud::Kms::V1::PublicKey. - # p result - # - def get_public_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetPublicKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_public_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_public_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_public_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :get_public_key, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given {::Google::Cloud::Kms::V1::ImportJob ImportJob}. - # - # @overload get_import_job(request, options = nil) - # Pass arguments to `get_import_job` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetImportJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetImportJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_import_job(name: nil) - # Pass arguments to `get_import_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the - # {::Google::Cloud::Kms::V1::ImportJob ImportJob} to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::ImportJob] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::ImportJob] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetImportJobRequest.new - # - # # Call the get_import_job method. - # result = client.get_import_job request - # - # # The returned object is of type Google::Cloud::Kms::V1::ImportJob. - # p result - # - def get_import_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetImportJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_import_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_import_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_import_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :get_import_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a specific {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} - # resource, which represents the record of a deleted - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # @overload get_retired_resource(request, options = nil) - # Pass arguments to `get_retired_resource` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetRetiredResourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetRetiredResourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_retired_resource(name: nil) - # Pass arguments to `get_retired_resource` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::RetiredResource#name name} of the - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::RetiredResource] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::RetiredResource] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetRetiredResourceRequest.new - # - # # Call the get_retired_resource method. - # result = client.get_retired_resource request - # - # # The returned object is of type Google::Cloud::Kms::V1::RetiredResource. - # p result - # - def get_retired_resource request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetRetiredResourceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_retired_resource.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_retired_resource.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_retired_resource.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :get_retired_resource, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a new {::Google::Cloud::Kms::V1::KeyRing KeyRing} in a given Project and - # Location. - # - # @overload create_key_ring(request, options = nil) - # Pass arguments to `create_key_ring` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateKeyRingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateKeyRingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_key_ring(parent: nil, key_ring_id: nil, key_ring: nil) - # Pass arguments to `create_key_ring` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format - # `projects/*/locations/*`. - # @param key_ring_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param key_ring [::Google::Cloud::Kms::V1::KeyRing, ::Hash] - # Required. A {::Google::Cloud::Kms::V1::KeyRing KeyRing} with initial field - # values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::KeyRing] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::KeyRing] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateKeyRingRequest.new - # - # # Call the create_key_ring method. - # result = client.create_key_ring request - # - # # The returned object is of type Google::Cloud::Kms::V1::KeyRing. - # p result - # - def create_key_ring request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateKeyRingRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_key_ring.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_key_ring.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_key_ring.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :create_key_ring, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a new {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} within a - # {::Google::Cloud::Kms::V1::KeyRing KeyRing}. - # - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} and - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#algorithm CryptoKey.version_template.algorithm} - # are required. - # - # @overload create_crypto_key(request, options = nil) - # Pass arguments to `create_crypto_key` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateCryptoKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateCryptoKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_crypto_key(parent: nil, crypto_key_id: nil, crypto_key: nil, skip_initial_version_creation: nil) - # Pass arguments to `create_crypto_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the KeyRing - # associated with the {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. - # @param crypto_key_id [::String] - # Required. It must be unique within a KeyRing and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param crypto_key [::Google::Cloud::Kms::V1::CryptoKey, ::Hash] - # Required. A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with initial field - # values. - # @param skip_initial_version_creation [::Boolean] - # If set to true, the request will create a - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} without any - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. You must - # manually call - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} - # or - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version ImportCryptoKeyVersion} - # before you can use this {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new - # - # # Call the create_crypto_key method. - # result = client.create_crypto_key request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - # p result - # - def create_crypto_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_crypto_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_crypto_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_crypto_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :create_crypto_key, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a new {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in a - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # The server will assign the next sequential id. If unset, - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will be set to - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED}. - # - # @overload create_crypto_key_version(request, options = nil) - # Pass arguments to `create_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_crypto_key_version(parent: nil, crypto_key_version: nil) - # Pass arguments to `create_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} associated with the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. - # @param crypto_key_version [::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash] - # Required. A {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with - # initial field values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new - # - # # Call the create_crypto_key_version method. - # result = client.create_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def create_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_crypto_key_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :create_crypto_key_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes the given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # All child {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} must - # have been previously deleted using - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion}. - # The specified crypto key will be immediately and permanently deleted upon - # calling this method. This action cannot be undone. - # - # @overload delete_crypto_key(request, options = nil) - # Pass arguments to `delete_crypto_key` via a request object, either of type - # {::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_crypto_key(name: nil) - # Pass arguments to `delete_crypto_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new - # - # # Call the delete_crypto_key method. - # result = client.delete_crypto_key request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_crypto_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_crypto_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_crypto_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_crypto_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :delete_crypto_key, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes the given - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Only possible if - # the version has not been previously imported and if its - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is one of - # [DESTROYED][CryptoKeyVersionState.DESTROYED], - # [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or - # [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. - # Successfully imported - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} cannot be deleted - # at this time. The specified version will be immediately and permanently - # deleted upon calling this method. This action cannot be undone. - # - # @overload delete_crypto_key_version(request, options = nil) - # Pass arguments to `delete_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_crypto_key_version(name: nil) - # Pass arguments to `delete_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new - # - # # Call the delete_crypto_key_version method. - # result = client.delete_crypto_key_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_crypto_key_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :delete_crypto_key_version, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Import wrapped key material into a - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. - # - # All requests must specify a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. If - # a {::Google::Cloud::Kms::V1::CryptoKeyVersion 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 {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # @overload import_crypto_key_version(request, options = nil) - # Pass arguments to `import_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_crypto_key_version(parent: nil, crypto_key_version: nil, algorithm: nil, import_job: nil, wrapped_key: nil, rsa_aes_wrapped_key: nil) - # Pass arguments to `import_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to be imported into. - # - # The create permission is only required on this key when creating a new - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. - # @param crypto_key_version [::String] - # Optional. The optional {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of - # an existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to - # target for an import operation. If this field is not present, a new - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} containing the - # supplied key material is created. - # - # If this field is present, the supplied key material is imported into - # the existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. To - # import into an existing - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} must be a child of - # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#parent ImportCryptoKeyVersionRequest.parent}, - # have been previously created via - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version ImportCryptoKeyVersion}, - # and be in - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED} - # or - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::IMPORT_FAILED IMPORT_FAILED} - # state. The key material and algorithm must match the previous - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} exactly if the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} has ever contained - # key material. - # @param algorithm [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] - # Required. The - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm algorithm} - # of the key being imported. This does not need to match the - # {::Google::Cloud::Kms::V1::CryptoKey#version_template version_template} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} this version imports into. - # @param import_job [::String] - # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the - # {::Google::Cloud::Kms::V1::ImportJob ImportJob} that was used to wrap this key - # material. - # @param wrapped_key [::String] - # 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 - # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA1_AES_256 RSA_OAEP_3072_SHA1_AES_256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA1_AES_256 RSA_OAEP_4096_SHA1_AES_256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256_AES_256 RSA_OAEP_3072_SHA256_AES_256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256_AES_256 RSA_OAEP_4096_SHA256_AES_256}), - # - # this field must contain the concatenation of: - #
    - #
  1. An ephemeral AES-256 wrapping key wrapped with the - # {::Google::Cloud::Kms::V1::ImportJob#public_key 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 - # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256 RSA_OAEP_3072_SHA256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256 RSA_OAEP_4096_SHA256}), - # - # this field must contain the formatted key to be imported, wrapped with the - # {::Google::Cloud::Kms::V1::ImportJob#public_key public_key} using RSAES-OAEP - # with SHA-256, MGF1 with SHA-256, and an empty label. - # @param rsa_aes_wrapped_key [::String] - # Optional. This field has the same meaning as - # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#wrapped_key wrapped_key}. - # Prefer to use that field in new work. Either that field or this field - # (but not both) must be specified. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new - # - # # Call the import_crypto_key_version method. - # result = client.import_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def import_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.import_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.import_crypto_key_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :import_crypto_key_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a new {::Google::Cloud::Kms::V1::ImportJob ImportJob} within a - # {::Google::Cloud::Kms::V1::KeyRing KeyRing}. - # - # {::Google::Cloud::Kms::V1::ImportJob#import_method ImportJob.import_method} is - # required. - # - # @overload create_import_job(request, options = nil) - # Pass arguments to `create_import_job` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateImportJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateImportJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_import_job(parent: nil, import_job_id: nil, import_job: nil) - # Pass arguments to `create_import_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the - # {::Google::Cloud::Kms::V1::KeyRing KeyRing} associated with the - # {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. - # @param import_job_id [::String] - # Required. It must be unique within a KeyRing and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param import_job [::Google::Cloud::Kms::V1::ImportJob, ::Hash] - # Required. An {::Google::Cloud::Kms::V1::ImportJob ImportJob} with initial field - # values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::ImportJob] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::ImportJob] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateImportJobRequest.new - # - # # Call the create_import_job method. - # result = client.create_import_job request - # - # # The returned object is of type Google::Cloud::Kms::V1::ImportJob. - # p result - # - def create_import_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateImportJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_import_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_import_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_import_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :create_import_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # @overload update_crypto_key(request, options = nil) - # Pass arguments to `update_crypto_key` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_crypto_key(crypto_key: nil, update_mask: nil) - # Pass arguments to `update_crypto_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param crypto_key [::Google::Cloud::Kms::V1::CryptoKey, ::Hash] - # Required. {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new - # - # # Call the update_crypto_key method. - # result = client.update_crypto_key request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - # p result - # - def update_crypto_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_crypto_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.crypto_key&.name - header_params["crypto_key.name"] = request.crypto_key.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_crypto_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_crypto_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :update_crypto_key, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s - # metadata. - # - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} may be changed between - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} - # and - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED} - # using this method. See - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version DestroyCryptoKeyVersion} - # and - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version RestoreCryptoKeyVersion} - # to move between other states. - # - # @overload update_crypto_key_version(request, options = nil) - # Pass arguments to `update_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_crypto_key_version(crypto_key_version: nil, update_mask: nil) - # Pass arguments to `update_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param crypto_key_version [::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash] - # Required. {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with - # updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new - # - # # Call the update_crypto_key_version method. - # result = client.update_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def update_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.crypto_key_version&.name - header_params["crypto_key_version.name"] = request.crypto_key_version.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_crypto_key_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :update_crypto_key_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update the version of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that - # will be used in - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt}. - # - # Returns an error if called on a key whose purpose is not - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. - # - # @overload update_crypto_key_primary_version(request, options = nil) - # Pass arguments to `update_crypto_key_primary_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_crypto_key_primary_version(name: nil, crypto_key_version_id: nil) - # Pass arguments to `update_crypto_key_primary_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to update. - # @param crypto_key_version_id [::String] - # Required. The id of the child - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use as primary. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new - # - # # Call the update_crypto_key_primary_version method. - # result = client.update_crypto_key_primary_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - # p result - # - def update_crypto_key_primary_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_crypto_key_primary_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_crypto_key_primary_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_crypto_key_primary_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :update_crypto_key_primary_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Schedule a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} for - # destruction. - # - # Upon calling this method, - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state CryptoKeyVersion.state} will - # be set to - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED}, - # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will - # be set to the time - # {::Google::Cloud::Kms::V1::CryptoKey#destroy_scheduled_duration destroy_scheduled_duration} - # in the future. At that time, the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will automatically - # change to - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}, - # and the key material will be irrevocably destroyed. - # - # Before the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} is - # reached, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version RestoreCryptoKeyVersion} - # may be called to reverse the process. - # - # @overload destroy_crypto_key_version(request, options = nil) - # Pass arguments to `destroy_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload destroy_crypto_key_version(name: nil) - # Pass arguments to `destroy_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to destroy. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new - # - # # Call the destroy_crypto_key_version method. - # result = client.destroy_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def destroy_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.destroy_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.destroy_crypto_key_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.destroy_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :destroy_crypto_key_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Restore a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED} - # state. - # - # Upon restoration of the CryptoKeyVersion, - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will be set to - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED}, - # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will - # be cleared. - # - # @overload restore_crypto_key_version(request, options = nil) - # Pass arguments to `restore_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload restore_crypto_key_version(name: nil) - # Pass arguments to `restore_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to restore. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new - # - # # Call the restore_crypto_key_version method. - # result = client.restore_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def restore_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.restore_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.restore_crypto_key_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.restore_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :restore_crypto_key_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Encrypts data, so that it can only be recovered by a call to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt Decrypt}. The - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. - # - # @overload encrypt(request, options = nil) - # Pass arguments to `encrypt` via a request object, either of type - # {::Google::Cloud::Kms::V1::EncryptRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::EncryptRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil) - # Pass arguments to `encrypt` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} or - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # encryption. - # - # If a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is specified, the server - # will use its {::Google::Cloud::Kms::V1::CryptoKey#primary primary version}. - # @param plaintext [::String] - # Required. The data to encrypt. Must be no larger than 64KiB. - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys, the - # plaintext must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @param additional_authenticated_data [::String] - # Optional. Optional data that, if specified, must also be provided during - # decryption through - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys the - # AAD must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @param plaintext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}) - # is equal to - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c 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. - # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}) - # is equal to - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::EncryptResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::EncryptResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::EncryptRequest.new - # - # # Call the encrypt method. - # result = client.encrypt request - # - # # The returned object is of type Google::Cloud::Kms::V1::EncryptResponse. - # p result - # - def encrypt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::EncryptRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.encrypt.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.encrypt.timeout, - metadata: metadata, - retry_policy: @config.rpcs.encrypt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :encrypt, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Decrypts data that was protected by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt}. The - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. - # - # @overload decrypt(request, options = nil) - # Pass arguments to `decrypt` via a request object, either of type - # {::Google::Cloud::Kms::V1::DecryptRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DecryptRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil) - # Pass arguments to `decrypt` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to use for decryption. The - # server will choose the appropriate version. - # @param ciphertext [::String] - # Required. The encrypted data originally returned in - # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext EncryptResponse.ciphertext}. - # @param additional_authenticated_data [::String] - # Optional. Optional data that must match the data originally supplied in - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. - # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}) - # is equal to - # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext_crc32c 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. - # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}) - # is equal to - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data_crc32c 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::DecryptResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::DecryptResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DecryptRequest.new - # - # # Call the decrypt method. - # result = client.decrypt request - # - # # The returned object is of type Google::Cloud::Kms::V1::DecryptResponse. - # p result - # - def decrypt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DecryptRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.decrypt.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.decrypt.timeout, - metadata: metadata, - retry_policy: @config.rpcs.decrypt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :decrypt, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Encrypts data using portable cryptographic primitives. Most users should - # choose {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt} and - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt Decrypt} rather than - # their raw counterparts. The - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::RAW_ENCRYPT_DECRYPT RAW_ENCRYPT_DECRYPT}. - # - # @overload raw_encrypt(request, options = nil) - # Pass arguments to `raw_encrypt` via a request object, either of type - # {::Google::Cloud::Kms::V1::RawEncryptRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::RawEncryptRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload raw_encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector: nil, initialization_vector_crc32c: nil) - # Pass arguments to `raw_encrypt` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # encryption. - # @param plaintext [::String] - # Required. The data to encrypt. Must be no larger than 64KiB. - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the - # plaintext must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @param additional_authenticated_data [::String] - # Optional. Optional data that, if specified, must also be provided during - # decryption through - # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. - # - # This field may only be used in conjunction with an - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm} that accepts - # additional authenticated data (for example, AES-GCM). - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the - # plaintext must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @param plaintext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext RawEncryptRequest.plaintext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received plaintext using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received additional_authenticated_data using - # this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - # @param initialization_vector [::String] - # 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 - # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. - # @param initialization_vector_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector RawEncryptRequest.initialization_vector}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received initialization_vector using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::RawEncryptResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::RawEncryptResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::RawEncryptRequest.new - # - # # Call the raw_encrypt method. - # result = client.raw_encrypt request - # - # # The returned object is of type Google::Cloud::Kms::V1::RawEncryptResponse. - # p result - # - def raw_encrypt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RawEncryptRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.raw_encrypt.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.raw_encrypt.timeout, - metadata: metadata, - retry_policy: @config.rpcs.raw_encrypt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :raw_encrypt, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Decrypts data that was originally encrypted using a raw cryptographic - # mechanism. The {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # must be - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::RAW_ENCRYPT_DECRYPT RAW_ENCRYPT_DECRYPT}. - # - # @overload raw_decrypt(request, options = nil) - # Pass arguments to `raw_decrypt` via a request object, either of type - # {::Google::Cloud::Kms::V1::RawDecryptRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::RawDecryptRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload raw_decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, initialization_vector: nil, tag_length: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector_crc32c: nil) - # Pass arguments to `raw_decrypt` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # decryption. - # @param ciphertext [::String] - # Required. The encrypted data originally returned in - # {::Google::Cloud::Kms::V1::RawEncryptResponse#ciphertext RawEncryptResponse.ciphertext}. - # @param additional_authenticated_data [::String] - # Optional. Optional data that must match the data originally supplied in - # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. - # @param initialization_vector [::String] - # Required. The initialization vector (IV) used during encryption, which must - # match the data originally provided in - # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. - # @param tag_length [::Integer] - # 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). - # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext RawDecryptRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received ciphertext using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received additional_authenticated_data using - # this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - # @param initialization_vector_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector RawDecryptRequest.initialization_vector}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received initialization_vector using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::RawDecryptResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::RawDecryptResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::RawDecryptRequest.new - # - # # Call the raw_decrypt method. - # result = client.raw_decrypt request - # - # # The returned object is of type Google::Cloud::Kms::V1::RawDecryptResponse. - # p result - # - def raw_decrypt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RawDecryptRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.raw_decrypt.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.raw_decrypt.timeout, - metadata: metadata, - retry_policy: @config.rpcs.raw_decrypt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :raw_decrypt, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # ASYMMETRIC_SIGN, producing a signature that can be verified with the public - # key retrieved from - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey}. - # - # @overload asymmetric_sign(request, options = nil) - # Pass arguments to `asymmetric_sign` via a request object, either of type - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::AsymmetricSignRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload asymmetric_sign(name: nil, digest: nil, digest_crc32c: nil, data: nil, data_crc32c: nil) - # Pass arguments to `asymmetric_sign` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # signing. - # @param digest [::Google::Cloud::Kms::V1::Digest, ::Hash] - # 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 - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm}. - # - # This field may not be supplied if - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} - # is supplied. - # @param digest_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}) - # is equal to - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c 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. - # @param data [::String] - # Optional. The data to sign. - # It can't be supplied if - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} - # is supplied. - # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}) - # is equal to - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::AsymmetricSignResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::AsymmetricSignResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::AsymmetricSignRequest.new - # - # # Call the asymmetric_sign method. - # result = client.asymmetric_sign request - # - # # The returned object is of type Google::Cloud::Kms::V1::AsymmetricSignResponse. - # p result - # - def asymmetric_sign request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::AsymmetricSignRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.asymmetric_sign.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.asymmetric_sign.timeout, - metadata: metadata, - retry_policy: @config.rpcs.asymmetric_sign.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :asymmetric_sign, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Decrypts data that was encrypted with a public key retrieved from - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey} - # corresponding to a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # ASYMMETRIC_DECRYPT. - # - # @overload asymmetric_decrypt(request, options = nil) - # Pass arguments to `asymmetric_decrypt` via a request object, either of type - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::AsymmetricDecryptRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload asymmetric_decrypt(name: nil, ciphertext: nil, ciphertext_crc32c: nil) - # Pass arguments to `asymmetric_decrypt` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # decryption. - # @param ciphertext [::String] - # Required. The data encrypted with the named - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s public key using - # OAEP. - # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}) - # is equal to - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new - # - # # Call the asymmetric_decrypt method. - # result = client.asymmetric_decrypt request - # - # # The returned object is of type Google::Cloud::Kms::V1::AsymmetricDecryptResponse. - # p result - # - def asymmetric_decrypt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.asymmetric_decrypt.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.asymmetric_decrypt.timeout, - metadata: metadata, - retry_policy: @config.rpcs.asymmetric_decrypt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :asymmetric_decrypt, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} MAC, - # producing a tag that can be verified by another source with the same key. - # - # @overload mac_sign(request, options = nil) - # Pass arguments to `mac_sign` via a request object, either of type - # {::Google::Cloud::Kms::V1::MacSignRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::MacSignRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload mac_sign(name: nil, data: nil, data_crc32c: nil) - # Pass arguments to `mac_sign` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # signing. - # @param data [::String] - # Required. The data to sign. The MAC tag is computed over this data field - # based on the specific algorithm. - # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}. If - # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} - # will verify the integrity of the received - # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} - # will report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}) is - # equal to - # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::MacSignResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::MacSignResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::MacSignRequest.new - # - # # Call the mac_sign method. - # result = client.mac_sign request - # - # # The returned object is of type Google::Cloud::Kms::V1::MacSignResponse. - # p result - # - def mac_sign request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::MacSignRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.mac_sign.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.mac_sign.timeout, - metadata: metadata, - retry_policy: @config.rpcs.mac_sign.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :mac_sign, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Verifies MAC tag using a - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} MAC, and returns - # a response that indicates whether or not the verification was successful. - # - # @overload mac_verify(request, options = nil) - # Pass arguments to `mac_verify` via a request object, either of type - # {::Google::Cloud::Kms::V1::MacVerifyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::MacVerifyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload mac_verify(name: nil, data: nil, data_crc32c: nil, mac: nil, mac_crc32c: nil) - # Pass arguments to `mac_verify` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # verification. - # @param data [::String] - # Required. The data used previously as a - # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} to generate - # the MAC tag. - # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}. If - # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} - # will verify the integrity of the received - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data} using - # this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}) - # is equal to - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c 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. - # @param mac [::String] - # Required. The signature to verify. - # @param mac_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}. If - # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} - # will verify the integrity of the received - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac} using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} - # will report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}) is - # equal to - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::MacVerifyResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::MacVerifyResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::MacVerifyRequest.new - # - # # Call the mac_verify method. - # result = client.mac_verify request - # - # # The returned object is of type Google::Cloud::Kms::V1::MacVerifyResponse. - # p result - # - def mac_verify request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::MacVerifyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.mac_verify.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.mac_verify.timeout, - metadata: metadata, - retry_policy: @config.rpcs.mac_verify.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :mac_verify, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Decapsulates data that was encapsulated with a public key retrieved from - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey} - # corresponding to a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # KEY_ENCAPSULATION. - # - # @overload decapsulate(request, options = nil) - # Pass arguments to `decapsulate` via a request object, either of type - # {::Google::Cloud::Kms::V1::DecapsulateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DecapsulateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload decapsulate(name: nil, ciphertext: nil, ciphertext_crc32c: nil) - # Pass arguments to `decapsulate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # decapsulation. - # @param ciphertext [::String] - # Required. The ciphertext produced from encapsulation with the - # named {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public - # key(s). - # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. A CRC32C checksum of the - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}) - # is equal to - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::DecapsulateResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::DecapsulateResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DecapsulateRequest.new - # - # # Call the decapsulate method. - # result = client.decapsulate request - # - # # The returned object is of type Google::Cloud::Kms::V1::DecapsulateResponse. - # p result - # - def decapsulate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DecapsulateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.decapsulate.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.decapsulate.timeout, - metadata: metadata, - retry_policy: @config.rpcs.decapsulate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :decapsulate, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Generate random bytes using the Cloud KMS randomness source in the provided - # location. - # - # @overload generate_random_bytes(request, options = nil) - # Pass arguments to `generate_random_bytes` via a request object, either of type - # {::Google::Cloud::Kms::V1::GenerateRandomBytesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GenerateRandomBytesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload generate_random_bytes(location: nil, length_bytes: nil, protection_level: nil) - # Pass arguments to `generate_random_bytes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param location [::String] - # The project-specific location in which to generate random bytes. - # For example, "projects/my-project/locations/us-central1". - # @param length_bytes [::Integer] - # The length in bytes of the amount of randomness to retrieve. Minimum 8 - # bytes, maximum 1024 bytes. - # @param protection_level [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} to use when - # generating the random data. Currently, only - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} protection level is - # supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new - # - # # Call the generate_random_bytes method. - # result = client.generate_random_bytes request - # - # # The returned object is of type Google::Cloud::Kms::V1::GenerateRandomBytesResponse. - # p result - # - def generate_random_bytes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.generate_random_bytes.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.location - header_params["location"] = request.location - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.generate_random_bytes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_random_bytes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.call_rpc :generate_random_bytes, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the KeyManagementService API. - # - # This class represents the configuration for KeyManagementService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Kms::V1::KeyManagementService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_key_rings to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Kms::V1::KeyManagementService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_key_rings.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_key_rings.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the KeyManagementService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_key_rings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_key_rings - ## - # RPC-specific configuration for `list_crypto_keys` - # @return [::Gapic::Config::Method] - # - attr_reader :list_crypto_keys - ## - # RPC-specific configuration for `list_crypto_key_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_crypto_key_versions - ## - # RPC-specific configuration for `list_import_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_import_jobs - ## - # RPC-specific configuration for `list_retired_resources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_retired_resources - ## - # RPC-specific configuration for `get_key_ring` - # @return [::Gapic::Config::Method] - # - attr_reader :get_key_ring - ## - # RPC-specific configuration for `get_crypto_key` - # @return [::Gapic::Config::Method] - # - attr_reader :get_crypto_key - ## - # RPC-specific configuration for `get_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_crypto_key_version - ## - # RPC-specific configuration for `get_public_key` - # @return [::Gapic::Config::Method] - # - attr_reader :get_public_key - ## - # RPC-specific configuration for `get_import_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_import_job - ## - # RPC-specific configuration for `get_retired_resource` - # @return [::Gapic::Config::Method] - # - attr_reader :get_retired_resource - ## - # RPC-specific configuration for `create_key_ring` - # @return [::Gapic::Config::Method] - # - attr_reader :create_key_ring - ## - # RPC-specific configuration for `create_crypto_key` - # @return [::Gapic::Config::Method] - # - attr_reader :create_crypto_key - ## - # RPC-specific configuration for `create_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :create_crypto_key_version - ## - # RPC-specific configuration for `delete_crypto_key` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_crypto_key - ## - # RPC-specific configuration for `delete_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_crypto_key_version - ## - # RPC-specific configuration for `import_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :import_crypto_key_version - ## - # RPC-specific configuration for `create_import_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_import_job - ## - # RPC-specific configuration for `update_crypto_key` - # @return [::Gapic::Config::Method] - # - attr_reader :update_crypto_key - ## - # RPC-specific configuration for `update_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :update_crypto_key_version - ## - # RPC-specific configuration for `update_crypto_key_primary_version` - # @return [::Gapic::Config::Method] - # - attr_reader :update_crypto_key_primary_version - ## - # RPC-specific configuration for `destroy_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :destroy_crypto_key_version - ## - # RPC-specific configuration for `restore_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_crypto_key_version - ## - # RPC-specific configuration for `encrypt` - # @return [::Gapic::Config::Method] - # - attr_reader :encrypt - ## - # RPC-specific configuration for `decrypt` - # @return [::Gapic::Config::Method] - # - attr_reader :decrypt - ## - # RPC-specific configuration for `raw_encrypt` - # @return [::Gapic::Config::Method] - # - attr_reader :raw_encrypt - ## - # RPC-specific configuration for `raw_decrypt` - # @return [::Gapic::Config::Method] - # - attr_reader :raw_decrypt - ## - # RPC-specific configuration for `asymmetric_sign` - # @return [::Gapic::Config::Method] - # - attr_reader :asymmetric_sign - ## - # RPC-specific configuration for `asymmetric_decrypt` - # @return [::Gapic::Config::Method] - # - attr_reader :asymmetric_decrypt - ## - # RPC-specific configuration for `mac_sign` - # @return [::Gapic::Config::Method] - # - attr_reader :mac_sign - ## - # RPC-specific configuration for `mac_verify` - # @return [::Gapic::Config::Method] - # - attr_reader :mac_verify - ## - # RPC-specific configuration for `decapsulate` - # @return [::Gapic::Config::Method] - # - attr_reader :decapsulate - ## - # RPC-specific configuration for `generate_random_bytes` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_random_bytes - - # @private - def initialize parent_rpcs = nil - list_key_rings_config = parent_rpcs.list_key_rings if parent_rpcs.respond_to? :list_key_rings - @list_key_rings = ::Gapic::Config::Method.new list_key_rings_config - list_crypto_keys_config = parent_rpcs.list_crypto_keys if parent_rpcs.respond_to? :list_crypto_keys - @list_crypto_keys = ::Gapic::Config::Method.new list_crypto_keys_config - list_crypto_key_versions_config = parent_rpcs.list_crypto_key_versions if parent_rpcs.respond_to? :list_crypto_key_versions - @list_crypto_key_versions = ::Gapic::Config::Method.new list_crypto_key_versions_config - list_import_jobs_config = parent_rpcs.list_import_jobs if parent_rpcs.respond_to? :list_import_jobs - @list_import_jobs = ::Gapic::Config::Method.new list_import_jobs_config - list_retired_resources_config = parent_rpcs.list_retired_resources if parent_rpcs.respond_to? :list_retired_resources - @list_retired_resources = ::Gapic::Config::Method.new list_retired_resources_config - get_key_ring_config = parent_rpcs.get_key_ring if parent_rpcs.respond_to? :get_key_ring - @get_key_ring = ::Gapic::Config::Method.new get_key_ring_config - get_crypto_key_config = parent_rpcs.get_crypto_key if parent_rpcs.respond_to? :get_crypto_key - @get_crypto_key = ::Gapic::Config::Method.new get_crypto_key_config - get_crypto_key_version_config = parent_rpcs.get_crypto_key_version if parent_rpcs.respond_to? :get_crypto_key_version - @get_crypto_key_version = ::Gapic::Config::Method.new get_crypto_key_version_config - get_public_key_config = parent_rpcs.get_public_key if parent_rpcs.respond_to? :get_public_key - @get_public_key = ::Gapic::Config::Method.new get_public_key_config - get_import_job_config = parent_rpcs.get_import_job if parent_rpcs.respond_to? :get_import_job - @get_import_job = ::Gapic::Config::Method.new get_import_job_config - get_retired_resource_config = parent_rpcs.get_retired_resource if parent_rpcs.respond_to? :get_retired_resource - @get_retired_resource = ::Gapic::Config::Method.new get_retired_resource_config - create_key_ring_config = parent_rpcs.create_key_ring if parent_rpcs.respond_to? :create_key_ring - @create_key_ring = ::Gapic::Config::Method.new create_key_ring_config - create_crypto_key_config = parent_rpcs.create_crypto_key if parent_rpcs.respond_to? :create_crypto_key - @create_crypto_key = ::Gapic::Config::Method.new create_crypto_key_config - create_crypto_key_version_config = parent_rpcs.create_crypto_key_version if parent_rpcs.respond_to? :create_crypto_key_version - @create_crypto_key_version = ::Gapic::Config::Method.new create_crypto_key_version_config - delete_crypto_key_config = parent_rpcs.delete_crypto_key if parent_rpcs.respond_to? :delete_crypto_key - @delete_crypto_key = ::Gapic::Config::Method.new delete_crypto_key_config - delete_crypto_key_version_config = parent_rpcs.delete_crypto_key_version if parent_rpcs.respond_to? :delete_crypto_key_version - @delete_crypto_key_version = ::Gapic::Config::Method.new delete_crypto_key_version_config - import_crypto_key_version_config = parent_rpcs.import_crypto_key_version if parent_rpcs.respond_to? :import_crypto_key_version - @import_crypto_key_version = ::Gapic::Config::Method.new import_crypto_key_version_config - create_import_job_config = parent_rpcs.create_import_job if parent_rpcs.respond_to? :create_import_job - @create_import_job = ::Gapic::Config::Method.new create_import_job_config - update_crypto_key_config = parent_rpcs.update_crypto_key if parent_rpcs.respond_to? :update_crypto_key - @update_crypto_key = ::Gapic::Config::Method.new update_crypto_key_config - update_crypto_key_version_config = parent_rpcs.update_crypto_key_version if parent_rpcs.respond_to? :update_crypto_key_version - @update_crypto_key_version = ::Gapic::Config::Method.new update_crypto_key_version_config - update_crypto_key_primary_version_config = parent_rpcs.update_crypto_key_primary_version if parent_rpcs.respond_to? :update_crypto_key_primary_version - @update_crypto_key_primary_version = ::Gapic::Config::Method.new update_crypto_key_primary_version_config - destroy_crypto_key_version_config = parent_rpcs.destroy_crypto_key_version if parent_rpcs.respond_to? :destroy_crypto_key_version - @destroy_crypto_key_version = ::Gapic::Config::Method.new destroy_crypto_key_version_config - restore_crypto_key_version_config = parent_rpcs.restore_crypto_key_version if parent_rpcs.respond_to? :restore_crypto_key_version - @restore_crypto_key_version = ::Gapic::Config::Method.new restore_crypto_key_version_config - encrypt_config = parent_rpcs.encrypt if parent_rpcs.respond_to? :encrypt - @encrypt = ::Gapic::Config::Method.new encrypt_config - decrypt_config = parent_rpcs.decrypt if parent_rpcs.respond_to? :decrypt - @decrypt = ::Gapic::Config::Method.new decrypt_config - raw_encrypt_config = parent_rpcs.raw_encrypt if parent_rpcs.respond_to? :raw_encrypt - @raw_encrypt = ::Gapic::Config::Method.new raw_encrypt_config - raw_decrypt_config = parent_rpcs.raw_decrypt if parent_rpcs.respond_to? :raw_decrypt - @raw_decrypt = ::Gapic::Config::Method.new raw_decrypt_config - asymmetric_sign_config = parent_rpcs.asymmetric_sign if parent_rpcs.respond_to? :asymmetric_sign - @asymmetric_sign = ::Gapic::Config::Method.new asymmetric_sign_config - asymmetric_decrypt_config = parent_rpcs.asymmetric_decrypt if parent_rpcs.respond_to? :asymmetric_decrypt - @asymmetric_decrypt = ::Gapic::Config::Method.new asymmetric_decrypt_config - mac_sign_config = parent_rpcs.mac_sign if parent_rpcs.respond_to? :mac_sign - @mac_sign = ::Gapic::Config::Method.new mac_sign_config - mac_verify_config = parent_rpcs.mac_verify if parent_rpcs.respond_to? :mac_verify - @mac_verify = ::Gapic::Config::Method.new mac_verify_config - decapsulate_config = parent_rpcs.decapsulate if parent_rpcs.respond_to? :decapsulate - @decapsulate = ::Gapic::Config::Method.new decapsulate_config - generate_random_bytes_config = parent_rpcs.generate_random_bytes if parent_rpcs.respond_to? :generate_random_bytes - @generate_random_bytes = ::Gapic::Config::Method.new generate_random_bytes_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/credentials.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/credentials.rb deleted file mode 100644 index 0fe0b1bd5111..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Kms - module V1 - module KeyManagementService - # Credentials for the KeyManagementService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudkms" - ] - self.env_vars = [ - "KMS_CREDENTIALS", - "KMS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "KMS_CREDENTIALS_JSON", - "KMS_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb deleted file mode 100644 index 33dc14edfdae..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/paths.rb +++ /dev/null @@ -1,153 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - module KeyManagementService - # Path helper methods for the KeyManagementService API. - module Paths - ## - # Create a fully-qualified CryptoKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_key_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified CryptoKeyVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # @param crypto_key_version [String] - # - # @return [::String] - def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" - end - - ## - # Create a fully-qualified ImportJob resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param import_job [String] - # - # @return [::String] - def import_job_path project:, location:, key_ring:, import_job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/importJobs/#{import_job}" - end - - ## - # Create a fully-qualified KeyRing resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # - # @return [::String] - def key_ring_path project:, location:, key_ring: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified RetiredResource resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/retiredResources/{retired_resource}` - # - # @param project [String] - # @param location [String] - # @param retired_resource [String] - # - # @return [::String] - def retired_resource_path project:, location:, retired_resource: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/retiredResources/#{retired_resource}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb deleted file mode 100644 index 4ee52fe12d2b..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/kms/v1/version" -require "google/cloud/kms/v1/bindings_override" - -require "google/cloud/kms/v1/key_management_service/credentials" -require "google/cloud/kms/v1/key_management_service/paths" -require "google/cloud/kms/v1/key_management_service/rest/operations" -require "google/cloud/kms/v1/key_management_service/rest/client" - -module Google - module Cloud - module Kms - module V1 - ## - # Google Cloud Key Management Service - # - # Manages cryptographic keys and operations using those keys. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::Kms::V1::KeyRing KeyRing} - # * {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} - # * {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # * {::Google::Cloud::Kms::V1::ImportJob ImportJob} - # - # If you are using manual gRPC libraries, see - # [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/kms/v1/key_management_service/rest" - # client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - module KeyManagementService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/kms/v1/key_management_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb deleted file mode 100644 index f24965a9fc89..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb +++ /dev/null @@ -1,4233 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/kms/v1/service_pb" -require "google/cloud/kms/v1/key_management_service/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module Kms - module V1 - module KeyManagementService - module Rest - ## - # REST client for the KeyManagementService service. - # - # Google Cloud Key Management Service - # - # Manages cryptographic keys and operations using those keys. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::Kms::V1::KeyRing KeyRing} - # * {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} - # * {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # * {::Google::Cloud::Kms::V1::ImportJob ImportJob} - # - # If you are using manual gRPC libraries, see - # [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :key_management_service_stub - - ## - # Configure the KeyManagementService Client class. - # - # See {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all KeyManagementService clients - # ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Kms", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_key_rings.timeout = 60.0 - default_config.rpcs.list_key_rings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_crypto_keys.timeout = 60.0 - default_config.rpcs.list_crypto_keys.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_crypto_key_versions.timeout = 60.0 - default_config.rpcs.list_crypto_key_versions.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_import_jobs.timeout = 60.0 - default_config.rpcs.list_import_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_retired_resources.timeout = 60.0 - default_config.rpcs.list_retired_resources.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_key_ring.timeout = 60.0 - default_config.rpcs.get_key_ring.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_crypto_key.timeout = 60.0 - default_config.rpcs.get_crypto_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_crypto_key_version.timeout = 60.0 - default_config.rpcs.get_crypto_key_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_public_key.timeout = 60.0 - default_config.rpcs.get_public_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_import_job.timeout = 60.0 - default_config.rpcs.get_import_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_retired_resource.timeout = 60.0 - default_config.rpcs.get_retired_resource.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_key_ring.timeout = 60.0 - default_config.rpcs.create_key_ring.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_crypto_key.timeout = 60.0 - default_config.rpcs.create_crypto_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_crypto_key_version.timeout = 60.0 - - default_config.rpcs.delete_crypto_key.timeout = 60.0 - default_config.rpcs.delete_crypto_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_crypto_key_version.timeout = 60.0 - default_config.rpcs.delete_crypto_key_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.import_crypto_key_version.timeout = 60.0 - - default_config.rpcs.create_import_job.timeout = 60.0 - default_config.rpcs.create_import_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_crypto_key.timeout = 60.0 - default_config.rpcs.update_crypto_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_crypto_key_version.timeout = 60.0 - default_config.rpcs.update_crypto_key_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_crypto_key_primary_version.timeout = 60.0 - default_config.rpcs.update_crypto_key_primary_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.destroy_crypto_key_version.timeout = 60.0 - default_config.rpcs.destroy_crypto_key_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.restore_crypto_key_version.timeout = 60.0 - default_config.rpcs.restore_crypto_key_version.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.encrypt.timeout = 60.0 - default_config.rpcs.encrypt.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.decrypt.timeout = 60.0 - default_config.rpcs.decrypt.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.asymmetric_sign.timeout = 60.0 - default_config.rpcs.asymmetric_sign.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.asymmetric_decrypt.timeout = 60.0 - default_config.rpcs.asymmetric_decrypt.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.mac_sign.timeout = 60.0 - default_config.rpcs.mac_sign.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.mac_verify.timeout = 60.0 - default_config.rpcs.mac_verify.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.generate_random_bytes.timeout = 60.0 - default_config.rpcs.generate_random_bytes.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the KeyManagementService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @key_management_service_stub.universe_domain - end - - ## - # Create a new KeyManagementService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the KeyManagementService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @key_management_service_stub = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @key_management_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @key_management_service_stub.endpoint - config.universe_domain = @key_management_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @key_management_service_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @key_management_service_stub.endpoint - config.universe_domain = @key_management_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @key_management_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Kms::V1::KeyManagementService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @key_management_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::Kms::V1::KeyRing KeyRings}. - # - # @overload list_key_rings(request, options = nil) - # Pass arguments to `list_key_rings` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListKeyRingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListKeyRingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_key_rings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_key_rings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::KeyRing KeyRings} to include in the response. Further - # {::Google::Cloud::Kms::V1::KeyRing KeyRings} can subsequently be obtained by - # including the - # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token}. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListKeyRingsRequest.new - # - # # Call the list_key_rings method. - # result = client.list_key_rings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::KeyRing. - # p item - # end - # - def list_key_rings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListKeyRingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_key_rings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_key_rings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_key_rings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.list_key_rings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @key_management_service_stub, :list_key_rings, "key_rings", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. - # - # @overload list_crypto_keys(request, options = nil) - # Pass arguments to `list_crypto_keys` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListCryptoKeysRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListCryptoKeysRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_crypto_keys(parent: nil, page_size: nil, page_token: nil, version_view: nil, filter: nil, order_by: nil) - # Pass arguments to `list_crypto_keys` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} - # to list, in the format `projects/*/locations/*/keyRings/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} to include in the response. - # Further {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} can subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token}. - # @param version_view [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] - # The fields of the primary version to include in the response. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListCryptoKeysRequest.new - # - # # Call the list_crypto_keys method. - # result = client.list_crypto_keys request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::CryptoKey. - # p item - # end - # - def list_crypto_keys request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListCryptoKeysRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_crypto_keys.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_crypto_keys.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_crypto_keys.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.list_crypto_keys request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @key_management_service_stub, :list_crypto_keys, "crypto_keys", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. - # - # @overload list_crypto_key_versions(request, options = nil) - # Pass arguments to `list_crypto_key_versions` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_crypto_key_versions(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil, order_by: nil) - # Pass arguments to `list_crypto_key_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to list, in the format - # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} to include in the - # response. Further {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} - # can subsequently be obtained by including the - # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token}. - # @param view [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] - # The fields to include in the response. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new - # - # # Call the list_crypto_key_versions method. - # result = client.list_crypto_key_versions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::CryptoKeyVersion. - # p item - # end - # - def list_crypto_key_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_crypto_key_versions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_crypto_key_versions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_crypto_key_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.list_crypto_key_versions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @key_management_service_stub, :list_crypto_key_versions, "crypto_key_versions", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. - # - # @overload list_import_jobs(request, options = nil) - # Pass arguments to `list_import_jobs` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListImportJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListImportJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_import_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_import_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} - # to list, in the format `projects/*/locations/*/keyRings/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::ImportJob ImportJobs} to include in the response. - # Further {::Google::Cloud::Kms::V1::ImportJob ImportJobs} can subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token}. - # @param filter [::String] - # 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). - # @param order_by [::String] - # 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). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListImportJobsRequest.new - # - # # Call the list_import_jobs method. - # result = client.list_import_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::ImportJob. - # p item - # end - # - def list_import_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListImportJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_import_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_import_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_import_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.list_import_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @key_management_service_stub, :list_import_jobs, "import_jobs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} which are - # the records of deleted {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. - # RetiredResources prevent the reuse of these resource names after deletion. - # - # @overload list_retired_resources(request, options = nil) - # Pass arguments to `list_retired_resources` via a request object, either of type - # {::Google::Cloud::Kms::V1::ListRetiredResourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_retired_resources(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_retired_resources` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project-specific location holding the - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} to be included in - # the response. Further - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} can subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::RetiredResource>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new - # - # # Call the list_retired_resources method. - # result = client.list_retired_resources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Kms::V1::RetiredResource. - # p item - # end - # - def list_retired_resources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_retired_resources.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_retired_resources.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_retired_resources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.list_retired_resources request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @key_management_service_stub, :list_retired_resources, "retired_resources", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given {::Google::Cloud::Kms::V1::KeyRing KeyRing}. - # - # @overload get_key_ring(request, options = nil) - # Pass arguments to `get_key_ring` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetKeyRingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetKeyRingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_key_ring(name: nil) - # Pass arguments to `get_key_ring` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the - # {::Google::Cloud::Kms::V1::KeyRing KeyRing} to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::KeyRing] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::KeyRing] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetKeyRingRequest.new - # - # # Call the get_key_ring method. - # result = client.get_key_ring request - # - # # The returned object is of type Google::Cloud::Kms::V1::KeyRing. - # p result - # - def get_key_ring request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetKeyRingRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_key_ring.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_key_ring.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_key_ring.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.get_key_ring request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}, as - # well as its {::Google::Cloud::Kms::V1::CryptoKey#primary primary} - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. - # - # @overload get_crypto_key(request, options = nil) - # Pass arguments to `get_crypto_key` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetCryptoKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetCryptoKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_crypto_key(name: nil) - # Pass arguments to `get_crypto_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetCryptoKeyRequest.new - # - # # Call the get_crypto_key method. - # result = client.get_crypto_key request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - # p result - # - def get_crypto_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetCryptoKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_crypto_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_crypto_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_crypto_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.get_crypto_key request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. - # - # @overload get_crypto_key_version(request, options = nil) - # Pass arguments to `get_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_crypto_key_version(name: nil) - # Pass arguments to `get_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new - # - # # Call the get_crypto_key_version method. - # result = client.get_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def get_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_crypto_key_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.get_crypto_key_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the public key for the given - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. The - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_SIGN ASYMMETRIC_SIGN} - # or - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_DECRYPT ASYMMETRIC_DECRYPT}. - # - # @overload get_public_key(request, options = nil) - # Pass arguments to `get_public_key` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetPublicKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetPublicKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_public_key(name: nil, public_key_format: nil) - # Pass arguments to `get_public_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key to get. - # @param public_key_format [::Google::Cloud::Kms::V1::PublicKey::PublicKeyFormat] - # Optional. The {::Google::Cloud::Kms::V1::PublicKey PublicKey} format specified - # by the user. This field is required for PQC algorithms. If specified, the - # public key will be exported through the - # {::Google::Cloud::Kms::V1::PublicKey#public_key public_key} field in the - # requested format. Otherwise, the {::Google::Cloud::Kms::V1::PublicKey#pem pem} - # field will be populated for non-PQC algorithms, and an error will be - # returned for PQC algorithms. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::PublicKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::PublicKey] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetPublicKeyRequest.new - # - # # Call the get_public_key method. - # result = client.get_public_key request - # - # # The returned object is of type Google::Cloud::Kms::V1::PublicKey. - # p result - # - def get_public_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetPublicKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_public_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_public_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_public_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.get_public_key request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for a given {::Google::Cloud::Kms::V1::ImportJob ImportJob}. - # - # @overload get_import_job(request, options = nil) - # Pass arguments to `get_import_job` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetImportJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetImportJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_import_job(name: nil) - # Pass arguments to `get_import_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the - # {::Google::Cloud::Kms::V1::ImportJob ImportJob} to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ImportJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ImportJob] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetImportJobRequest.new - # - # # Call the get_import_job method. - # result = client.get_import_job request - # - # # The returned object is of type Google::Cloud::Kms::V1::ImportJob. - # p result - # - def get_import_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetImportJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_import_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_import_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_import_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.get_import_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a specific {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} - # resource, which represents the record of a deleted - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # @overload get_retired_resource(request, options = nil) - # Pass arguments to `get_retired_resource` via a request object, either of type - # {::Google::Cloud::Kms::V1::GetRetiredResourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GetRetiredResourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_retired_resource(name: nil) - # Pass arguments to `get_retired_resource` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::RetiredResource#name name} of the - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::RetiredResource] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::RetiredResource] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GetRetiredResourceRequest.new - # - # # Call the get_retired_resource method. - # result = client.get_retired_resource request - # - # # The returned object is of type Google::Cloud::Kms::V1::RetiredResource. - # p result - # - def get_retired_resource request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetRetiredResourceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_retired_resource.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_retired_resource.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_retired_resource.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.get_retired_resource request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a new {::Google::Cloud::Kms::V1::KeyRing KeyRing} in a given Project and - # Location. - # - # @overload create_key_ring(request, options = nil) - # Pass arguments to `create_key_ring` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateKeyRingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateKeyRingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_key_ring(parent: nil, key_ring_id: nil, key_ring: nil) - # Pass arguments to `create_key_ring` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format - # `projects/*/locations/*`. - # @param key_ring_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param key_ring [::Google::Cloud::Kms::V1::KeyRing, ::Hash] - # Required. A {::Google::Cloud::Kms::V1::KeyRing KeyRing} with initial field - # values. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::KeyRing] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::KeyRing] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateKeyRingRequest.new - # - # # Call the create_key_ring method. - # result = client.create_key_ring request - # - # # The returned object is of type Google::Cloud::Kms::V1::KeyRing. - # p result - # - def create_key_ring request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateKeyRingRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_key_ring.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_key_ring.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_key_ring.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.create_key_ring request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a new {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} within a - # {::Google::Cloud::Kms::V1::KeyRing KeyRing}. - # - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} and - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#algorithm CryptoKey.version_template.algorithm} - # are required. - # - # @overload create_crypto_key(request, options = nil) - # Pass arguments to `create_crypto_key` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateCryptoKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateCryptoKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_crypto_key(parent: nil, crypto_key_id: nil, crypto_key: nil, skip_initial_version_creation: nil) - # Pass arguments to `create_crypto_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the KeyRing - # associated with the {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. - # @param crypto_key_id [::String] - # Required. It must be unique within a KeyRing and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param crypto_key [::Google::Cloud::Kms::V1::CryptoKey, ::Hash] - # Required. A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with initial field - # values. - # @param skip_initial_version_creation [::Boolean] - # If set to true, the request will create a - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} without any - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. You must - # manually call - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#create_crypto_key_version CreateCryptoKeyVersion} - # or - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#import_crypto_key_version ImportCryptoKeyVersion} - # before you can use this {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new - # - # # Call the create_crypto_key method. - # result = client.create_crypto_key request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - # p result - # - def create_crypto_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_crypto_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_crypto_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_crypto_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.create_crypto_key request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a new {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in a - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # The server will assign the next sequential id. If unset, - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will be set to - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED}. - # - # @overload create_crypto_key_version(request, options = nil) - # Pass arguments to `create_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_crypto_key_version(parent: nil, crypto_key_version: nil) - # Pass arguments to `create_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} associated with the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. - # @param crypto_key_version [::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash] - # Required. A {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with - # initial field values. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new - # - # # Call the create_crypto_key_version method. - # result = client.create_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def create_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_crypto_key_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.create_crypto_key_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes the given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # All child {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} must - # have been previously deleted using - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion}. - # The specified crypto key will be immediately and permanently deleted upon - # calling this method. This action cannot be undone. - # - # @overload delete_crypto_key(request, options = nil) - # Pass arguments to `delete_crypto_key` via a request object, either of type - # {::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_crypto_key(name: nil) - # Pass arguments to `delete_crypto_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new - # - # # Call the delete_crypto_key method. - # result = client.delete_crypto_key request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_crypto_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_crypto_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_crypto_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_crypto_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.delete_crypto_key request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes the given - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Only possible if - # the version has not been previously imported and if its - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is one of - # [DESTROYED][CryptoKeyVersionState.DESTROYED], - # [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or - # [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. - # Successfully imported - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} cannot be deleted - # at this time. The specified version will be immediately and permanently - # deleted upon calling this method. This action cannot be undone. - # - # @overload delete_crypto_key_version(request, options = nil) - # Pass arguments to `delete_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_crypto_key_version(name: nil) - # Pass arguments to `delete_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new - # - # # Call the delete_crypto_key_version method. - # result = client.delete_crypto_key_version request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_crypto_key_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.delete_crypto_key_version request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Import wrapped key material into a - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. - # - # All requests must specify a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. If - # a {::Google::Cloud::Kms::V1::CryptoKeyVersion 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 {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # @overload import_crypto_key_version(request, options = nil) - # Pass arguments to `import_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_crypto_key_version(parent: nil, crypto_key_version: nil, algorithm: nil, import_job: nil, wrapped_key: nil, rsa_aes_wrapped_key: nil) - # Pass arguments to `import_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to be imported into. - # - # The create permission is only required on this key when creating a new - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. - # @param crypto_key_version [::String] - # Optional. The optional {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of - # an existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to - # target for an import operation. If this field is not present, a new - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} containing the - # supplied key material is created. - # - # If this field is present, the supplied key material is imported into - # the existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. To - # import into an existing - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} must be a child of - # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#parent ImportCryptoKeyVersionRequest.parent}, - # have been previously created via - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#import_crypto_key_version ImportCryptoKeyVersion}, - # and be in - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED} - # or - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::IMPORT_FAILED IMPORT_FAILED} - # state. The key material and algorithm must match the previous - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} exactly if the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} has ever contained - # key material. - # @param algorithm [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] - # Required. The - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm algorithm} - # of the key being imported. This does not need to match the - # {::Google::Cloud::Kms::V1::CryptoKey#version_template version_template} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} this version imports into. - # @param import_job [::String] - # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the - # {::Google::Cloud::Kms::V1::ImportJob ImportJob} that was used to wrap this key - # material. - # @param wrapped_key [::String] - # 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 - # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA1_AES_256 RSA_OAEP_3072_SHA1_AES_256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA1_AES_256 RSA_OAEP_4096_SHA1_AES_256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256_AES_256 RSA_OAEP_3072_SHA256_AES_256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256_AES_256 RSA_OAEP_4096_SHA256_AES_256}), - # - # this field must contain the concatenation of: - #
    - #
  1. An ephemeral AES-256 wrapping key wrapped with the - # {::Google::Cloud::Kms::V1::ImportJob#public_key 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 - # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256 RSA_OAEP_3072_SHA256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256 RSA_OAEP_4096_SHA256}), - # - # this field must contain the formatted key to be imported, wrapped with the - # {::Google::Cloud::Kms::V1::ImportJob#public_key public_key} using RSAES-OAEP - # with SHA-256, MGF1 with SHA-256, and an empty label. - # @param rsa_aes_wrapped_key [::String] - # Optional. This field has the same meaning as - # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#wrapped_key wrapped_key}. - # Prefer to use that field in new work. Either that field or this field - # (but not both) must be specified. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new - # - # # Call the import_crypto_key_version method. - # result = client.import_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def import_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.import_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_crypto_key_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.import_crypto_key_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a new {::Google::Cloud::Kms::V1::ImportJob ImportJob} within a - # {::Google::Cloud::Kms::V1::KeyRing KeyRing}. - # - # {::Google::Cloud::Kms::V1::ImportJob#import_method ImportJob.import_method} is - # required. - # - # @overload create_import_job(request, options = nil) - # Pass arguments to `create_import_job` via a request object, either of type - # {::Google::Cloud::Kms::V1::CreateImportJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::CreateImportJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_import_job(parent: nil, import_job_id: nil, import_job: nil) - # Pass arguments to `create_import_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the - # {::Google::Cloud::Kms::V1::KeyRing KeyRing} associated with the - # {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. - # @param import_job_id [::String] - # Required. It must be unique within a KeyRing and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param import_job [::Google::Cloud::Kms::V1::ImportJob, ::Hash] - # Required. An {::Google::Cloud::Kms::V1::ImportJob ImportJob} with initial field - # values. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ImportJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ImportJob] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::CreateImportJobRequest.new - # - # # Call the create_import_job method. - # result = client.create_import_job request - # - # # The returned object is of type Google::Cloud::Kms::V1::ImportJob. - # p result - # - def create_import_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::CreateImportJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_import_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_import_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_import_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.create_import_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # - # @overload update_crypto_key(request, options = nil) - # Pass arguments to `update_crypto_key` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_crypto_key(crypto_key: nil, update_mask: nil) - # Pass arguments to `update_crypto_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param crypto_key [::Google::Cloud::Kms::V1::CryptoKey, ::Hash] - # Required. {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new - # - # # Call the update_crypto_key method. - # result = client.update_crypto_key request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - # p result - # - def update_crypto_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_crypto_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_crypto_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_crypto_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.update_crypto_key request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s - # metadata. - # - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} may be changed between - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} - # and - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED} - # using this method. See - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#destroy_crypto_key_version DestroyCryptoKeyVersion} - # and - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#restore_crypto_key_version RestoreCryptoKeyVersion} - # to move between other states. - # - # @overload update_crypto_key_version(request, options = nil) - # Pass arguments to `update_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_crypto_key_version(crypto_key_version: nil, update_mask: nil) - # Pass arguments to `update_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param crypto_key_version [::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash] - # Required. {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with - # updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new - # - # # Call the update_crypto_key_version method. - # result = client.update_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def update_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_crypto_key_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.update_crypto_key_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update the version of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that - # will be used in - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#encrypt Encrypt}. - # - # Returns an error if called on a key whose purpose is not - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. - # - # @overload update_crypto_key_primary_version(request, options = nil) - # Pass arguments to `update_crypto_key_primary_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_crypto_key_primary_version(name: nil, crypto_key_version_id: nil) - # Pass arguments to `update_crypto_key_primary_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to update. - # @param crypto_key_version_id [::String] - # Required. The id of the child - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use as primary. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new - # - # # Call the update_crypto_key_primary_version method. - # result = client.update_crypto_key_primary_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - # p result - # - def update_crypto_key_primary_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_crypto_key_primary_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_crypto_key_primary_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_crypto_key_primary_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.update_crypto_key_primary_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Schedule a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} for - # destruction. - # - # Upon calling this method, - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state CryptoKeyVersion.state} will - # be set to - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED}, - # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will - # be set to the time - # {::Google::Cloud::Kms::V1::CryptoKey#destroy_scheduled_duration destroy_scheduled_duration} - # in the future. At that time, the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will automatically - # change to - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}, - # and the key material will be irrevocably destroyed. - # - # Before the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} is - # reached, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#restore_crypto_key_version RestoreCryptoKeyVersion} - # may be called to reverse the process. - # - # @overload destroy_crypto_key_version(request, options = nil) - # Pass arguments to `destroy_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload destroy_crypto_key_version(name: nil) - # Pass arguments to `destroy_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to destroy. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new - # - # # Call the destroy_crypto_key_version method. - # result = client.destroy_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def destroy_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.destroy_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.destroy_crypto_key_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.destroy_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.destroy_crypto_key_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Restore a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED} - # state. - # - # Upon restoration of the CryptoKeyVersion, - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will be set to - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED}, - # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will - # be cleared. - # - # @overload restore_crypto_key_version(request, options = nil) - # Pass arguments to `restore_crypto_key_version` via a request object, either of type - # {::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload restore_crypto_key_version(name: nil) - # Pass arguments to `restore_crypto_key_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to restore. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new - # - # # Call the restore_crypto_key_version method. - # result = client.restore_crypto_key_version request - # - # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - # p result - # - def restore_crypto_key_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.restore_crypto_key_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.restore_crypto_key_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.restore_crypto_key_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.restore_crypto_key_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Encrypts data, so that it can only be recovered by a call to - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#decrypt Decrypt}. The - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. - # - # @overload encrypt(request, options = nil) - # Pass arguments to `encrypt` via a request object, either of type - # {::Google::Cloud::Kms::V1::EncryptRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::EncryptRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil) - # Pass arguments to `encrypt` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} or - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # encryption. - # - # If a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is specified, the server - # will use its {::Google::Cloud::Kms::V1::CryptoKey#primary primary version}. - # @param plaintext [::String] - # Required. The data to encrypt. Must be no larger than 64KiB. - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys, the - # plaintext must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @param additional_authenticated_data [::String] - # Optional. Optional data that, if specified, must also be provided during - # decryption through - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys the - # AAD must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @param plaintext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}) - # is equal to - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c 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. - # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}) - # is equal to - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EncryptResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EncryptResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::EncryptRequest.new - # - # # Call the encrypt method. - # result = client.encrypt request - # - # # The returned object is of type Google::Cloud::Kms::V1::EncryptResponse. - # p result - # - def encrypt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::EncryptRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.encrypt.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.encrypt.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.encrypt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.encrypt request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Decrypts data that was protected by - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#encrypt Encrypt}. The - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. - # - # @overload decrypt(request, options = nil) - # Pass arguments to `decrypt` via a request object, either of type - # {::Google::Cloud::Kms::V1::DecryptRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DecryptRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil) - # Pass arguments to `decrypt` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to use for decryption. The - # server will choose the appropriate version. - # @param ciphertext [::String] - # Required. The encrypted data originally returned in - # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext EncryptResponse.ciphertext}. - # @param additional_authenticated_data [::String] - # Optional. Optional data that must match the data originally supplied in - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. - # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}) - # is equal to - # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext_crc32c 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. - # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}) - # is equal to - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data_crc32c 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::DecryptResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::DecryptResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DecryptRequest.new - # - # # Call the decrypt method. - # result = client.decrypt request - # - # # The returned object is of type Google::Cloud::Kms::V1::DecryptResponse. - # p result - # - def decrypt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DecryptRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.decrypt.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.decrypt.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.decrypt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.decrypt request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Encrypts data using portable cryptographic primitives. Most users should - # choose {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#encrypt Encrypt} and - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#decrypt Decrypt} rather than - # their raw counterparts. The - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::RAW_ENCRYPT_DECRYPT RAW_ENCRYPT_DECRYPT}. - # - # @overload raw_encrypt(request, options = nil) - # Pass arguments to `raw_encrypt` via a request object, either of type - # {::Google::Cloud::Kms::V1::RawEncryptRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::RawEncryptRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload raw_encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector: nil, initialization_vector_crc32c: nil) - # Pass arguments to `raw_encrypt` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # encryption. - # @param plaintext [::String] - # Required. The data to encrypt. Must be no larger than 64KiB. - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the - # plaintext must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @param additional_authenticated_data [::String] - # Optional. Optional data that, if specified, must also be provided during - # decryption through - # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. - # - # This field may only be used in conjunction with an - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm} that accepts - # additional authenticated data (for example, AES-GCM). - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the - # plaintext must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @param plaintext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext RawEncryptRequest.plaintext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received plaintext using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. - # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received additional_authenticated_data using - # this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. - # @param initialization_vector [::String] - # 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 - # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. - # @param initialization_vector_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector RawEncryptRequest.initialization_vector}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received initialization_vector using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::RawEncryptResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::RawEncryptResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::RawEncryptRequest.new - # - # # Call the raw_encrypt method. - # result = client.raw_encrypt request - # - # # The returned object is of type Google::Cloud::Kms::V1::RawEncryptResponse. - # p result - # - def raw_encrypt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RawEncryptRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.raw_encrypt.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.raw_encrypt.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.raw_encrypt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.raw_encrypt request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Decrypts data that was originally encrypted using a raw cryptographic - # mechanism. The {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # must be - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::RAW_ENCRYPT_DECRYPT RAW_ENCRYPT_DECRYPT}. - # - # @overload raw_decrypt(request, options = nil) - # Pass arguments to `raw_decrypt` via a request object, either of type - # {::Google::Cloud::Kms::V1::RawDecryptRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::RawDecryptRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload raw_decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, initialization_vector: nil, tag_length: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector_crc32c: nil) - # Pass arguments to `raw_decrypt` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # decryption. - # @param ciphertext [::String] - # Required. The encrypted data originally returned in - # {::Google::Cloud::Kms::V1::RawEncryptResponse#ciphertext RawEncryptResponse.ciphertext}. - # @param additional_authenticated_data [::String] - # Optional. Optional data that must match the data originally supplied in - # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. - # @param initialization_vector [::String] - # Required. The initialization vector (IV) used during encryption, which must - # match the data originally provided in - # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. - # @param tag_length [::Integer] - # 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). - # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext RawDecryptRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received ciphertext using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. - # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received additional_authenticated_data using - # this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. - # @param initialization_vector_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector RawDecryptRequest.initialization_vector}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received initialization_vector using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::RawDecryptResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::RawDecryptResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::RawDecryptRequest.new - # - # # Call the raw_decrypt method. - # result = client.raw_decrypt request - # - # # The returned object is of type Google::Cloud::Kms::V1::RawDecryptResponse. - # p result - # - def raw_decrypt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RawDecryptRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.raw_decrypt.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.raw_decrypt.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.raw_decrypt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.raw_decrypt request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # ASYMMETRIC_SIGN, producing a signature that can be verified with the public - # key retrieved from - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#get_public_key GetPublicKey}. - # - # @overload asymmetric_sign(request, options = nil) - # Pass arguments to `asymmetric_sign` via a request object, either of type - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::AsymmetricSignRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload asymmetric_sign(name: nil, digest: nil, digest_crc32c: nil, data: nil, data_crc32c: nil) - # Pass arguments to `asymmetric_sign` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # signing. - # @param digest [::Google::Cloud::Kms::V1::Digest, ::Hash] - # 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 - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm}. - # - # This field may not be supplied if - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} - # is supplied. - # @param digest_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}) - # is equal to - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c 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. - # @param data [::String] - # Optional. The data to sign. - # It can't be supplied if - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} - # is supplied. - # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}) - # is equal to - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::AsymmetricSignResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::AsymmetricSignResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::AsymmetricSignRequest.new - # - # # Call the asymmetric_sign method. - # result = client.asymmetric_sign request - # - # # The returned object is of type Google::Cloud::Kms::V1::AsymmetricSignResponse. - # p result - # - def asymmetric_sign request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::AsymmetricSignRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.asymmetric_sign.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.asymmetric_sign.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.asymmetric_sign.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.asymmetric_sign request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Decrypts data that was encrypted with a public key retrieved from - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#get_public_key GetPublicKey} - # corresponding to a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # ASYMMETRIC_DECRYPT. - # - # @overload asymmetric_decrypt(request, options = nil) - # Pass arguments to `asymmetric_decrypt` via a request object, either of type - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::AsymmetricDecryptRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload asymmetric_decrypt(name: nil, ciphertext: nil, ciphertext_crc32c: nil) - # Pass arguments to `asymmetric_decrypt` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # decryption. - # @param ciphertext [::String] - # Required. The data encrypted with the named - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s public key using - # OAEP. - # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}) - # is equal to - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new - # - # # Call the asymmetric_decrypt method. - # result = client.asymmetric_decrypt request - # - # # The returned object is of type Google::Cloud::Kms::V1::AsymmetricDecryptResponse. - # p result - # - def asymmetric_decrypt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.asymmetric_decrypt.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.asymmetric_decrypt.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.asymmetric_decrypt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.asymmetric_decrypt request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} MAC, - # producing a tag that can be verified by another source with the same key. - # - # @overload mac_sign(request, options = nil) - # Pass arguments to `mac_sign` via a request object, either of type - # {::Google::Cloud::Kms::V1::MacSignRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::MacSignRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload mac_sign(name: nil, data: nil, data_crc32c: nil) - # Pass arguments to `mac_sign` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # signing. - # @param data [::String] - # Required. The data to sign. The MAC tag is computed over this data field - # based on the specific algorithm. - # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}. If - # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} - # will verify the integrity of the received - # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} - # will report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}) is - # equal to - # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::MacSignResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::MacSignResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::MacSignRequest.new - # - # # Call the mac_sign method. - # result = client.mac_sign request - # - # # The returned object is of type Google::Cloud::Kms::V1::MacSignResponse. - # p result - # - def mac_sign request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::MacSignRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.mac_sign.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.mac_sign.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.mac_sign.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.mac_sign request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Verifies MAC tag using a - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} MAC, and returns - # a response that indicates whether or not the verification was successful. - # - # @overload mac_verify(request, options = nil) - # Pass arguments to `mac_verify` via a request object, either of type - # {::Google::Cloud::Kms::V1::MacVerifyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::MacVerifyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload mac_verify(name: nil, data: nil, data_crc32c: nil, mac: nil, mac_crc32c: nil) - # Pass arguments to `mac_verify` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # verification. - # @param data [::String] - # Required. The data used previously as a - # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} to generate - # the MAC tag. - # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}. If - # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} - # will verify the integrity of the received - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data} using - # this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}) - # is equal to - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c 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. - # @param mac [::String] - # Required. The signature to verify. - # @param mac_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}. If - # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} - # will verify the integrity of the received - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac} using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} - # will report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}) is - # equal to - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::MacVerifyResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::MacVerifyResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::MacVerifyRequest.new - # - # # Call the mac_verify method. - # result = client.mac_verify request - # - # # The returned object is of type Google::Cloud::Kms::V1::MacVerifyResponse. - # p result - # - def mac_verify request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::MacVerifyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.mac_verify.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.mac_verify.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.mac_verify.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.mac_verify request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Decapsulates data that was encapsulated with a public key retrieved from - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client#get_public_key GetPublicKey} - # corresponding to a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # KEY_ENCAPSULATION. - # - # @overload decapsulate(request, options = nil) - # Pass arguments to `decapsulate` via a request object, either of type - # {::Google::Cloud::Kms::V1::DecapsulateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::DecapsulateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload decapsulate(name: nil, ciphertext: nil, ciphertext_crc32c: nil) - # Pass arguments to `decapsulate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # decapsulation. - # @param ciphertext [::String] - # Required. The ciphertext produced from encapsulation with the - # named {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public - # key(s). - # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash] - # Optional. A CRC32C checksum of the - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}) - # is equal to - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::DecapsulateResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::DecapsulateResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::DecapsulateRequest.new - # - # # Call the decapsulate method. - # result = client.decapsulate request - # - # # The returned object is of type Google::Cloud::Kms::V1::DecapsulateResponse. - # p result - # - def decapsulate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DecapsulateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.decapsulate.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.decapsulate.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.decapsulate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.decapsulate request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Generate random bytes using the Cloud KMS randomness source in the provided - # location. - # - # @overload generate_random_bytes(request, options = nil) - # Pass arguments to `generate_random_bytes` via a request object, either of type - # {::Google::Cloud::Kms::V1::GenerateRandomBytesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Kms::V1::GenerateRandomBytesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload generate_random_bytes(location: nil, length_bytes: nil, protection_level: nil) - # Pass arguments to `generate_random_bytes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param location [::String] - # The project-specific location in which to generate random bytes. - # For example, "projects/my-project/locations/us-central1". - # @param length_bytes [::Integer] - # The length in bytes of the amount of randomness to retrieve. Minimum 8 - # bytes, maximum 1024 bytes. - # @param protection_level [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} to use when - # generating the random data. Currently, only - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} protection level is - # supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/kms/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new - # - # # Call the generate_random_bytes method. - # result = client.generate_random_bytes request - # - # # The returned object is of type Google::Cloud::Kms::V1::GenerateRandomBytesResponse. - # p result - # - def generate_random_bytes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.generate_random_bytes.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Kms::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.generate_random_bytes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_random_bytes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @key_management_service_stub.generate_random_bytes request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the KeyManagementService REST API. - # - # This class represents the configuration for KeyManagementService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_key_rings to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_key_rings.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_key_rings.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudkms.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the KeyManagementService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_key_rings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_key_rings - ## - # RPC-specific configuration for `list_crypto_keys` - # @return [::Gapic::Config::Method] - # - attr_reader :list_crypto_keys - ## - # RPC-specific configuration for `list_crypto_key_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_crypto_key_versions - ## - # RPC-specific configuration for `list_import_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_import_jobs - ## - # RPC-specific configuration for `list_retired_resources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_retired_resources - ## - # RPC-specific configuration for `get_key_ring` - # @return [::Gapic::Config::Method] - # - attr_reader :get_key_ring - ## - # RPC-specific configuration for `get_crypto_key` - # @return [::Gapic::Config::Method] - # - attr_reader :get_crypto_key - ## - # RPC-specific configuration for `get_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_crypto_key_version - ## - # RPC-specific configuration for `get_public_key` - # @return [::Gapic::Config::Method] - # - attr_reader :get_public_key - ## - # RPC-specific configuration for `get_import_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_import_job - ## - # RPC-specific configuration for `get_retired_resource` - # @return [::Gapic::Config::Method] - # - attr_reader :get_retired_resource - ## - # RPC-specific configuration for `create_key_ring` - # @return [::Gapic::Config::Method] - # - attr_reader :create_key_ring - ## - # RPC-specific configuration for `create_crypto_key` - # @return [::Gapic::Config::Method] - # - attr_reader :create_crypto_key - ## - # RPC-specific configuration for `create_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :create_crypto_key_version - ## - # RPC-specific configuration for `delete_crypto_key` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_crypto_key - ## - # RPC-specific configuration for `delete_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_crypto_key_version - ## - # RPC-specific configuration for `import_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :import_crypto_key_version - ## - # RPC-specific configuration for `create_import_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_import_job - ## - # RPC-specific configuration for `update_crypto_key` - # @return [::Gapic::Config::Method] - # - attr_reader :update_crypto_key - ## - # RPC-specific configuration for `update_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :update_crypto_key_version - ## - # RPC-specific configuration for `update_crypto_key_primary_version` - # @return [::Gapic::Config::Method] - # - attr_reader :update_crypto_key_primary_version - ## - # RPC-specific configuration for `destroy_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :destroy_crypto_key_version - ## - # RPC-specific configuration for `restore_crypto_key_version` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_crypto_key_version - ## - # RPC-specific configuration for `encrypt` - # @return [::Gapic::Config::Method] - # - attr_reader :encrypt - ## - # RPC-specific configuration for `decrypt` - # @return [::Gapic::Config::Method] - # - attr_reader :decrypt - ## - # RPC-specific configuration for `raw_encrypt` - # @return [::Gapic::Config::Method] - # - attr_reader :raw_encrypt - ## - # RPC-specific configuration for `raw_decrypt` - # @return [::Gapic::Config::Method] - # - attr_reader :raw_decrypt - ## - # RPC-specific configuration for `asymmetric_sign` - # @return [::Gapic::Config::Method] - # - attr_reader :asymmetric_sign - ## - # RPC-specific configuration for `asymmetric_decrypt` - # @return [::Gapic::Config::Method] - # - attr_reader :asymmetric_decrypt - ## - # RPC-specific configuration for `mac_sign` - # @return [::Gapic::Config::Method] - # - attr_reader :mac_sign - ## - # RPC-specific configuration for `mac_verify` - # @return [::Gapic::Config::Method] - # - attr_reader :mac_verify - ## - # RPC-specific configuration for `decapsulate` - # @return [::Gapic::Config::Method] - # - attr_reader :decapsulate - ## - # RPC-specific configuration for `generate_random_bytes` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_random_bytes - - # @private - def initialize parent_rpcs = nil - list_key_rings_config = parent_rpcs.list_key_rings if parent_rpcs.respond_to? :list_key_rings - @list_key_rings = ::Gapic::Config::Method.new list_key_rings_config - list_crypto_keys_config = parent_rpcs.list_crypto_keys if parent_rpcs.respond_to? :list_crypto_keys - @list_crypto_keys = ::Gapic::Config::Method.new list_crypto_keys_config - list_crypto_key_versions_config = parent_rpcs.list_crypto_key_versions if parent_rpcs.respond_to? :list_crypto_key_versions - @list_crypto_key_versions = ::Gapic::Config::Method.new list_crypto_key_versions_config - list_import_jobs_config = parent_rpcs.list_import_jobs if parent_rpcs.respond_to? :list_import_jobs - @list_import_jobs = ::Gapic::Config::Method.new list_import_jobs_config - list_retired_resources_config = parent_rpcs.list_retired_resources if parent_rpcs.respond_to? :list_retired_resources - @list_retired_resources = ::Gapic::Config::Method.new list_retired_resources_config - get_key_ring_config = parent_rpcs.get_key_ring if parent_rpcs.respond_to? :get_key_ring - @get_key_ring = ::Gapic::Config::Method.new get_key_ring_config - get_crypto_key_config = parent_rpcs.get_crypto_key if parent_rpcs.respond_to? :get_crypto_key - @get_crypto_key = ::Gapic::Config::Method.new get_crypto_key_config - get_crypto_key_version_config = parent_rpcs.get_crypto_key_version if parent_rpcs.respond_to? :get_crypto_key_version - @get_crypto_key_version = ::Gapic::Config::Method.new get_crypto_key_version_config - get_public_key_config = parent_rpcs.get_public_key if parent_rpcs.respond_to? :get_public_key - @get_public_key = ::Gapic::Config::Method.new get_public_key_config - get_import_job_config = parent_rpcs.get_import_job if parent_rpcs.respond_to? :get_import_job - @get_import_job = ::Gapic::Config::Method.new get_import_job_config - get_retired_resource_config = parent_rpcs.get_retired_resource if parent_rpcs.respond_to? :get_retired_resource - @get_retired_resource = ::Gapic::Config::Method.new get_retired_resource_config - create_key_ring_config = parent_rpcs.create_key_ring if parent_rpcs.respond_to? :create_key_ring - @create_key_ring = ::Gapic::Config::Method.new create_key_ring_config - create_crypto_key_config = parent_rpcs.create_crypto_key if parent_rpcs.respond_to? :create_crypto_key - @create_crypto_key = ::Gapic::Config::Method.new create_crypto_key_config - create_crypto_key_version_config = parent_rpcs.create_crypto_key_version if parent_rpcs.respond_to? :create_crypto_key_version - @create_crypto_key_version = ::Gapic::Config::Method.new create_crypto_key_version_config - delete_crypto_key_config = parent_rpcs.delete_crypto_key if parent_rpcs.respond_to? :delete_crypto_key - @delete_crypto_key = ::Gapic::Config::Method.new delete_crypto_key_config - delete_crypto_key_version_config = parent_rpcs.delete_crypto_key_version if parent_rpcs.respond_to? :delete_crypto_key_version - @delete_crypto_key_version = ::Gapic::Config::Method.new delete_crypto_key_version_config - import_crypto_key_version_config = parent_rpcs.import_crypto_key_version if parent_rpcs.respond_to? :import_crypto_key_version - @import_crypto_key_version = ::Gapic::Config::Method.new import_crypto_key_version_config - create_import_job_config = parent_rpcs.create_import_job if parent_rpcs.respond_to? :create_import_job - @create_import_job = ::Gapic::Config::Method.new create_import_job_config - update_crypto_key_config = parent_rpcs.update_crypto_key if parent_rpcs.respond_to? :update_crypto_key - @update_crypto_key = ::Gapic::Config::Method.new update_crypto_key_config - update_crypto_key_version_config = parent_rpcs.update_crypto_key_version if parent_rpcs.respond_to? :update_crypto_key_version - @update_crypto_key_version = ::Gapic::Config::Method.new update_crypto_key_version_config - update_crypto_key_primary_version_config = parent_rpcs.update_crypto_key_primary_version if parent_rpcs.respond_to? :update_crypto_key_primary_version - @update_crypto_key_primary_version = ::Gapic::Config::Method.new update_crypto_key_primary_version_config - destroy_crypto_key_version_config = parent_rpcs.destroy_crypto_key_version if parent_rpcs.respond_to? :destroy_crypto_key_version - @destroy_crypto_key_version = ::Gapic::Config::Method.new destroy_crypto_key_version_config - restore_crypto_key_version_config = parent_rpcs.restore_crypto_key_version if parent_rpcs.respond_to? :restore_crypto_key_version - @restore_crypto_key_version = ::Gapic::Config::Method.new restore_crypto_key_version_config - encrypt_config = parent_rpcs.encrypt if parent_rpcs.respond_to? :encrypt - @encrypt = ::Gapic::Config::Method.new encrypt_config - decrypt_config = parent_rpcs.decrypt if parent_rpcs.respond_to? :decrypt - @decrypt = ::Gapic::Config::Method.new decrypt_config - raw_encrypt_config = parent_rpcs.raw_encrypt if parent_rpcs.respond_to? :raw_encrypt - @raw_encrypt = ::Gapic::Config::Method.new raw_encrypt_config - raw_decrypt_config = parent_rpcs.raw_decrypt if parent_rpcs.respond_to? :raw_decrypt - @raw_decrypt = ::Gapic::Config::Method.new raw_decrypt_config - asymmetric_sign_config = parent_rpcs.asymmetric_sign if parent_rpcs.respond_to? :asymmetric_sign - @asymmetric_sign = ::Gapic::Config::Method.new asymmetric_sign_config - asymmetric_decrypt_config = parent_rpcs.asymmetric_decrypt if parent_rpcs.respond_to? :asymmetric_decrypt - @asymmetric_decrypt = ::Gapic::Config::Method.new asymmetric_decrypt_config - mac_sign_config = parent_rpcs.mac_sign if parent_rpcs.respond_to? :mac_sign - @mac_sign = ::Gapic::Config::Method.new mac_sign_config - mac_verify_config = parent_rpcs.mac_verify if parent_rpcs.respond_to? :mac_verify - @mac_verify = ::Gapic::Config::Method.new mac_verify_config - decapsulate_config = parent_rpcs.decapsulate if parent_rpcs.respond_to? :decapsulate - @decapsulate = ::Gapic::Config::Method.new decapsulate_config - generate_random_bytes_config = parent_rpcs.generate_random_bytes if parent_rpcs.respond_to? :generate_random_bytes - @generate_random_bytes = ::Gapic::Config::Method.new generate_random_bytes_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb deleted file mode 100644 index ac7d160e574b..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb +++ /dev/null @@ -1,2114 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/kms/v1/service_pb" - -module Google - module Cloud - module Kms - module V1 - module KeyManagementService - module Rest - ## - # REST service stub for the KeyManagementService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_key_rings REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListKeyRingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ListKeyRingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ListKeyRingsResponse] - # A result object deserialized from the server's reply - def list_key_rings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_key_rings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_key_rings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ListKeyRingsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_crypto_keys REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListCryptoKeysRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ListCryptoKeysResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ListCryptoKeysResponse] - # A result object deserialized from the server's reply - def list_crypto_keys request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_crypto_keys_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_crypto_keys", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ListCryptoKeysResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_crypto_key_versions REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse] - # A result object deserialized from the server's reply - def list_crypto_key_versions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_crypto_key_versions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_crypto_key_versions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_import_jobs REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListImportJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ListImportJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ListImportJobsResponse] - # A result object deserialized from the server's reply - def list_import_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_import_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_import_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ListImportJobsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_retired_resources REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ListRetiredResourcesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ListRetiredResourcesResponse] - # A result object deserialized from the server's reply - def list_retired_resources request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_retired_resources_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_retired_resources", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_key_ring REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetKeyRingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::KeyRing] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::KeyRing] - # A result object deserialized from the server's reply - def get_key_ring request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_key_ring_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_key_ring", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::KeyRing.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_crypto_key REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetCryptoKeyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # A result object deserialized from the server's reply - def get_crypto_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_crypto_key_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_crypto_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::CryptoKey.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # A result object deserialized from the server's reply - def get_crypto_key_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_crypto_key_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_crypto_key_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_public_key REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetPublicKeyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::PublicKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::PublicKey] - # A result object deserialized from the server's reply - def get_public_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_public_key_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_public_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::PublicKey.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_import_job REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetImportJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ImportJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ImportJob] - # A result object deserialized from the server's reply - def get_import_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_import_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_import_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ImportJob.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_retired_resource REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetRetiredResourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::RetiredResource] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::RetiredResource] - # A result object deserialized from the server's reply - def get_retired_resource request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_retired_resource_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_retired_resource", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::RetiredResource.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_key_ring REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateKeyRingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::KeyRing] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::KeyRing] - # A result object deserialized from the server's reply - def create_key_ring request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_key_ring_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_key_ring", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::KeyRing.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_crypto_key REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateCryptoKeyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # A result object deserialized from the server's reply - def create_crypto_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_crypto_key_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_crypto_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::CryptoKey.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # A result object deserialized from the server's reply - def create_crypto_key_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_crypto_key_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_crypto_key_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_crypto_key REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_crypto_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_crypto_key_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_crypto_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_crypto_key_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_crypto_key_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_crypto_key_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the import_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # A result object deserialized from the server's reply - def import_crypto_key_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_crypto_key_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "import_crypto_key_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_import_job REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateImportJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::ImportJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::ImportJob] - # A result object deserialized from the server's reply - def create_import_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_import_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_import_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::ImportJob.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_crypto_key REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # A result object deserialized from the server's reply - def update_crypto_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_crypto_key_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_crypto_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::CryptoKey.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # A result object deserialized from the server's reply - def update_crypto_key_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_crypto_key_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_crypto_key_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_crypto_key_primary_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # A result object deserialized from the server's reply - def update_crypto_key_primary_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_crypto_key_primary_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_crypto_key_primary_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::CryptoKey.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the destroy_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # A result object deserialized from the server's reply - def destroy_crypto_key_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_destroy_crypto_key_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "destroy_crypto_key_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the restore_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # A result object deserialized from the server's reply - def restore_crypto_key_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_restore_crypto_key_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "restore_crypto_key_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the encrypt REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::EncryptRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::EncryptResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::EncryptResponse] - # A result object deserialized from the server's reply - def encrypt request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_encrypt_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "encrypt", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::EncryptResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the decrypt REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DecryptRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::DecryptResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::DecryptResponse] - # A result object deserialized from the server's reply - def decrypt request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_decrypt_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "decrypt", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::DecryptResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the raw_encrypt REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::RawEncryptRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::RawEncryptResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::RawEncryptResponse] - # A result object deserialized from the server's reply - def raw_encrypt request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_raw_encrypt_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "raw_encrypt", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::RawEncryptResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the raw_decrypt REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::RawDecryptRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::RawDecryptResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::RawDecryptResponse] - # A result object deserialized from the server's reply - def raw_decrypt request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_raw_decrypt_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "raw_decrypt", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::RawDecryptResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the asymmetric_sign REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::AsymmetricSignRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::AsymmetricSignResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::AsymmetricSignResponse] - # A result object deserialized from the server's reply - def asymmetric_sign request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_asymmetric_sign_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "asymmetric_sign", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::AsymmetricSignResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the asymmetric_decrypt REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::AsymmetricDecryptRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse] - # A result object deserialized from the server's reply - def asymmetric_decrypt request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_asymmetric_decrypt_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "asymmetric_decrypt", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the mac_sign REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::MacSignRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::MacSignResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::MacSignResponse] - # A result object deserialized from the server's reply - def mac_sign request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_mac_sign_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "mac_sign", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::MacSignResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the mac_verify REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::MacVerifyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::MacVerifyResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::MacVerifyResponse] - # A result object deserialized from the server's reply - def mac_verify request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_mac_verify_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "mac_verify", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::MacVerifyResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the decapsulate REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DecapsulateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::DecapsulateResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::DecapsulateResponse] - # A result object deserialized from the server's reply - def decapsulate request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_decapsulate_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "decapsulate", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::DecapsulateResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the generate_random_bytes REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GenerateRandomBytesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse] - # A result object deserialized from the server's reply - def generate_random_bytes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_random_bytes_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "generate_random_bytes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_key_rings REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListKeyRingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_key_rings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/keyRings", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_crypto_keys REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListCryptoKeysRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_crypto_keys_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/cryptoKeys", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_crypto_key_versions REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_crypto_key_versions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/cryptoKeyVersions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_import_jobs REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListImportJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_import_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/importJobs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_retired_resources REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ListRetiredResourcesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_retired_resources_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/retiredResources", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_key_ring REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetKeyRingRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_key_ring_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_crypto_key REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetCryptoKeyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_crypto_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_crypto_key_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_public_key REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetPublicKeyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_public_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/publicKey", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_import_job REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetImportJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_import_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/importJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_retired_resource REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GetRetiredResourceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_retired_resource_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/retiredResources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_key_ring REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateKeyRingRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_key_ring_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/keyRings", - body: "key_ring", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_crypto_key REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateCryptoKeyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_crypto_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/cryptoKeys", - body: "crypto_key", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_crypto_key_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/cryptoKeyVersions", - body: "crypto_key_version", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_crypto_key REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_crypto_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_crypto_key_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_crypto_key_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/cryptoKeyVersions:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_import_job REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::CreateImportJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_import_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/importJobs", - body: "import_job", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_crypto_key REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_crypto_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{crypto_key.name}", - body: "crypto_key", - matches: [ - ["crypto_key.name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_crypto_key_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{crypto_key_version.name}", - body: "crypto_key_version", - matches: [ - ["crypto_key_version.name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_crypto_key_primary_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_crypto_key_primary_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:updatePrimaryVersion", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the destroy_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_destroy_crypto_key_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:destroy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the restore_crypto_key_version REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_restore_crypto_key_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:restore", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the encrypt REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::EncryptRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_encrypt_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:encrypt", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the decrypt REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DecryptRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_decrypt_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:decrypt", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the raw_encrypt REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::RawEncryptRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_raw_encrypt_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:rawEncrypt", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the raw_decrypt REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::RawDecryptRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_raw_decrypt_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:rawDecrypt", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the asymmetric_sign REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::AsymmetricSignRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_asymmetric_sign_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:asymmetricSign", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the asymmetric_decrypt REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::AsymmetricDecryptRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_asymmetric_decrypt_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:asymmetricDecrypt", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the mac_sign REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::MacSignRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_mac_sign_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:macSign", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the mac_verify REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::MacVerifyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_mac_verify_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:macVerify", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the decapsulate REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::DecapsulateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_decapsulate_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:decapsulate", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_random_bytes REST call - # - # @param request_pb [::Google::Cloud::Kms::V1::GenerateRandomBytesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_generate_random_bytes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{location}:generateRandomBytes", - body: "*", - matches: [ - ["location", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb deleted file mode 100644 index 3321840e9771..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/kms/v1/resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' - - -descriptor_data = "\n#google/cloud/kms/v1/resources.proto\x12\x13google.cloud.kms.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xb5\x01\n\x07KeyRing\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:a\xea\x41^\n\x1f\x63loudkms.googleapis.com/KeyRing\x12;projects/{project}/locations/{location}/keyRings/{key_ring}\"\xa8\x08\n\tCryptoKey\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12;\n\x07primary\x18\x02 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x03\x12\x45\n\x07purpose\x18\x03 \x01(\x0e\x32/.google.cloud.kms.v1.CryptoKey.CryptoKeyPurposeB\x03\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\x12next_rotation_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x0frotation_period\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12G\n\x10version_template\x18\x0b \x01(\x0b\x32-.google.cloud.kms.v1.CryptoKeyVersionTemplate\x12:\n\x06labels\x18\n \x03(\x0b\x32*.google.cloud.kms.v1.CryptoKey.LabelsEntry\x12\x18\n\x0bimport_only\x18\r \x01(\x08\x42\x03\xe0\x41\x05\x12\x42\n\x1a\x64\x65stroy_scheduled_duration\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x05\x12%\n\x12\x63rypto_key_backend\x18\x0f \x01(\tB\t\xe0\x41\x05\xfa\x41\x03\n\x01*\x12\x61\n key_access_justifications_policy\x18\x11 \x01(\x0b\x32\x32.google.cloud.kms.v1.KeyAccessJustificationsPolicyB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb1\x01\n\x10\x43ryptoKeyPurpose\x12\"\n\x1e\x43RYPTO_KEY_PURPOSE_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x45NCRYPT_DECRYPT\x10\x01\x12\x13\n\x0f\x41SYMMETRIC_SIGN\x10\x05\x12\x16\n\x12\x41SYMMETRIC_DECRYPT\x10\x06\x12\x17\n\x13RAW_ENCRYPT_DECRYPT\x10\x07\x12\x07\n\x03MAC\x10\t\x12\x15\n\x11KEY_ENCAPSULATION\x10\n:{\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}B\x13\n\x11rotation_schedule\"\xb3\x01\n\x18\x43ryptoKeyVersionTemplate\x12>\n\x10protection_level\x18\x01 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12W\n\talgorithm\x18\x03 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x02\"\xb1\x03\n\x17KeyOperationAttestation\x12S\n\x06\x66ormat\x18\x04 \x01(\x0e\x32>.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormatB\x03\xe0\x41\x03\x12\x14\n\x07\x63ontent\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x03\x12X\n\x0b\x63\x65rt_chains\x18\x06 \x01(\x0b\x32>.google.cloud.kms.v1.KeyOperationAttestation.CertificateChainsB\x03\xe0\x41\x03\x1a\x64\n\x11\x43\x65rtificateChains\x12\x14\n\x0c\x63\x61vium_certs\x18\x01 \x03(\t\x12\x19\n\x11google_card_certs\x18\x02 \x03(\t\x12\x1e\n\x16google_partition_certs\x18\x03 \x03(\t\"k\n\x11\x41ttestationFormat\x12\"\n\x1e\x41TTESTATION_FORMAT_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43\x41VIUM_V1_COMPRESSED\x10\x03\x12\x18\n\x14\x43\x41VIUM_V2_COMPRESSED\x10\x04\"\xe7\x13\n\x10\x43ryptoKeyVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12J\n\x05state\x18\x03 \x01(\x0e\x32;.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState\x12\x43\n\x10protection_level\x18\x07 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x03\xe0\x41\x03\x12W\n\talgorithm\x18\n \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x03\x12\x46\n\x0b\x61ttestation\x18\x08 \x01(\x0b\x32,.google.cloud.kms.v1.KeyOperationAttestationB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rgenerate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12;\n\x12\x64\x65stroy_event_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x17\n\nimport_job\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0bimport_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x15import_failure_reason\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12&\n\x19generation_failure_reason\x18\x13 \x01(\tB\x03\xe0\x41\x03\x12\x30\n#external_destruction_failure_reason\x18\x14 \x01(\tB\x03\xe0\x41\x03\x12^\n!external_protection_level_options\x18\x11 \x01(\x0b\x32\x33.google.cloud.kms.v1.ExternalProtectionLevelOptions\x12\x1e\n\x11reimport_eligible\x18\x12 \x01(\x08\x42\x03\xe0\x41\x03\"\xc8\x08\n\x19\x43ryptoKeyVersionAlgorithm\x12,\n(CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED\x10\x00\x12\x1f\n\x1bGOOGLE_SYMMETRIC_ENCRYPTION\x10\x01\x12\x0f\n\x0b\x41\x45S_128_GCM\x10)\x12\x0f\n\x0b\x41\x45S_256_GCM\x10\x13\x12\x0f\n\x0b\x41\x45S_128_CBC\x10*\x12\x0f\n\x0b\x41\x45S_256_CBC\x10+\x12\x0f\n\x0b\x41\x45S_128_CTR\x10,\x12\x0f\n\x0b\x41\x45S_256_CTR\x10-\x12\x1c\n\x18RSA_SIGN_PSS_2048_SHA256\x10\x02\x12\x1c\n\x18RSA_SIGN_PSS_3072_SHA256\x10\x03\x12\x1c\n\x18RSA_SIGN_PSS_4096_SHA256\x10\x04\x12\x1c\n\x18RSA_SIGN_PSS_4096_SHA512\x10\x0f\x12\x1e\n\x1aRSA_SIGN_PKCS1_2048_SHA256\x10\x05\x12\x1e\n\x1aRSA_SIGN_PKCS1_3072_SHA256\x10\x06\x12\x1e\n\x1aRSA_SIGN_PKCS1_4096_SHA256\x10\x07\x12\x1e\n\x1aRSA_SIGN_PKCS1_4096_SHA512\x10\x10\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_2048\x10\x1c\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_3072\x10\x1d\x12\x1b\n\x17RSA_SIGN_RAW_PKCS1_4096\x10\x1e\x12 \n\x1cRSA_DECRYPT_OAEP_2048_SHA256\x10\x08\x12 \n\x1cRSA_DECRYPT_OAEP_3072_SHA256\x10\t\x12 \n\x1cRSA_DECRYPT_OAEP_4096_SHA256\x10\n\x12 \n\x1cRSA_DECRYPT_OAEP_4096_SHA512\x10\x11\x12\x1e\n\x1aRSA_DECRYPT_OAEP_2048_SHA1\x10%\x12\x1e\n\x1aRSA_DECRYPT_OAEP_3072_SHA1\x10&\x12\x1e\n\x1aRSA_DECRYPT_OAEP_4096_SHA1\x10\'\x12\x17\n\x13\x45\x43_SIGN_P256_SHA256\x10\x0c\x12\x17\n\x13\x45\x43_SIGN_P384_SHA384\x10\r\x12\x1c\n\x18\x45\x43_SIGN_SECP256K1_SHA256\x10\x1f\x12\x13\n\x0f\x45\x43_SIGN_ED25519\x10(\x12\x0f\n\x0bHMAC_SHA256\x10 \x12\r\n\tHMAC_SHA1\x10!\x12\x0f\n\x0bHMAC_SHA384\x10\"\x12\x0f\n\x0bHMAC_SHA512\x10#\x12\x0f\n\x0bHMAC_SHA224\x10$\x12!\n\x1d\x45XTERNAL_SYMMETRIC_ENCRYPTION\x10\x12\x12\x0e\n\nML_KEM_768\x10/\x12\x0f\n\x0bML_KEM_1024\x10\x30\x12\r\n\tKEM_XWING\x10?\x12\x15\n\x11PQ_SIGN_ML_DSA_65\x10\x38\x12\x1d\n\x19PQ_SIGN_SLH_DSA_SHA2_128S\x10\x39\"\x9b\x02\n\x15\x43ryptoKeyVersionState\x12(\n$CRYPTO_KEY_VERSION_STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12PENDING_GENERATION\x10\x05\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03\x12\x15\n\x11\x44\x45STROY_SCHEDULED\x10\x04\x12\x12\n\x0ePENDING_IMPORT\x10\x06\x12\x11\n\rIMPORT_FAILED\x10\x07\x12\x15\n\x11GENERATION_FAILED\x10\x08\x12 \n\x1cPENDING_EXTERNAL_DESTRUCTION\x10\t\x12\x1f\n\x1b\x45XTERNAL_DESTRUCTION_FAILED\x10\n\"I\n\x14\x43ryptoKeyVersionView\x12\'\n#CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46ULL\x10\x01:\xaa\x01\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}\"U\n\x0f\x43hecksummedData\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x34\n\x0f\x63rc32c_checksum\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"\x8c\x05\n\tPublicKey\x12\x0b\n\x03pem\x18\x01 \x01(\t\x12R\n\talgorithm\x18\x02 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm\x12/\n\npem_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x0c\n\x04name\x18\x04 \x01(\t\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12I\n\x11public_key_format\x18\x07 \x01(\x0e\x32..google.cloud.kms.v1.PublicKey.PublicKeyFormat\x12\x38\n\npublic_key\x18\x08 \x01(\x0b\x32$.google.cloud.kms.v1.ChecksummedData\"i\n\x0fPublicKeyFormat\x12!\n\x1dPUBLIC_KEY_FORMAT_UNSPECIFIED\x10\x00\x12\x07\n\x03PEM\x10\x01\x12\x07\n\x03\x44\x45R\x10\x02\x12\x0c\n\x08NIST_PQC\x10\x03\x12\x13\n\x0fXWING_RAW_BYTES\x10\x04:\xae\x01\xea\x41\xaa\x01\n!cloudkms.googleapis.com/PublicKey\x12\x84\x01projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}/publicKey\"\xfb\x08\n\tImportJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12J\n\rimport_method\x18\x02 \x01(\x0e\x32+.google.cloud.kms.v1.ImportJob.ImportMethodB\x06\xe0\x41\x02\xe0\x41\x05\x12\x46\n\x10protection_level\x18\t \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x06\xe0\x41\x02\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rgenerate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12:\n\x11\x65xpire_event_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x05state\x18\x06 \x01(\x0e\x32-.google.cloud.kms.v1.ImportJob.ImportJobStateB\x03\xe0\x41\x03\x12I\n\npublic_key\x18\x07 \x01(\x0b\x32\x30.google.cloud.kms.v1.ImportJob.WrappingPublicKeyB\x03\xe0\x41\x03\x12\x46\n\x0b\x61ttestation\x18\x08 \x01(\x0b\x32,.google.cloud.kms.v1.KeyOperationAttestationB\x03\xe0\x41\x03\x12%\n\x12\x63rypto_key_backend\x18\x0b \x01(\tB\t\xe0\x41\x05\xfa\x41\x03\n\x01*\x1a \n\x11WrappingPublicKey\x12\x0b\n\x03pem\x18\x01 \x01(\t\"\xe5\x01\n\x0cImportMethod\x12\x1d\n\x19IMPORT_METHOD_UNSPECIFIED\x10\x00\x12\x1e\n\x1aRSA_OAEP_3072_SHA1_AES_256\x10\x01\x12\x1e\n\x1aRSA_OAEP_4096_SHA1_AES_256\x10\x02\x12 \n\x1cRSA_OAEP_3072_SHA256_AES_256\x10\x03\x12 \n\x1cRSA_OAEP_4096_SHA256_AES_256\x10\x04\x12\x18\n\x14RSA_OAEP_3072_SHA256\x10\x05\x12\x18\n\x14RSA_OAEP_4096_SHA256\x10\x06\"c\n\x0eImportJobState\x12 \n\x1cIMPORT_JOB_STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12PENDING_GENERATION\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x45XPIRED\x10\x03:{\xea\x41x\n!cloudkms.googleapis.com/ImportJob\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}\"[\n\x1e\x45xternalProtectionLevelOptions\x12\x18\n\x10\x65xternal_key_uri\x18\x01 \x01(\t\x12\x1f\n\x17\x65km_connection_key_path\x18\x02 \x01(\t\"b\n\x1dKeyAccessJustificationsPolicy\x12\x41\n\x16\x61llowed_access_reasons\x18\x01 \x03(\x0e\x32!.google.cloud.kms.v1.AccessReason\"\xb9\x02\n\x0fRetiredResource\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x1e\n\x11original_resource\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rresource_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\x9d\x01\xea\x41\x99\x01\n\'cloudkms.googleapis.com/RetiredResource\x12Kprojects/{project}/locations/{location}/retiredResources/{retired_resource}*\x10retiredResources2\x0fretiredResource*\x81\x01\n\x0fProtectionLevel\x12 \n\x1cPROTECTION_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08SOFTWARE\x10\x01\x12\x07\n\x03HSM\x10\x02\x12\x0c\n\x08\x45XTERNAL\x10\x03\x12\x10\n\x0c\x45XTERNAL_VPC\x10\x04\x12\x15\n\x11HSM_SINGLE_TENANT\x10\x05*\xb3\x03\n\x0c\x41\x63\x63\x65ssReason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x43USTOMER_INITIATED_SUPPORT\x10\x01\x12\x1c\n\x18GOOGLE_INITIATED_SERVICE\x10\x02\x12\x1c\n\x18THIRD_PARTY_DATA_REQUEST\x10\x03\x12\x1b\n\x17GOOGLE_INITIATED_REVIEW\x10\x04\x12\x1d\n\x19\x43USTOMER_INITIATED_ACCESS\x10\x05\x12%\n!GOOGLE_INITIATED_SYSTEM_OPERATION\x10\x06\x12\x17\n\x13REASON_NOT_EXPECTED\x10\x07\x12*\n\"MODIFIED_CUSTOMER_INITIATED_ACCESS\x10\x08\x1a\x02\x08\x01\x12\x32\n*MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION\x10\t\x1a\x02\x08\x01\x12\'\n#GOOGLE_RESPONSE_TO_PRODUCTION_ALERT\x10\n\x12*\n&CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING\x10\x0b\x42\x85\x01\n\x17\x63om.google.cloud.kms.v1B\x11KmsResourcesProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.protobuf.Int64Value", "google/protobuf/wrappers.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Kms - module V1 - KeyRing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyRing").msgclass - CryptoKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKey").msgclass - CryptoKey::CryptoKeyPurpose = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose").enummodule - CryptoKeyVersionTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKeyVersionTemplate").msgclass - KeyOperationAttestation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyOperationAttestation").msgclass - KeyOperationAttestation::CertificateChains = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyOperationAttestation.CertificateChains").msgclass - KeyOperationAttestation::AttestationFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat").enummodule - CryptoKeyVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKeyVersion").msgclass - CryptoKeyVersion::CryptoKeyVersionAlgorithm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm").enummodule - CryptoKeyVersion::CryptoKeyVersionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState").enummodule - CryptoKeyVersion::CryptoKeyVersionView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView").enummodule - ChecksummedData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ChecksummedData").msgclass - PublicKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.PublicKey").msgclass - PublicKey::PublicKeyFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.PublicKey.PublicKeyFormat").enummodule - ImportJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportJob").msgclass - ImportJob::WrappingPublicKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportJob.WrappingPublicKey").msgclass - ImportJob::ImportMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportJob.ImportMethod").enummodule - ImportJob::ImportJobState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportJob.ImportJobState").enummodule - ExternalProtectionLevelOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ExternalProtectionLevelOptions").msgclass - KeyAccessJustificationsPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.KeyAccessJustificationsPolicy").msgclass - RetiredResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RetiredResource").msgclass - ProtectionLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ProtectionLevel").enummodule - AccessReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AccessReason").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/rest.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/rest.rb deleted file mode 100644 index 37c974835abb..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/rest.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/kms/v1/autokey/rest" -require "google/cloud/kms/v1/autokey_admin/rest" -require "google/cloud/kms/v1/ekm_service/rest" -require "google/cloud/kms/v1/hsm_management/rest" -require "google/cloud/kms/v1/key_management_service/rest" -require "google/cloud/kms/v1/bindings_override" -require "google/cloud/kms/v1/version" - -module Google - module Cloud - module Kms - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/kms/v1/rest" - # client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb deleted file mode 100644 index 688dad631edd..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_pb.rb +++ /dev/null @@ -1,106 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/kms/v1/service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/kms/v1/resources_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/wrappers_pb' - - -descriptor_data = "\n!google/cloud/kms/v1/service.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/kms/v1/resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xad\x01\n\x13ListKeyRingsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xff\x01\n\x15ListCryptoKeysRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12P\n\x0cversion_view\x18\x04 \x01(\x0e\x32:.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"\x80\x02\n\x1cListCryptoKeyVersionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12H\n\x04view\x18\x04 \x01(\x0e\x32:.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\"\xad\x01\n\x15ListImportJobsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x8f\x01\n\x1bListRetiredResourcesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'cloudkms.googleapis.com/RetiredResource\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"t\n\x14ListKeyRingsResponse\x12/\n\tkey_rings\x18\x01 \x03(\x0b\x32\x1c.google.cloud.kms.v1.KeyRing\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"z\n\x16ListCryptoKeysResponse\x12\x33\n\x0b\x63rypto_keys\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKey\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x90\x01\n\x1dListCryptoKeyVersionsResponse\x12\x42\n\x13\x63rypto_key_versions\x18\x01 \x03(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"z\n\x16ListImportJobsResponse\x12\x33\n\x0bimport_jobs\x18\x01 \x03(\x0b\x32\x1e.google.cloud.kms.v1.ImportJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x8c\x01\n\x1cListRetiredResourcesResponse\x12?\n\x11retired_resources\x18\x01 \x03(\x0b\x32$.google.cloud.kms.v1.RetiredResource\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x03\"J\n\x11GetKeyRingRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\"N\n\x13GetCryptoKeyRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\\\n\x1aGetCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\xa5\x01\n\x13GetPublicKeyRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12N\n\x11public_key_format\x18\x02 \x01(\x0e\x32..google.cloud.kms.v1.PublicKey.PublicKeyFormatB\x03\xe0\x41\x01\"N\n\x13GetImportJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/ImportJob\"Z\n\x19GetRetiredResourceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'cloudkms.googleapis.com/RetiredResource\"\xa0\x01\n\x14\x43reateKeyRingRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x18\n\x0bkey_ring_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x08key_ring\x18\x03 \x01(\x0b\x32\x1c.google.cloud.kms.v1.KeyRingB\x03\xe0\x41\x02\"\xcd\x01\n\x16\x43reateCryptoKeyRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x1a\n\rcrypto_key_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\ncrypto_key\x18\x03 \x01(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKeyB\x03\xe0\x41\x02\x12%\n\x1dskip_initial_version_creation\x18\x05 \x01(\x08\"\xa2\x01\n\x1d\x43reateCryptoKeyVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x46\n\x12\x63rypto_key_version\x18\x02 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x02\"Q\n\x16\x44\x65leteCryptoKeyRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"_\n\x1d\x44\x65leteCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\xf0\x02\n\x1dImportCryptoKeyVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12L\n\x12\x63rypto_key_version\x18\x06 \x01(\tB0\xe0\x41\x01\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12W\n\talgorithm\x18\x02 \x01(\x0e\x32?.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithmB\x03\xe0\x41\x02\x12\x17\n\nimport_job\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0bwrapped_key\x18\x08 \x01(\x0c\x42\x03\xe0\x41\x01\x12\"\n\x13rsa_aes_wrapped_key\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x01H\x00\x42\x16\n\x14wrapped_key_material\"\xa6\x01\n\x16\x43reateImportJobRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudkms.googleapis.com/KeyRing\x12\x1a\n\rimport_job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\nimport_job\x18\x03 \x01(\x0b\x32\x1e.google.cloud.kms.v1.ImportJobB\x03\xe0\x41\x02\"\x87\x01\n\x16UpdateCryptoKeyRequest\x12\x37\n\ncrypto_key\x18\x01 \x01(\x0b\x32\x1e.google.cloud.kms.v1.CryptoKeyB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x9d\x01\n\x1dUpdateCryptoKeyVersionRequest\x12\x46\n\x12\x63rypto_key_version\x18\x01 \x01(\x0b\x32%.google.cloud.kms.v1.CryptoKeyVersionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x83\x01\n$UpdateCryptoKeyPrimaryVersionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\"\n\x15\x63rypto_key_version_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"`\n\x1e\x44\x65stroyCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"`\n\x1eRestoreCryptoKeyVersionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\xf9\x01\n\x0e\x45ncryptRequest\x12\x17\n\x04name\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x16\n\tplaintext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12:\n\x10plaintext_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x08 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x9b\x02\n\x0e\x44\x65\x63ryptRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12;\n\x11\x63iphertext_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x06 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xe2\x02\n\x11RawEncryptRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tplaintext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12:\n\x10plaintext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\"\n\x15initialization_vector\x18\x06 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x46\n\x1cinitialization_vector_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xf8\x02\n\x11RawDecryptRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12*\n\x1d\x61\x64\x64itional_authenticated_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\x12\"\n\x15initialization_vector\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x12\n\ntag_length\x18\x05 \x01(\x05\x12;\n\x11\x63iphertext_crc32c\x18\x06 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12N\n$additional_authenticated_data_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x46\n\x1cinitialization_vector_crc32c\x18\x08 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x8c\x02\n\x15\x41symmetricSignRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x30\n\x06\x64igest\x18\x03 \x01(\x0b\x32\x1b.google.cloud.kms.v1.DigestB\x03\xe0\x41\x01\x12\x37\n\rdigest_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x11\n\x04\x64\x61ta\x18\x06 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xb0\x01\n\x18\x41symmetricDecryptRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x17\n\nciphertext\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x02\x12;\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x9a\x01\n\x0eMacSignRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xe4\x01\n\x10MacVerifyRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x35\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x12\x10\n\x03mac\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x34\n\nmac_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\xaa\x01\n\x12\x44\x65\x63\x61psulateRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x17\n\nciphertext\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12;\n\x11\x63iphertext_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\"\x84\x01\n\x1aGenerateRandomBytesRequest\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x14\n\x0clength_bytes\x18\x02 \x01(\x05\x12>\n\x10protection_level\x18\x03 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\x85\x02\n\x0f\x45ncryptResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nciphertext\x18\x02 \x01(\x0c\x12\x36\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12!\n\x19verified_plaintext_crc32c\x18\x05 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x06 \x01(\x08\x12>\n\x10protection_level\x18\x07 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xb1\x01\n\x0f\x44\x65\x63ryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x14\n\x0cused_primary\x18\x03 \x01(\x08\x12>\n\x10protection_level\x18\x04 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xad\x03\n\x12RawEncryptResponse\x12\x12\n\nciphertext\x18\x01 \x01(\x0c\x12\x1d\n\x15initialization_vector\x18\x02 \x01(\x0c\x12\x12\n\ntag_length\x18\x03 \x01(\x05\x12\x36\n\x11\x63iphertext_crc32c\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x41\n\x1cinitialization_vector_crc32c\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12!\n\x19verified_plaintext_crc32c\x18\x06 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x07 \x01(\x08\x12-\n%verified_initialization_vector_crc32c\x18\n \x01(\x08\x12\x0c\n\x04name\x18\x08 \x01(\t\x12>\n\x10protection_level\x18\t \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xa8\x02\n\x12RawDecryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12>\n\x10protection_level\x18\x03 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\x12\"\n\x1averified_ciphertext_crc32c\x18\x04 \x01(\x08\x12\x35\n-verified_additional_authenticated_data_crc32c\x18\x05 \x01(\x08\x12-\n%verified_initialization_vector_crc32c\x18\x06 \x01(\x08\"\xee\x01\n\x16\x41symmetricSignResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\x35\n\x10signature_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x1e\n\x16verified_digest_crc32c\x18\x03 \x01(\x08\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x1c\n\x14verified_data_crc32c\x18\x05 \x01(\x08\x12>\n\x10protection_level\x18\x06 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xc9\x01\n\x19\x41symmetricDecryptResponse\x12\x11\n\tplaintext\x18\x01 \x01(\x0c\x12\x35\n\x10plaintext_crc32c\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\"\n\x1averified_ciphertext_crc32c\x18\x03 \x01(\x08\x12>\n\x10protection_level\x18\x04 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xbb\x01\n\x0fMacSignResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03mac\x18\x02 \x01(\x0c\x12/\n\nmac_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x1c\n\x14verified_data_crc32c\x18\x04 \x01(\x08\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xd1\x01\n\x11MacVerifyResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x1c\n\x14verified_data_crc32c\x18\x03 \x01(\x08\x12\x1b\n\x13verified_mac_crc32c\x18\x04 \x01(\x08\x12\"\n\x1averified_success_integrity\x18\x05 \x01(\x08\x12>\n\x10protection_level\x18\x06 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevel\"\xda\x01\n\x13\x44\x65\x63\x61psulateResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rshared_secret\x18\x02 \x01(\x0c\x12!\n\x14shared_secret_crc32c\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12\"\n\x1averified_ciphertext_crc32c\x18\x04 \x01(\x08\x12>\n\x10protection_level\x18\x05 \x01(\x0e\x32$.google.cloud.kms.v1.ProtectionLevelB\x17\n\x15_shared_secret_crc32c\"]\n\x1bGenerateRandomBytesResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x30\n\x0b\x64\x61ta_crc32c\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"H\n\x06\x44igest\x12\x10\n\x06sha256\x18\x01 \x01(\x0cH\x00\x12\x10\n\x06sha384\x18\x02 \x01(\x0cH\x00\x12\x10\n\x06sha512\x18\x03 \x01(\x0cH\x00\x42\x08\n\x06\x64igest\"e\n\x10LocationMetadata\x12\x15\n\rhsm_available\x18\x01 \x01(\x08\x12\x15\n\rekm_available\x18\x02 \x01(\x08\x12#\n\x1bhsm_single_tenant_available\x18\x03 \x01(\x08\"d\n\x17\x44\x65leteCryptoKeyMetadata\x12I\n\x10retired_resource\x18\x01 \x01(\tB/\xe0\x41\x03\xfa\x41)\n\'cloudkms.googleapis.com/RetiredResource\" \n\x1e\x44\x65leteCryptoKeyVersionMetadata2\xb4\x36\n\x14KeyManagementService\x12\xa2\x01\n\x0cListKeyRings\x12(.google.cloud.kms.v1.ListKeyRingsRequest\x1a).google.cloud.kms.v1.ListKeyRingsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/keyRings\x12\xb5\x01\n\x0eListCryptoKeys\x12*.google.cloud.kms.v1.ListCryptoKeysRequest\x1a+.google.cloud.kms.v1.ListCryptoKeysResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys\x12\xde\x01\n\x15ListCryptoKeyVersions\x12\x31.google.cloud.kms.v1.ListCryptoKeyVersionsRequest\x1a\x32.google.cloud.kms.v1.ListCryptoKeyVersionsResponse\"^\xda\x41\x06parent\x82\xd3\xe4\x93\x02O\x12M/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions\x12\xb5\x01\n\x0eListImportJobs\x12*.google.cloud.kms.v1.ListImportJobsRequest\x1a+.google.cloud.kms.v1.ListImportJobsResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs\x12\xc2\x01\n\x14ListRetiredResources\x12\x30.google.cloud.kms.v1.ListRetiredResourcesRequest\x1a\x31.google.cloud.kms.v1.ListRetiredResourcesResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/retiredResources\x12\x8f\x01\n\nGetKeyRing\x12&.google.cloud.kms.v1.GetKeyRingRequest\x1a\x1c.google.cloud.kms.v1.KeyRing\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/keyRings/*}\x12\xa2\x01\n\x0cGetCryptoKey\x12(.google.cloud.kms.v1.GetCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}\x12\xcb\x01\n\x13GetCryptoKeyVersion\x12/.google.cloud.kms.v1.GetCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\\\xda\x41\x04name\x82\xd3\xe4\x93\x02O\x12M/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}\x12\xc0\x01\n\x0cGetPublicKey\x12(.google.cloud.kms.v1.GetPublicKeyRequest\x1a\x1e.google.cloud.kms.v1.PublicKey\"f\xda\x41\x04name\x82\xd3\xe4\x93\x02Y\x12W/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}/publicKey\x12\xa2\x01\n\x0cGetImportJob\x12(.google.cloud.kms.v1.GetImportJobRequest\x1a\x1e.google.cloud.kms.v1.ImportJob\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/keyRings/*/importJobs/*}\x12\xaf\x01\n\x12GetRetiredResource\x12..google.cloud.kms.v1.GetRetiredResourceRequest\x1a$.google.cloud.kms.v1.RetiredResource\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/retiredResources/*}\x12\xb6\x01\n\rCreateKeyRing\x12).google.cloud.kms.v1.CreateKeyRingRequest\x1a\x1c.google.cloud.kms.v1.KeyRing\"\\\xda\x41\x1bparent,key_ring_id,key_ring\x82\xd3\xe4\x93\x02\x38\",/v1/{parent=projects/*/locations/*}/keyRings:\x08key_ring\x12\xcf\x01\n\x0f\x43reateCryptoKey\x12+.google.cloud.kms.v1.CreateCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"o\xda\x41\x1fparent,crypto_key_id,crypto_key\x82\xd3\xe4\x93\x02G\"9/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys:\ncrypto_key\x12\xfb\x01\n\x16\x43reateCryptoKeyVersion\x12\x32.google.cloud.kms.v1.CreateCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\x85\x01\xda\x41\x19parent,crypto_key_version\x82\xd3\xe4\x93\x02\x63\"M/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:\x12\x63rypto_key_version\x12\xda\x01\n\x0f\x44\x65leteCryptoKey\x12+.google.cloud.kms.v1.DeleteCryptoKeyRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteCryptoKeyMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}\x12\x84\x02\n\x16\x44\x65leteCryptoKeyVersion\x12\x32.google.cloud.kms.v1.DeleteCryptoKeyVersionRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41\x37\n\x15google.protobuf.Empty\x12\x1e\x44\x65leteCryptoKeyVersionMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02O*M/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}\x12\xd4\x01\n\x16ImportCryptoKeyVersion\x12\x32.google.cloud.kms.v1.ImportCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"_\x82\xd3\xe4\x93\x02Y\"T/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:import:\x01*\x12\xcf\x01\n\x0f\x43reateImportJob\x12+.google.cloud.kms.v1.CreateImportJobRequest\x1a\x1e.google.cloud.kms.v1.ImportJob\"o\xda\x41\x1fparent,import_job_id,import_job\x82\xd3\xe4\x93\x02G\"9/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs:\nimport_job\x12\xd1\x01\n\x0fUpdateCryptoKey\x12+.google.cloud.kms.v1.UpdateCryptoKeyRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"q\xda\x41\x16\x63rypto_key,update_mask\x82\xd3\xe4\x93\x02R2D/v1/{crypto_key.name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:\ncrypto_key\x12\x93\x02\n\x16UpdateCryptoKeyVersion\x12\x32.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"\x9d\x01\xda\x41\x1e\x63rypto_key_version,update_mask\x82\xd3\xe4\x93\x02v2`/v1/{crypto_key_version.name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:\x12\x63rypto_key_version\x12\xf2\x01\n\x1dUpdateCryptoKeyPrimaryVersion\x12\x39.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest\x1a\x1e.google.cloud.kms.v1.CryptoKey\"v\xda\x41\x1aname,crypto_key_version_id\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:updatePrimaryVersion:\x01*\x12\xde\x01\n\x17\x44\x65stroyCryptoKeyVersion\x12\x33.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:destroy:\x01*\x12\xde\x01\n\x17RestoreCryptoKeyVersion\x12\x33.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest\x1a%.google.cloud.kms.v1.CryptoKeyVersion\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:restore:\x01*\x12\xb4\x01\n\x07\x45ncrypt\x12#.google.cloud.kms.v1.EncryptRequest\x1a$.google.cloud.kms.v1.EncryptResponse\"^\xda\x41\x0ename,plaintext\x82\xd3\xe4\x93\x02G\"B/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/**}:encrypt:\x01*\x12\xb4\x01\n\x07\x44\x65\x63rypt\x12#.google.cloud.kms.v1.DecryptRequest\x1a$.google.cloud.kms.v1.DecryptResponse\"^\xda\x41\x0fname,ciphertext\x82\xd3\xe4\x93\x02\x46\"A/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:decrypt:\x01*\x12\xc2\x01\n\nRawEncrypt\x12&.google.cloud.kms.v1.RawEncryptRequest\x1a\'.google.cloud.kms.v1.RawEncryptResponse\"c\x82\xd3\xe4\x93\x02]\"X/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawEncrypt:\x01*\x12\xc2\x01\n\nRawDecrypt\x12&.google.cloud.kms.v1.RawDecryptRequest\x1a\'.google.cloud.kms.v1.RawDecryptResponse\"c\x82\xd3\xe4\x93\x02]\"X/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:rawDecrypt:\x01*\x12\xe0\x01\n\x0e\x41symmetricSign\x12*.google.cloud.kms.v1.AsymmetricSignRequest\x1a+.google.cloud.kms.v1.AsymmetricSignResponse\"u\xda\x41\x0bname,digest\x82\xd3\xe4\x93\x02\x61\"\\/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricSign:\x01*\x12\xf0\x01\n\x11\x41symmetricDecrypt\x12-.google.cloud.kms.v1.AsymmetricDecryptRequest\x1a..google.cloud.kms.v1.AsymmetricDecryptResponse\"|\xda\x41\x0fname,ciphertext\x82\xd3\xe4\x93\x02\x64\"_/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricDecrypt:\x01*\x12\xc2\x01\n\x07MacSign\x12#.google.cloud.kms.v1.MacSignRequest\x1a$.google.cloud.kms.v1.MacSignResponse\"l\xda\x41\tname,data\x82\xd3\xe4\x93\x02Z\"U/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macSign:\x01*\x12\xce\x01\n\tMacVerify\x12%.google.cloud.kms.v1.MacVerifyRequest\x1a&.google.cloud.kms.v1.MacVerifyResponse\"r\xda\x41\rname,data,mac\x82\xd3\xe4\x93\x02\\\"W/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macVerify:\x01*\x12\xc6\x01\n\x0b\x44\x65\x63\x61psulate\x12\'.google.cloud.kms.v1.DecapsulateRequest\x1a(.google.cloud.kms.v1.DecapsulateResponse\"d\x82\xd3\xe4\x93\x02^\"Y/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:decapsulate:\x01*\x12\xe7\x01\n\x13GenerateRandomBytes\x12/.google.cloud.kms.v1.GenerateRandomBytesRequest\x1a\x30.google.cloud.kms.v1.GenerateRandomBytesResponse\"m\xda\x41&location,length_bytes,protection_level\x82\xd3\xe4\x93\x02>\"9/v1/{location=projects/*/locations/*}:generateRandomBytes:\x01*\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsB|\n\x17\x63om.google.cloud.kms.v1B\x08KmsProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.kms.v1.KeyRing", "google/cloud/kms/v1/resources.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Int64Value", "google/protobuf/wrappers.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Kms - module V1 - ListKeyRingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListKeyRingsRequest").msgclass - ListCryptoKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeysRequest").msgclass - ListCryptoKeyVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeyVersionsRequest").msgclass - ListImportJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListImportJobsRequest").msgclass - ListRetiredResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListRetiredResourcesRequest").msgclass - ListKeyRingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListKeyRingsResponse").msgclass - ListCryptoKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeysResponse").msgclass - ListCryptoKeyVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListCryptoKeyVersionsResponse").msgclass - ListImportJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListImportJobsResponse").msgclass - ListRetiredResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ListRetiredResourcesResponse").msgclass - GetKeyRingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetKeyRingRequest").msgclass - GetCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetCryptoKeyRequest").msgclass - GetCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetCryptoKeyVersionRequest").msgclass - GetPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetPublicKeyRequest").msgclass - GetImportJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetImportJobRequest").msgclass - GetRetiredResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GetRetiredResourceRequest").msgclass - CreateKeyRingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateKeyRingRequest").msgclass - CreateCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateCryptoKeyRequest").msgclass - CreateCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateCryptoKeyVersionRequest").msgclass - DeleteCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyRequest").msgclass - DeleteCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyVersionRequest").msgclass - ImportCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.ImportCryptoKeyVersionRequest").msgclass - CreateImportJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.CreateImportJobRequest").msgclass - UpdateCryptoKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateCryptoKeyRequest").msgclass - UpdateCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateCryptoKeyVersionRequest").msgclass - UpdateCryptoKeyPrimaryVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest").msgclass - DestroyCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DestroyCryptoKeyVersionRequest").msgclass - RestoreCryptoKeyVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RestoreCryptoKeyVersionRequest").msgclass - EncryptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EncryptRequest").msgclass - DecryptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DecryptRequest").msgclass - RawEncryptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RawEncryptRequest").msgclass - RawDecryptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RawDecryptRequest").msgclass - AsymmetricSignRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AsymmetricSignRequest").msgclass - AsymmetricDecryptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AsymmetricDecryptRequest").msgclass - MacSignRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.MacSignRequest").msgclass - MacVerifyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.MacVerifyRequest").msgclass - DecapsulateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DecapsulateRequest").msgclass - GenerateRandomBytesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GenerateRandomBytesRequest").msgclass - EncryptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EncryptResponse").msgclass - DecryptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DecryptResponse").msgclass - RawEncryptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RawEncryptResponse").msgclass - RawDecryptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.RawDecryptResponse").msgclass - AsymmetricSignResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AsymmetricSignResponse").msgclass - AsymmetricDecryptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.AsymmetricDecryptResponse").msgclass - MacSignResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.MacSignResponse").msgclass - MacVerifyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.MacVerifyResponse").msgclass - DecapsulateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DecapsulateResponse").msgclass - GenerateRandomBytesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.GenerateRandomBytesResponse").msgclass - Digest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.Digest").msgclass - LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.LocationMetadata").msgclass - DeleteCryptoKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyMetadata").msgclass - DeleteCryptoKeyVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.DeleteCryptoKeyVersionMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb deleted file mode 100644 index c9b285a31763..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/service_services_pb.rb +++ /dev/null @@ -1,245 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/kms/v1/service.proto for package 'google.cloud.kms.v1' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/kms/v1/service_pb' - -module Google - module Cloud - module Kms - module V1 - module KeyManagementService - # Google Cloud Key Management Service - # - # Manages cryptographic keys and operations using those keys. Implements a REST - # model with the following objects: - # - # * [KeyRing][google.cloud.kms.v1.KeyRing] - # * [CryptoKey][google.cloud.kms.v1.CryptoKey] - # * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - # * [ImportJob][google.cloud.kms.v1.ImportJob] - # - # If you are using manual gRPC libraries, see - # [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.kms.v1.KeyManagementService' - - # Lists [KeyRings][google.cloud.kms.v1.KeyRing]. - rpc :ListKeyRings, ::Google::Cloud::Kms::V1::ListKeyRingsRequest, ::Google::Cloud::Kms::V1::ListKeyRingsResponse - # Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - rpc :ListCryptoKeys, ::Google::Cloud::Kms::V1::ListCryptoKeysRequest, ::Google::Cloud::Kms::V1::ListCryptoKeysResponse - # Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - rpc :ListCryptoKeyVersions, ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse - # Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. - rpc :ListImportJobs, ::Google::Cloud::Kms::V1::ListImportJobsRequest, ::Google::Cloud::Kms::V1::ListImportJobsResponse - # Lists the [RetiredResources][google.cloud.kms.v1.RetiredResource] which are - # the records of deleted [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - # RetiredResources prevent the reuse of these resource names after deletion. - rpc :ListRetiredResources, ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse - # Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. - rpc :GetKeyRing, ::Google::Cloud::Kms::V1::GetKeyRingRequest, ::Google::Cloud::Kms::V1::KeyRing - # 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]. - rpc :GetCryptoKey, ::Google::Cloud::Kms::V1::GetCryptoKeyRequest, ::Google::Cloud::Kms::V1::CryptoKey - # Returns metadata for a given - # [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - rpc :GetCryptoKeyVersion, ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion - # 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]. - rpc :GetPublicKey, ::Google::Cloud::Kms::V1::GetPublicKeyRequest, ::Google::Cloud::Kms::V1::PublicKey - # Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. - rpc :GetImportJob, ::Google::Cloud::Kms::V1::GetImportJobRequest, ::Google::Cloud::Kms::V1::ImportJob - # Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] - # resource, which represents the record of a deleted - # [CryptoKey][google.cloud.kms.v1.CryptoKey]. - rpc :GetRetiredResource, ::Google::Cloud::Kms::V1::GetRetiredResourceRequest, ::Google::Cloud::Kms::V1::RetiredResource - # Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and - # Location. - rpc :CreateKeyRing, ::Google::Cloud::Kms::V1::CreateKeyRingRequest, ::Google::Cloud::Kms::V1::KeyRing - # 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. - rpc :CreateCryptoKey, ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest, ::Google::Cloud::Kms::V1::CryptoKey - # 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]. - rpc :CreateCryptoKeyVersion, ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion - # Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. - # All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must - # have been previously deleted using - # [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. - # The specified crypto key will be immediately and permanently deleted upon - # calling this method. This action cannot be undone. - rpc :DeleteCryptoKey, ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, ::Google::Longrunning::Operation - # Permanently deletes the given - # [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if - # the version has not been previously imported and if its - # [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of - # [DESTROYED][CryptoKeyVersionState.DESTROYED], - # [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or - # [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. - # Successfully imported - # [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted - # at this time. The specified version will be immediately and permanently - # deleted upon calling this method. This action cannot be undone. - rpc :DeleteCryptoKeyVersion, ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, ::Google::Longrunning::Operation - # 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]. - rpc :ImportCryptoKeyVersion, ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion - # 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. - rpc :CreateImportJob, ::Google::Cloud::Kms::V1::CreateImportJobRequest, ::Google::Cloud::Kms::V1::ImportJob - # Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. - rpc :UpdateCryptoKey, ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest, ::Google::Cloud::Kms::V1::CryptoKey - # 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. - rpc :UpdateCryptoKeyVersion, ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion - # 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]. - rpc :UpdateCryptoKeyPrimaryVersion, ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, ::Google::Cloud::Kms::V1::CryptoKey - # 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. - rpc :DestroyCryptoKeyVersion, ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion - # 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. - rpc :RestoreCryptoKeyVersion, ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion - # 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]. - rpc :Encrypt, ::Google::Cloud::Kms::V1::EncryptRequest, ::Google::Cloud::Kms::V1::EncryptResponse - # 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]. - rpc :Decrypt, ::Google::Cloud::Kms::V1::DecryptRequest, ::Google::Cloud::Kms::V1::DecryptResponse - # 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]. - rpc :RawEncrypt, ::Google::Cloud::Kms::V1::RawEncryptRequest, ::Google::Cloud::Kms::V1::RawEncryptResponse - # 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]. - rpc :RawDecrypt, ::Google::Cloud::Kms::V1::RawDecryptRequest, ::Google::Cloud::Kms::V1::RawDecryptResponse - # 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]. - rpc :AsymmetricSign, ::Google::Cloud::Kms::V1::AsymmetricSignRequest, ::Google::Cloud::Kms::V1::AsymmetricSignResponse - # 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. - rpc :AsymmetricDecrypt, ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest, ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse - # 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. - rpc :MacSign, ::Google::Cloud::Kms::V1::MacSignRequest, ::Google::Cloud::Kms::V1::MacSignResponse - # 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. - rpc :MacVerify, ::Google::Cloud::Kms::V1::MacVerifyRequest, ::Google::Cloud::Kms::V1::MacVerifyResponse - # Decapsulates data that was encapsulated 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] - # KEY_ENCAPSULATION. - rpc :Decapsulate, ::Google::Cloud::Kms::V1::DecapsulateRequest, ::Google::Cloud::Kms::V1::DecapsulateResponse - # Generate random bytes using the Cloud KMS randomness source in the provided - # location. - rpc :GenerateRandomBytes, ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest, ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb b/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb deleted file mode 100644 index 0ac65bb1082e..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-kms-v1/proto_docs/README.md deleted file mode 100644 index b4de92b74f3d..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Key Management Service (KMS) V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey.rb deleted file mode 100644 index e76e403d45dc..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey.rb +++ /dev/null @@ -1,142 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - # Request message for - # {::Google::Cloud::Kms::V1::Autokey::Client#create_key_handle Autokey.CreateKeyHandle}. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the resource project and location to create the - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} in, e.g. - # `projects/{PROJECT_ID}/locations/{LOCATION}`. - # @!attribute [rw] key_handle_id - # @return [::String] - # Optional. Id of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle}. Must be - # unique to the resource project and location. If not provided by the caller, - # a new UUID is used. - # @!attribute [rw] key_handle - # @return [::Google::Cloud::Kms::V1::KeyHandle] - # Required. {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} to create. - class CreateKeyHandleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::Kms::V1::Autokey::Client#get_key_handle GetKeyHandle}. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} resource, - # e.g. - # `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. - class GetKeyHandleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Resource-oriented representation of a request to Cloud KMS Autokey and the - # resulting provisioning of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # @!attribute [rw] name - # @return [::String] - # Identifier. Name of the {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} - # resource, e.g. - # `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`. - # @!attribute [r] kms_key - # @return [::String] - # Output only. Name of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that has - # been provisioned for Customer Managed Encryption Key (CMEK) use in the - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} project and location for the - # requested resource type. The {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} - # project will reflect the value configured in the - # {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} on the resource - # project's ancestor folder at the time of the - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} creation. If more than one - # ancestor folder has a configured - # {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig}, the nearest of these - # configurations is used. - # @!attribute [rw] resource_type_selector - # @return [::String] - # Required. Indicates the resource type that the resulting - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is meant to protect, e.g. - # `{SERVICE}.googleapis.com/{TYPE}`. See documentation for supported resource - # types. - class KeyHandle - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for - # {::Google::Cloud::Kms::V1::Autokey::Client#create_key_handle CreateKeyHandle} long-running - # operation response. - class CreateKeyHandleMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::Autokey::Client#list_key_handles Autokey.ListKeyHandles}. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the resource project and location from which to list - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. - # `projects/{PROJECT_ID}/locations/{LOCATION}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} to include in the response. The - # service may return fewer than this value. Further - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} can subsequently be obtained by - # including the - # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token} - # in a subsequent request. If unspecified, at most 100 - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles} will be returned. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListKeyHandlesResponse#next_page_token ListKeyHandlesResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter to apply when listing - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}, e.g. - # `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`. - class ListKeyHandlesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::Autokey::Client#list_key_handles Autokey.ListKeyHandles}. - # @!attribute [rw] key_handles - # @return [::Array<::Google::Cloud::Kms::V1::KeyHandle>] - # Resulting {::Google::Cloud::Kms::V1::KeyHandle KeyHandles}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Kms::V1::ListKeyHandlesRequest#page_token ListKeyHandlesRequest.page_token} - # to retrieve the next page of results. - class ListKeyHandlesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey_admin.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey_admin.rb deleted file mode 100644 index 2292e75e0df5..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/autokey_admin.rb +++ /dev/null @@ -1,125 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - # Request message for - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config UpdateAutokeyConfig}. - # @!attribute [rw] autokey_config - # @return [::Google::Cloud::Kms::V1::AutokeyConfig] - # Required. {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} with values to - # update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Masks which fields of the - # {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} to update, e.g. - # `keyProject`. - class UpdateAutokeyConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#get_autokey_config GetAutokeyConfig}. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} - # resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. - class GetAutokeyConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cloud KMS Autokey configuration for a folder. - # @!attribute [rw] name - # @return [::String] - # Identifier. Name of the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} - # resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`. - # @!attribute [rw] key_project - # @return [::String] - # Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or - # `projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision a new - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} when a - # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} is created. On - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config UpdateAutokeyConfig}, - # the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on - # this key project. Once configured, for Cloud KMS Autokey to function - # properly, this key project must have the Cloud KMS API activated and the - # Cloud KMS Service Agent for this key project must be granted the - # `cloudkms.admin` role (or pertinent permissions). A request with an empty - # key project field will clear the configuration. - # @!attribute [r] state - # @return [::Google::Cloud::Kms::V1::AutokeyConfig::State] - # Output only. The state for the AutokeyConfig. - # @!attribute [rw] etag - # @return [::String] - # Optional. A checksum computed by the server based on the value of other - # fields. This may be sent on update requests to ensure that the client has - # an up-to-date value before proceeding. The request will be rejected with an - # ABORTED error on a mismatched etag. - class AutokeyConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The states AutokeyConfig can be in. - module State - # The state of the AutokeyConfig is unspecified. - STATE_UNSPECIFIED = 0 - - # The AutokeyConfig is currently active. - ACTIVE = 1 - - # A previously configured key project has been deleted and the current - # AutokeyConfig is unusable. - KEY_PROJECT_DELETED = 2 - - # The AutokeyConfig is not yet initialized or has been reset to its default - # uninitialized state. - UNINITIALIZED = 3 - end - end - - # Request message for - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the resource project to the show effective Cloud KMS - # Autokey configuration for. This may be helpful for interrogating the effect - # of nested folder configurations on a given resource project. - class ShowEffectiveAutokeyConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config ShowEffectiveAutokeyConfig}. - # @!attribute [rw] key_project - # @return [::String] - # Name of the key project configured in the resource project's folder - # ancestry. - class ShowEffectiveAutokeyConfigResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/ekm_service.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/ekm_service.rb deleted file mode 100644 index 1c149af0f118..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/ekm_service.rb +++ /dev/null @@ -1,351 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - # Request message for - # {::Google::Cloud::Kms::V1::EkmService::Client#list_ekm_connections EkmService.ListEkmConnections}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to list, in the format - # `projects/*/locations/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} to include in the - # response. Further {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} can - # subsequently be obtained by including the - # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListEkmConnectionsResponse#next_page_token ListEkmConnectionsResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # 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). - # @!attribute [rw] order_by - # @return [::String] - # 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). - class ListEkmConnectionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::EkmService::Client#list_ekm_connections EkmService.ListEkmConnections}. - # @!attribute [rw] ekm_connections - # @return [::Array<::Google::Cloud::Kms::V1::EkmConnection>] - # The list of {::Google::Cloud::Kms::V1::EkmConnection EkmConnections}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Kms::V1::ListEkmConnectionsRequest#page_token ListEkmConnectionsRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of {::Google::Cloud::Kms::V1::EkmConnection EkmConnections} - # that matched the query. - # - # This field is not populated if - # {::Google::Cloud::Kms::V1::ListEkmConnectionsRequest#filter ListEkmConnectionsRequest.filter} - # is applied. - class ListEkmConnectionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::EkmService::Client#get_ekm_connection EkmService.GetEkmConnection}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to get. - class GetEkmConnectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::EkmService::Client#create_ekm_connection EkmService.CreateEkmConnection}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}, in the format - # `projects/*/locations/*`. - # @!attribute [rw] ekm_connection_id - # @return [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. - # @!attribute [rw] ekm_connection - # @return [::Google::Cloud::Kms::V1::EkmConnection] - # Required. An {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with - # initial field values. - class CreateEkmConnectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::EkmService::Client#update_ekm_connection EkmService.UpdateEkmConnection}. - # @!attribute [rw] ekm_connection - # @return [::Google::Cloud::Kms::V1::EkmConnection] - # Required. {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} with updated - # values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated in this request. - class UpdateEkmConnectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::EkmService::Client#get_ekm_config EkmService.GetEkmConfig}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::EkmConfig#name name} of the - # {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} to get. - class GetEkmConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::EkmService::Client#update_ekm_config EkmService.UpdateEkmConfig}. - # @!attribute [rw] ekm_config - # @return [::Google::Cloud::Kms::V1::EkmConfig] - # Required. {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} with updated values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated in this request. - class UpdateEkmConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A {::Google::Cloud::Kms::V1::Certificate Certificate} represents an X.509 - # certificate used to authenticate HTTPS connections to EKM replicas. - # @!attribute [rw] raw_der - # @return [::String] - # Required. The raw certificate bytes in DER format. - # @!attribute [r] parsed - # @return [::Boolean] - # Output only. True if the certificate was parsed successfully. - # @!attribute [r] issuer - # @return [::String] - # Output only. The issuer distinguished name in RFC 2253 format. Only present - # if {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. - # @!attribute [r] subject - # @return [::String] - # Output only. The subject distinguished name in RFC 2253 format. Only - # present if {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. - # @!attribute [r] subject_alternative_dns_names - # @return [::Array<::String>] - # Output only. The subject Alternative DNS names. Only present if - # {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. - # @!attribute [r] not_before_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The certificate is not valid before this time. Only present if - # {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. - # @!attribute [r] not_after_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The certificate is not valid after this time. Only present if - # {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. - # @!attribute [r] serial_number - # @return [::String] - # Output only. The certificate serial number as a hex string. Only present if - # {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. - # @!attribute [r] sha256_fingerprint - # @return [::String] - # Output only. The SHA-256 certificate fingerprint as a hex string. Only - # present if {::Google::Cloud::Kms::V1::Certificate#parsed parsed} is true. - class Certificate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} represents an - # individual EKM connection. It can be used for creating - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} and - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} with a - # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC}, as well as - # performing cryptographic operations using keys created within the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name for the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} in the format - # `projects/*/locations/*/ekmConnections/*`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} was created. - # @!attribute [rw] service_resolvers - # @return [::Array<::Google::Cloud::Kms::V1::EkmConnection::ServiceResolver>] - # Optional. A list of - # {::Google::Cloud::Kms::V1::EkmConnection::ServiceResolver ServiceResolvers} where - # the EKM can be reached. There should be one ServiceResolver per EKM - # replica. Currently, only a single - # {::Google::Cloud::Kms::V1::EkmConnection::ServiceResolver ServiceResolver} is - # supported. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the currently stored - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. - # @!attribute [rw] key_management_mode - # @return [::Google::Cloud::Kms::V1::EkmConnection::KeyManagementMode] - # Optional. Describes who can perform control plane operations on the EKM. If - # unset, this defaults to - # {::Google::Cloud::Kms::V1::EkmConnection::KeyManagementMode::MANUAL MANUAL}. - # @!attribute [rw] crypto_space_path - # @return [::String] - # Optional. Identifies the EKM Crypto Space that this - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} maps to. Note: This - # field is required if - # {::Google::Cloud::Kms::V1::EkmConnection::KeyManagementMode KeyManagementMode} is - # {::Google::Cloud::Kms::V1::EkmConnection::KeyManagementMode::CLOUD_KMS CLOUD_KMS}. - class EkmConnection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A {::Google::Cloud::Kms::V1::EkmConnection::ServiceResolver ServiceResolver} - # represents an EKM replica that can be reached within an - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. - # @!attribute [rw] service_directory_service - # @return [::String] - # Required. The resource name of the Service Directory service pointing to - # an EKM replica, in the format - # `projects/*/locations/*/namespaces/*/services/*`. - # @!attribute [rw] endpoint_filter - # @return [::String] - # 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. - # @!attribute [rw] hostname - # @return [::String] - # Required. The hostname of the EKM replica used at TLS and HTTP layers. - # @!attribute [rw] server_certificates - # @return [::Array<::Google::Cloud::Kms::V1::Certificate>] - # Required. A list of leaf server certificates used to authenticate HTTPS - # connections to the EKM replica. Currently, a maximum of 10 - # {::Google::Cloud::Kms::V1::Certificate Certificate} is supported. - class ServiceResolver - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Kms::V1::EkmConnection::KeyManagementMode KeyManagementMode} - # describes who can perform control plane cryptographic operations using this - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. - module KeyManagementMode - # Not specified. - KEY_MANAGEMENT_MODE_UNSPECIFIED = 0 - - # EKM-side key management operations on - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} created with this - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} must be initiated from - # the EKM directly and cannot be performed from Cloud KMS. This means that: - # * When creating a - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} associated with - # this - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}, the caller must - # supply the key path of pre-existing external key material that will be - # linked to the {::Google::Cloud::Kms::V1::CryptoKeyVersion 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. - MANUAL = 1 - - # All {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} created with this - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} use EKM-side key - # management operations initiated from Cloud KMS. This means that: - # - # * When a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # associated with this {::Google::Cloud::Kms::V1::EkmConnection 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 - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} can be requested by - # calling - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version DestroyCryptoKeyVersion}. - # * Automatic rotation of key material is supported. - CLOUD_KMS = 2 - end - end - - # An {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} is a singleton resource that - # represents configuration parameters that apply to all - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} and - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} with a - # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} in a given - # project and location. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name for the - # {::Google::Cloud::Kms::V1::EkmConfig EkmConfig} in the format - # `projects/*/locations/*/ekmConfig`. - # @!attribute [rw] default_ekm_connection - # @return [::String] - # Optional. Resource name of the default - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. Setting this field to - # the empty string removes the default. - class EkmConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::EkmService::Client#verify_connectivity EkmService.VerifyConnectivity}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to verify. - class VerifyConnectivityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::EkmService::Client#verify_connectivity EkmService.VerifyConnectivity}. - class VerifyConnectivityResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/hsm_management.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/hsm_management.rb deleted file mode 100644 index 7498382268f7..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/hsm_management.rb +++ /dev/null @@ -1,877 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - # A {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # represents a single-tenant HSM instance. It can be used for creating - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with a - # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of - # [HSM_SINGLE_TENANT][CryptoKeyVersion.ProtectionLevel.HSM_SINGLE_TENANT], as - # well as performing cryptographic operations using keys created within the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name for this - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} in - # the format `projects/*/locations/*/singleTenantHsmInstances/*`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} was - # created. - # @!attribute [r] state - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State] - # Output only. The state of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # @!attribute [rw] quorum_auth - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth] - # Required. The quorum auth configuration for the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} was - # deleted. - # @!attribute [r] unrefreshed_duration_until_disable - # @return [::Google::Protobuf::Duration] - # Output only. The system-defined duration that an instance can remain - # unrefreshed until it is automatically disabled. This will have a value of - # 120 days. - # @!attribute [r] disable_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the instance will be automatically disabled - # if not refreshed. This field is updated upon creation and after each - # successful refresh operation and enable. A - # [RefreshSingleTenantHsmInstance][] operation must be made via a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # before this time otherwise the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} will - # become disabled. - class SingleTenantHsmInstance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for M of N quorum auth. - # @!attribute [rw] total_approver_count - # @return [::Integer] - # Required. The total number of approvers. This is the N value used - # for M of N quorum auth. Must be greater than or equal to 3 and less than - # or equal to 16. - # @!attribute [r] required_approver_count - # @return [::Integer] - # Output only. The required numbers of approvers. The M value used for M of - # N quorum auth. Must be greater than or equal to 2 and less than or equal - # to - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} - # - 1. - # @!attribute [r] two_factor_public_key_pems - # @return [::Array<::String>] - # Output only. The public keys associated with the 2FA keys for M of N - # quorum auth. - class QuorumAuth - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The set of states of a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is - # being created. - CREATING = 1 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is - # waiting for 2FA keys to be registered. This can be done by calling - # {::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal CreateSingleTenantHsmInstanceProposal} - # with the [RegisterTwoFactorAuthKeys][] operation. - PENDING_TWO_FACTOR_AUTH_REGISTRATION = 2 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is - # ready to use. A - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state - # for all {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} created within the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} to - # be usable. - ACTIVE = 3 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is - # being disabled. - DISABLING = 4 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is - # disabled. - DISABLED = 5 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} is - # being deleted. Requests to the instance will be rejected in this state. - DELETING = 6 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # has been deleted. - DELETED = 7 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # has failed and can not be recovered or used. - FAILED = 8 - end - end - - # A - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # represents a proposal to perform an operation on a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name for this - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} in - # the format `projects/*/locations/*/singleTenantHsmInstances/*/proposals/*`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # was created. - # @!attribute [r] state - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::State] - # Output only. The state of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. - # @!attribute [r] failure_reason - # @return [::String] - # Output only. The root cause of the most recent failure. Only present if - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#state state} is - # [FAILED][SingleTenantHsmInstanceProposal.FAILED]. - # @!attribute [r] quorum_parameters - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters] - # Output only. The quorum approval parameters for the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. - # - # Note: The following fields are mutually exclusive: `quorum_parameters`, `required_action_quorum_parameters`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] required_action_quorum_parameters - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters] - # Output only. Parameters for an approval of a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # that has both required challenges and a quorum. - # - # Note: The following fields are mutually exclusive: `required_action_quorum_parameters`, `quorum_parameters`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # will expire if not approved and executed. - # - # Note: The following fields are mutually exclusive: `expire_time`, `ttl`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Input only. The TTL for the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. - # Proposals will expire after this duration. - # - # Note: The following fields are mutually exclusive: `ttl`, `expire_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # was deleted. - # @!attribute [r] purge_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the soft-deleted - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # will be permanently purged. This field is only populated - # when the state is DELETED and will be set a time after expiration of the - # proposal, i.e. >= expire_time or (create_time + ttl). - # @!attribute [rw] register_two_factor_auth_keys - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RegisterTwoFactorAuthKeys] - # Register 2FA keys for the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # This operation requires all N Challenges to be signed by 2FA keys. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::PENDING_TWO_FACTOR_AUTH_REGISTRATION PENDING_TWO_FACTOR_AUTH_REGISTRATION} - # state to perform this operation. - # - # Note: The following fields are mutually exclusive: `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `enable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `add_quorum_member`, `remove_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] disable_single_tenant_hsm_instance - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::DisableSingleTenantHsmInstance] - # Disable the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state - # to perform this operation. - # - # Note: The following fields are mutually exclusive: `disable_single_tenant_hsm_instance`, `register_two_factor_auth_keys`, `enable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `add_quorum_member`, `remove_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] enable_single_tenant_hsm_instance - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::EnableSingleTenantHsmInstance] - # Enable the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::DISABLED DISABLED} - # state to perform this operation. - # - # Note: The following fields are mutually exclusive: `enable_single_tenant_hsm_instance`, `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `add_quorum_member`, `remove_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete_single_tenant_hsm_instance - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::DeleteSingleTenantHsmInstance] - # Delete the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # Deleting a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # will make all {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} attached to the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # unusable. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::DISABLED DISABLED} or - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::PENDING_TWO_FACTOR_AUTH_REGISTRATION PENDING_TWO_FACTOR_AUTH_REGISTRATION} - # state to perform this operation. - # - # Note: The following fields are mutually exclusive: `delete_single_tenant_hsm_instance`, `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `enable_single_tenant_hsm_instance`, `add_quorum_member`, `remove_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] add_quorum_member - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::AddQuorumMember] - # Add a quorum member to the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # This will increase the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} - # by 1. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state - # to perform this operation. - # - # Note: The following fields are mutually exclusive: `add_quorum_member`, `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `enable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `remove_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] remove_quorum_member - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RemoveQuorumMember] - # Remove a quorum member from the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # This will reduce - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} - # by 1. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state - # to perform this operation. - # - # Note: The following fields are mutually exclusive: `remove_quorum_member`, `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `enable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `add_quorum_member`, `refresh_single_tenant_hsm_instance`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] refresh_single_tenant_hsm_instance - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RefreshSingleTenantHsmInstance] - # Refreshes the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # This operation must be performed periodically to keep the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # active. This operation must be performed before - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#unrefreshed_duration_until_disable unrefreshed_duration_until_disable} - # has passed. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # must be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state - # to perform this operation. - # - # Note: The following fields are mutually exclusive: `refresh_single_tenant_hsm_instance`, `register_two_factor_auth_keys`, `disable_single_tenant_hsm_instance`, `enable_single_tenant_hsm_instance`, `delete_single_tenant_hsm_instance`, `add_quorum_member`, `remove_quorum_member`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class SingleTenantHsmInstanceProposal - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Parameters of quorum approval for the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. - # @!attribute [r] required_approver_count - # @return [::Integer] - # Output only. The required numbers of approvers. This is the M value used - # for M of N quorum auth. It is less than the number of public keys. - # @!attribute [r] challenges - # @return [::Array<::Google::Cloud::Kms::V1::Challenge>] - # Output only. The challenges to be signed by 2FA keys for quorum auth. M - # of N of these challenges are required to be signed to approve the - # operation. - # @!attribute [r] approved_two_factor_public_key_pems - # @return [::Array<::String>] - # Output only. The public keys associated with the 2FA keys that have - # already approved the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # by signing the challenge. - class QuorumParameters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Parameters for an approval that has both required challenges and a - # quorum. - # @!attribute [r] required_challenges - # @return [::Array<::Google::Cloud::Kms::V1::Challenge>] - # Output only. A list of specific challenges that must be signed. - # For some operations, this will contain a single challenge. - # @!attribute [r] required_approver_count - # @return [::Integer] - # Output only. The required number of quorum approvers. This is the M value - # used for M of N quorum auth. It is less than the number of public keys. - # @!attribute [r] quorum_challenges - # @return [::Array<::Google::Cloud::Kms::V1::Challenge>] - # Output only. The challenges to be signed by 2FA keys for quorum auth. M - # of N of these challenges are required to be signed to approve the - # operation. - # @!attribute [r] approved_two_factor_public_key_pems - # @return [::Array<::String>] - # Output only. The public keys associated with the 2FA keys that have - # already approved the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # by signing the challenge. - class RequiredActionQuorumParameters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Register 2FA keys for the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # This operation requires all Challenges to be signed by 2FA keys. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must - # be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::PENDING_TWO_FACTOR_AUTH_REGISTRATION PENDING_TWO_FACTOR_AUTH_REGISTRATION} - # state to perform this operation. - # @!attribute [rw] required_approver_count - # @return [::Integer] - # Required. The required numbers of approvers to set for the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # This is the M value used for M of N quorum auth. Must be greater than or - # equal to 2 and less than or equal to - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} - # - 1. - # @!attribute [rw] two_factor_public_key_pems - # @return [::Array<::String>] - # Required. The public keys associated with the 2FA keys for M of N quorum - # auth. Public keys must be associated with RSA 2048 keys. - class RegisterTwoFactorAuthKeys - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Disable the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must - # be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state to - # perform this operation. - class DisableSingleTenantHsmInstance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Enable the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must - # be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::DISABLED DISABLED} - # state to perform this operation. - class EnableSingleTenantHsmInstance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Delete the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # Deleting a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} will - # make all {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} attached to the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # unusable. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must - # not be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::DELETING DELETING} or - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::DELETED DELETED} state - # to perform this operation. - class DeleteSingleTenantHsmInstance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Add a quorum member to the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # This will increase the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} - # by 1. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must - # be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state to - # perform this operation. - # @!attribute [rw] two_factor_public_key_pem - # @return [::String] - # Required. The public key associated with the 2FA key for the new quorum - # member to add. Public keys must be associated with RSA 2048 keys. - class AddQuorumMember - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Remove a quorum member from the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # This will reduce - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::QuorumAuth#total_approver_count total_approver_count} - # by 1. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must - # be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state to - # perform this operation. - # @!attribute [rw] two_factor_public_key_pem - # @return [::String] - # Required. The public key associated with the 2FA key for the quorum - # member to remove. Public keys must be associated with RSA 2048 keys. - class RemoveQuorumMember - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Refreshes the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}. - # This operation must be performed periodically to keep the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # active. This operation must be performed before - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#unrefreshed_duration_until_disable unrefreshed_duration_until_disable} - # has passed. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} must - # be in the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance::State::ACTIVE ACTIVE} state to - # perform this operation. - class RefreshSingleTenantHsmInstance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The set of states of a - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal}. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # is being created. - CREATING = 1 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # is pending approval. - PENDING = 2 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # has been approved. - APPROVED = 3 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # is being executed. - RUNNING = 4 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # has been executed successfully. - SUCCEEDED = 5 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # has failed. - FAILED = 6 - - # The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # has been deleted and will be purged after the purge_time. - DELETED = 7 - end - end - - # A challenge to be signed by a 2FA key. - # @!attribute [r] challenge - # @return [::String] - # Output only. The challenge to be signed by the 2FA key indicated by the - # public key. - # @!attribute [r] public_key_pem - # @return [::String] - # Output only. The public key associated with the 2FA key that should sign - # the challenge. - class Challenge - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A reply to a challenge signed by a 2FA key. - # @!attribute [rw] signed_challenge - # @return [::String] - # Required. The signed challenge associated with the 2FA key. - # The signature must be RSASSA-PKCS1 v1.5 with a SHA256 digest. - # @!attribute [rw] public_key_pem - # @return [::String] - # Required. The public key associated with the 2FA key. - class ChallengeReply - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances HsmManagement.ListSingleTenantHsmInstances}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to - # list, in the format `projects/*/locations/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} to - # include in the response. Further - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} can - # subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse#next_page_token ListSingleTenantHsmInstancesResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # 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). - # @!attribute [rw] order_by - # @return [::String] - # 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). - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Optional. If set to true, - # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances HsmManagement.ListSingleTenantHsmInstances} - # will also return - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} in - # DELETED state. - class ListSingleTenantHsmInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances HsmManagement.ListSingleTenantHsmInstances}. - # @!attribute [rw] single_tenant_hsm_instances - # @return [::Array<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>] - # The list of - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest#page_token ListSingleTenantHsmInstancesRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstances} - # that matched the query. - # - # This field is not populated if - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest#filter ListSingleTenantHsmInstancesRequest.filter} - # is applied. - class ListSingleTenantHsmInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance HsmManagement.GetSingleTenantHsmInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of - # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # to get. - class GetSingleTenantHsmInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance HsmManagement.CreateSingleTenantHsmInstance}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance}, in - # the format `projects/*/locations/*`. - # @!attribute [rw] single_tenant_hsm_instance_id - # @return [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. - # @!attribute [rw] single_tenant_hsm_instance - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstance] - # Required. An - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} with - # initial field values. - class CreateSingleTenantHsmInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance CreateSingleTenantHsmInstance} - # long-running operation response. - class CreateSingleTenantHsmInstanceMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal HsmManagement.CreateSingleTenantHsmInstanceProposal}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::SingleTenantHsmInstance#name name} of - # the {::Google::Cloud::Kms::V1::SingleTenantHsmInstance SingleTenantHsmInstance} - # associated with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. - # @!attribute [rw] single_tenant_hsm_instance_proposal_id - # @return [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. - # @!attribute [rw] single_tenant_hsm_instance_proposal - # @return [::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to create. - class CreateSingleTenantHsmInstanceProposalRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal CreateSingleTenantHsmInstanceProposal} - # long-running operation response. - class CreateSingleTenantHsmInstanceProposalMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance_proposal HsmManagement.GetSingleTenantHsmInstanceProposal}. - # @!attribute [rw] name - # @return [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to get. - class GetSingleTenantHsmInstanceProposalRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#approve_single_tenant_hsm_instance_proposal HsmManagement.ApproveSingleTenantHsmInstanceProposal}. - # @!attribute [rw] name - # @return [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to approve. - # @!attribute [rw] quorum_reply - # @return [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::QuorumReply] - # Required. The reply to - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters QuorumParameters} - # for approving the proposal. - # - # Note: The following fields are mutually exclusive: `quorum_reply`, `required_action_quorum_reply`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] required_action_quorum_reply - # @return [::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::RequiredActionQuorumReply] - # Required. The reply to - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters RequiredActionQuorumParameters} - # for approving the proposal. - # - # Note: The following fields are mutually exclusive: `required_action_quorum_reply`, `quorum_reply`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ApproveSingleTenantHsmInstanceProposalRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The reply to - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters QuorumParameters} - # for approving the proposal. - # @!attribute [rw] challenge_replies - # @return [::Array<::Google::Cloud::Kms::V1::ChallengeReply>] - # Required. The challenge replies to approve the proposal. Challenge - # replies can be sent across multiple requests. The proposal will be - # approved when - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::QuorumParameters#required_approver_count required_approver_count} - # challenge replies are provided. - class QuorumReply - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The reply to - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters RequiredActionQuorumParameters} - # for approving the proposal. - # @!attribute [rw] required_challenge_replies - # @return [::Array<::Google::Cloud::Kms::V1::ChallengeReply>] - # Required. All required challenges must be signed for the proposal to be - # approved. These can be sent across multiple requests. - # @!attribute [rw] quorum_challenge_replies - # @return [::Array<::Google::Cloud::Kms::V1::ChallengeReply>] - # Required. Quorum members' signed challenge replies. These can be provided - # across multiple requests. The proposal will be approved when - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal::RequiredActionQuorumParameters#required_approver_count required_approver_count} - # quorum_challenge_replies are provided and when all - # required_challenge_replies are provided. - class RequiredActionQuorumReply - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#approve_single_tenant_hsm_instance_proposal HsmManagement.ApproveSingleTenantHsmInstanceProposal}. - class ApproveSingleTenantHsmInstanceProposalResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal HsmManagement.ExecuteSingleTenantHsmInstanceProposal}. - # @!attribute [rw] name - # @return [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to execute. - class ExecuteSingleTenantHsmInstanceProposalRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal HsmManagement.ExecuteSingleTenantHsmInstanceProposal}. - class ExecuteSingleTenantHsmInstanceProposalResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal ExecuteSingleTenantHsmInstanceProposal} - # long-running operation response. - class ExecuteSingleTenantHsmInstanceProposalMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals HsmManagement.ListSingleTenantHsmInstanceProposals}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the single tenant HSM instance associated - # with the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # to list, in the format `projects/*/locations/*/singleTenantHsmInstances/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # to include in the response. Further - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # can subsequently be obtained by including the - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse#next_page_token ListSingleTenantHsmInstanceProposalsResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # 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). - # @!attribute [rw] order_by - # @return [::String] - # 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). - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Optional. If set to true, - # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals HsmManagement.ListSingleTenantHsmInstanceProposals} - # will also return - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # in DELETED state. - class ListSingleTenantHsmInstanceProposalsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals HsmManagement.ListSingleTenantHsmInstanceProposals}. - # @!attribute [rw] single_tenant_hsm_instance_proposals - # @return [::Array<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>] - # The list of - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest#page_token ListSingleTenantHsmInstanceProposalsRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposals} - # that matched the query. - # - # This field is not populated if - # {::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest#filter ListSingleTenantHsmInstanceProposalsRequest.filter} - # is applied. - class ListSingleTenantHsmInstanceProposalsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::HsmManagement::Client#delete_single_tenant_hsm_instance_proposal HsmManagement.DeleteSingleTenantHsmInstanceProposal}. - # @!attribute [rw] name - # @return [::String] - # Required. The - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal#name name} of the - # {::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal SingleTenantHsmInstanceProposal} - # to delete. - class DeleteSingleTenantHsmInstanceProposalRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb deleted file mode 100644 index 1159f4b97906..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb +++ /dev/null @@ -1,1148 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - # A {::Google::Cloud::Kms::V1::KeyRing KeyRing} is a toplevel logical grouping of - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name for the - # {::Google::Cloud::Kms::V1::KeyRing KeyRing} in the format - # `projects/*/locations/*/keyRings/*`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this {::Google::Cloud::Kms::V1::KeyRing KeyRing} - # was created. - class KeyRing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} represents a logical key that - # can be used for cryptographic operations. - # - # A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is made up of zero or more - # {::Google::Cloud::Kms::V1::CryptoKeyVersion versions}, which represent the actual - # key material used in cryptographic operations. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name for this - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the format - # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - # @!attribute [r] primary - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # Output only. A copy of the "primary" - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} that will be used - # by {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt} when this - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is given in - # {::Google::Cloud::Kms::V1::EncryptRequest#name EncryptRequest.name}. - # - # The {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}'s primary version can be - # updated via - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version UpdateCryptoKeyPrimaryVersion}. - # - # Keys with {::Google::Cloud::Kms::V1::CryptoKey#purpose purpose} - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT} - # may have a primary. For other keys, this field will be omitted. - # @!attribute [rw] purpose - # @return [::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose] - # Immutable. The immutable purpose of this - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} was created. - # @!attribute [rw] next_rotation_time - # @return [::Google::Protobuf::Timestamp] - # At {::Google::Cloud::Kms::V1::CryptoKey#next_rotation_time next_rotation_time}, - # the Key Management Service will automatically: - # - # 1. Create a new version of this {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # 2. Mark the new version as primary. - # - # Key rotations performed manually via - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} - # and - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version UpdateCryptoKeyPrimaryVersion} - # do not affect - # {::Google::Cloud::Kms::V1::CryptoKey#next_rotation_time next_rotation_time}. - # - # Keys with {::Google::Cloud::Kms::V1::CryptoKey#purpose purpose} - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT} - # support automatic rotation. For other keys, this field must be omitted. - # @!attribute [rw] rotation_period - # @return [::Google::Protobuf::Duration] - # {::Google::Cloud::Kms::V1::CryptoKey#next_rotation_time 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 {::Google::Cloud::Kms::V1::CryptoKey#rotation_period rotation_period} is - # set, - # {::Google::Cloud::Kms::V1::CryptoKey#next_rotation_time next_rotation_time} - # must also be set. - # - # Keys with {::Google::Cloud::Kms::V1::CryptoKey#purpose purpose} - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT} - # support automatic rotation. For other keys, this field must be omitted. - # @!attribute [rw] version_template - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate] - # A template describing settings for new - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} instances. The - # properties of new {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # instances created by either - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} - # or auto-rotation are controlled by this template. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels with user-defined metadata. For more information, see - # [Labeling Keys](https://cloud.google.com/kms/docs/labeling-keys). - # @!attribute [rw] import_only - # @return [::Boolean] - # Immutable. Whether this key may contain imported versions only. - # @!attribute [rw] destroy_scheduled_duration - # @return [::Google::Protobuf::Duration] - # Immutable. The period of time that versions of this key spend in the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED} - # state before transitioning to - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}. - # If not specified at creation time, the default duration is 30 days. - # @!attribute [rw] crypto_key_backend - # @return [::String] - # Immutable. The resource name of the backend environment where the key - # material for all {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} - # associated with this {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} reside and - # where all related cryptographic operations are performed. Only applicable - # if {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} have a - # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC}, with the - # resource name in the format `projects/*/locations/*/ekmConnections/*`. Only - # applicable if {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} - # have a {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM_SINGLE_TENANT HSM_SINGLE_TENANT}, - # with the resource name in the format - # `projects/*/locations/*/singleTenantHsmInstances/*`. - # Note, this list is non-exhaustive and may apply to additional - # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevels} in the future. - # @!attribute [rw] key_access_justifications_policy - # @return [::Google::Cloud::Kms::V1::KeyAccessJustificationsPolicy] - # Optional. The policy used for Key Access Justifications Policy Enforcement. - # If this field is present and this key is enrolled in Key Access - # Justifications Policy Enforcement, the policy will be evaluated in encrypt, - # decrypt, and sign operations, and the operation will fail if rejected by - # the policy. The policy is defined by specifying zero or more allowed - # justification codes. - # https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes - # By default, this field is absent, and all justification codes are allowed. - class CryptoKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose CryptoKeyPurpose} - # describes the cryptographic capabilities of a - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. A given key can only be used - # for the operations allowed by its purpose. For more information, see [Key - # purposes](https://cloud.google.com/kms/docs/algorithms#key_purposes). - module CryptoKeyPurpose - # Not specified. - CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0 - - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used - # with {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt} and - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt Decrypt}. - ENCRYPT_DECRYPT = 1 - - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used - # with - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign AsymmetricSign} - # and - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey}. - ASYMMETRIC_SIGN = 5 - - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used - # with - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt AsymmetricDecrypt} - # and - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey}. - ASYMMETRIC_DECRYPT = 6 - - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used - # with {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt RawEncrypt} - # and {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt RawDecrypt}. - # This purpose is meant to be used for interoperable symmetric - # encryption and does not support automatic CryptoKey rotation. - RAW_ENCRYPT_DECRYPT = 7 - - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used - # with {::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign MacSign}. - MAC = 9 - - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with this purpose may be used - # with - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey} - # and {::Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate Decapsulate}. - KEY_ENCAPSULATION = 10 - end - end - - # A {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate CryptoKeyVersionTemplate} - # specifies the properties to use when creating a new - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, either manually - # with - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} - # or automatically as a result of auto-rotation. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} to use when creating - # a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} based on this - # template. Immutable. Defaults to - # {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}. - # @!attribute [rw] algorithm - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] - # Required. - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm Algorithm} - # to use when creating a - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} based on this - # template. - # - # For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both - # this field is omitted and - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} is - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. - class CryptoKeyVersionTemplate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains an HSM-generated attestation about a key operation. For more - # information, see [Verifying attestations] - # (https://cloud.google.com/kms/docs/attest-key). - # @!attribute [r] format - # @return [::Google::Cloud::Kms::V1::KeyOperationAttestation::AttestationFormat] - # Output only. The format of the attestation data. - # @!attribute [r] content - # @return [::String] - # Output only. The attestation data provided by the HSM when the key - # operation was performed. - # @!attribute [r] cert_chains - # @return [::Google::Cloud::Kms::V1::KeyOperationAttestation::CertificateChains] - # Output only. The certificate chains needed to validate the attestation - class KeyOperationAttestation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Certificate chains needed to verify the attestation. - # Certificates in chains are PEM-encoded and are ordered based on - # https://tools.ietf.org/html/rfc5246#section-7.4.2. - # @!attribute [rw] cavium_certs - # @return [::Array<::String>] - # Cavium certificate chain corresponding to the attestation. - # @!attribute [rw] google_card_certs - # @return [::Array<::String>] - # Google card certificate chain corresponding to the attestation. - # @!attribute [rw] google_partition_certs - # @return [::Array<::String>] - # Google partition certificate chain corresponding to the attestation. - class CertificateChains - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Attestation formats provided by the HSM. - module AttestationFormat - # Not specified. - 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. - CAVIUM_V1_COMPRESSED = 3 - - # Cavium HSM attestation V2 compressed with gzip. This is a new format - # introduced in Cavium's version 3.2-08. - CAVIUM_V2_COMPRESSED = 4 - end - end - - # A {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} represents an - # individual cryptographic key, and the associated key material. - # - # An - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} - # version can be used for cryptographic operations. - # - # For security reasons, the raw cryptographic key material represented by a - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} can never be viewed - # or exported. It can only be used to encrypt, decrypt, or sign data when an - # authorized user or application invokes Cloud KMS. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name for this - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in the format - # `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. - # @!attribute [rw] state - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState] - # The current state of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. - # @!attribute [r] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # Output only. The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} - # describing how crypto operations are performed with this - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. - # @!attribute [r] algorithm - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] - # Output only. The - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm CryptoKeyVersionAlgorithm} - # that this {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} - # supports. - # @!attribute [r] attestation - # @return [::Google::Cloud::Kms::V1::KeyOperationAttestation] - # 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 - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#protection_level protection_level} - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM}. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} was created. - # @!attribute [r] generate_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s key material was - # generated. - # @!attribute [r] destroy_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s key material is - # scheduled for destruction. Only present if - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED}. - # @!attribute [r] destroy_event_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this CryptoKeyVersion's key material was - # destroyed. Only present if - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}. - # @!attribute [r] import_job - # @return [::String] - # Output only. The name of the {::Google::Cloud::Kms::V1::ImportJob ImportJob} - # used in the most recent import of this - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Only present if - # the underlying key material was imported. - # @!attribute [r] import_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s key material was - # most recently imported. - # @!attribute [r] import_failure_reason - # @return [::String] - # Output only. The root cause of the most recent import failure. Only present - # if {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::IMPORT_FAILED IMPORT_FAILED}. - # @!attribute [r] generation_failure_reason - # @return [::String] - # Output only. The root cause of the most recent generation failure. Only - # present if {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::GENERATION_FAILED GENERATION_FAILED}. - # @!attribute [r] external_destruction_failure_reason - # @return [::String] - # Output only. The root cause of the most recent external destruction - # failure. Only present if - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} is - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::EXTERNAL_DESTRUCTION_FAILED EXTERNAL_DESTRUCTION_FAILED}. - # @!attribute [rw] external_protection_level_options - # @return [::Google::Cloud::Kms::V1::ExternalProtectionLevelOptions] - # ExternalProtectionLevelOptions stores a group of additional fields for - # configuring a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} that - # are specific to the - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL} protection level - # and {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} - # protection levels. - # @!attribute [r] reimport_eligible - # @return [::Boolean] - # Output only. Whether or not this key version is eligible for reimport, by - # being specified as a target in - # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#crypto_key_version ImportCryptoKeyVersionRequest.crypto_key_version}. - class CryptoKeyVersion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The algorithm of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, indicating what - # parameters must be used for each cryptographic operation. - # - # The - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm::GOOGLE_SYMMETRIC_ENCRYPTION GOOGLE_SYMMETRIC_ENCRYPTION} - # algorithm is usable with - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}. - # - # Algorithms beginning with `RSA_SIGN_` are usable with - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_SIGN ASYMMETRIC_SIGN}. - # - # The fields in the name after `RSA_SIGN_` correspond to the following - # parameters: padding algorithm, modulus bit length, and digest algorithm. - # - # For PSS, the salt length used is equal to the length of digest - # algorithm. For example, - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm::RSA_SIGN_PSS_2048_SHA256 RSA_SIGN_PSS_2048_SHA256} - # will use PSS with a salt length of 256 bits or 32 bytes. - # - # Algorithms beginning with `RSA_DECRYPT_` are usable with - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_DECRYPT ASYMMETRIC_DECRYPT}. - # - # The fields in the name after `RSA_DECRYPT_` correspond to the following - # parameters: padding algorithm, modulus bit length, and digest algorithm. - # - # Algorithms beginning with `EC_SIGN_` are usable with - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_SIGN ASYMMETRIC_SIGN}. - # - # The fields in the name after `EC_SIGN_` correspond to the following - # parameters: elliptic curve, digest algorithm. - # - # Algorithms beginning with `HMAC_` are usable with - # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} - # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::MAC MAC}. - # - # The suffix following `HMAC_` corresponds to the hash algorithm being used - # (eg. SHA256). - # - # Algorithms beginning with `PQ_` are post-quantum. - # - # For more information, see [Key purposes and algorithms] - # (https://cloud.google.com/kms/docs/algorithms). - module CryptoKeyVersionAlgorithm - # Not specified. - CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0 - - # Creates symmetric encryption keys. - GOOGLE_SYMMETRIC_ENCRYPTION = 1 - - # AES-GCM (Galois Counter Mode) using 128-bit keys. - AES_128_GCM = 41 - - # AES-GCM (Galois Counter Mode) using 256-bit keys. - AES_256_GCM = 19 - - # AES-CBC (Cipher Block Chaining Mode) using 128-bit keys. - AES_128_CBC = 42 - - # AES-CBC (Cipher Block Chaining Mode) using 256-bit keys. - AES_256_CBC = 43 - - # AES-CTR (Counter Mode) using 128-bit keys. - AES_128_CTR = 44 - - # AES-CTR (Counter Mode) using 256-bit keys. - AES_256_CTR = 45 - - # RSASSA-PSS 2048 bit key with a SHA256 digest. - RSA_SIGN_PSS_2048_SHA256 = 2 - - # RSASSA-PSS 3072 bit key with a SHA256 digest. - RSA_SIGN_PSS_3072_SHA256 = 3 - - # RSASSA-PSS 4096 bit key with a SHA256 digest. - RSA_SIGN_PSS_4096_SHA256 = 4 - - # RSASSA-PSS 4096 bit key with a SHA512 digest. - RSA_SIGN_PSS_4096_SHA512 = 15 - - # RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest. - RSA_SIGN_PKCS1_2048_SHA256 = 5 - - # RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest. - RSA_SIGN_PKCS1_3072_SHA256 = 6 - - # RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest. - RSA_SIGN_PKCS1_4096_SHA256 = 7 - - # RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest. - RSA_SIGN_PKCS1_4096_SHA512 = 16 - - # RSASSA-PKCS1-v1_5 signing without encoding, with a 2048 bit key. - RSA_SIGN_RAW_PKCS1_2048 = 28 - - # RSASSA-PKCS1-v1_5 signing without encoding, with a 3072 bit key. - RSA_SIGN_RAW_PKCS1_3072 = 29 - - # RSASSA-PKCS1-v1_5 signing without encoding, with a 4096 bit key. - RSA_SIGN_RAW_PKCS1_4096 = 30 - - # RSAES-OAEP 2048 bit key with a SHA256 digest. - RSA_DECRYPT_OAEP_2048_SHA256 = 8 - - # RSAES-OAEP 3072 bit key with a SHA256 digest. - RSA_DECRYPT_OAEP_3072_SHA256 = 9 - - # RSAES-OAEP 4096 bit key with a SHA256 digest. - RSA_DECRYPT_OAEP_4096_SHA256 = 10 - - # RSAES-OAEP 4096 bit key with a SHA512 digest. - RSA_DECRYPT_OAEP_4096_SHA512 = 17 - - # RSAES-OAEP 2048 bit key with a SHA1 digest. - RSA_DECRYPT_OAEP_2048_SHA1 = 37 - - # RSAES-OAEP 3072 bit key with a SHA1 digest. - RSA_DECRYPT_OAEP_3072_SHA1 = 38 - - # RSAES-OAEP 4096 bit key with a SHA1 digest. - 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 - 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 - 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 - EC_SIGN_SECP256K1_SHA256 = 31 - - # EdDSA on the Curve25519 in pure mode (taking data as input). - EC_SIGN_ED25519 = 40 - - # HMAC-SHA256 signing with a 256 bit key. - HMAC_SHA256 = 32 - - # HMAC-SHA1 signing with a 160 bit key. - HMAC_SHA1 = 33 - - # HMAC-SHA384 signing with a 384 bit key. - HMAC_SHA384 = 34 - - # HMAC-SHA512 signing with a 512 bit key. - HMAC_SHA512 = 35 - - # HMAC-SHA224 signing with a 224 bit key. - HMAC_SHA224 = 36 - - # Algorithm representing symmetric encryption by an external key manager. - EXTERNAL_SYMMETRIC_ENCRYPTION = 18 - - # ML-KEM-768 (FIPS 203) - ML_KEM_768 = 47 - - # ML-KEM-1024 (FIPS 203) - ML_KEM_1024 = 48 - - # X-Wing hybrid KEM combining ML-KEM-768 with X25519 following - # datatracker.ietf.org/doc/draft-connolly-cfrg-xwing-kem/. - KEM_XWING = 63 - - # The post-quantum Module-Lattice-Based Digital Signature Algorithm, at - # security level 3. Randomized version. - PQ_SIGN_ML_DSA_65 = 56 - - # The post-quantum stateless hash-based digital signature algorithm, at - # security level 1. Randomized version. - PQ_SIGN_SLH_DSA_SHA2_128S = 57 - end - - # The state of a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, - # indicating if it can be used. - module CryptoKeyVersionState - # Not specified. - 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 - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} - # as soon as the version is ready. - PENDING_GENERATION = 5 - - # This version may be used for cryptographic operations. - ENABLED = 1 - - # This version may not be used, but the key material is still available, - # and the version can be placed back into the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} - # state. - DISABLED = 2 - - # The key material of this version is destroyed and no longer stored. - # This version may only become - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} - # again if this version is - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#reimport_eligible reimport_eligible} - # and the original key material is reimported with a call to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version KeyManagementService.ImportCryptoKeyVersion}. - DESTROYED = 3 - - # This version is scheduled for destruction, and will be destroyed soon. - # Call - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version RestoreCryptoKeyVersion} - # to put it back into the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED} - # state. - 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 - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} - # as soon as the version is ready. - 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 - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#import_failure_reason CryptoKeyVersion.import_failure_reason}. - IMPORT_FAILED = 7 - - # This version was not generated successfully. It may not be used, enabled, - # disabled, or destroyed. Additional details can be found in - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#generation_failure_reason CryptoKeyVersion.generation_failure_reason}. - 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. - 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 - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#external_destruction_failure_reason CryptoKeyVersion.external_destruction_failure_reason}. - EXTERNAL_DESTRUCTION_FAILED = 10 - end - - # A view for {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}s. - # Controls the level of detail returned for - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} in - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions KeyManagementService.ListCryptoKeyVersions} - # and - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys KeyManagementService.ListCryptoKeys}. - module CryptoKeyVersionView - # Default view for each - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Does not - # include the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#attestation attestation} field. - CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0 - - # Provides all fields in each - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, including the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#attestation attestation}. - FULL = 1 - end - end - - # Data with integrity verification field. - # @!attribute [rw] data - # @return [::String] - # Raw Data. - # @!attribute [rw] crc32c_checksum - # @return [::Google::Protobuf::Int64Value] - # Integrity verification field. A CRC32C - # checksum of the returned - # {::Google::Cloud::Kms::V1::ChecksummedData#data ChecksummedData.data}. An - # integrity check of - # {::Google::Cloud::Kms::V1::ChecksummedData#data ChecksummedData.data} can be - # performed by computing the CRC32C checksum of - # {::Google::Cloud::Kms::V1::ChecksummedData#data ChecksummedData.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. - class ChecksummedData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The public keys for a given - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. Obtained via - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey}. - # @!attribute [rw] pem - # @return [::String] - # 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). - # @!attribute [rw] algorithm - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] - # The - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm Algorithm} - # associated with this key. - # @!attribute [rw] pem_crc32c - # @return [::Google::Protobuf::Int64Value] - # Integrity verification field. A CRC32C checksum of the returned - # {::Google::Cloud::Kms::V1::PublicKey#pem PublicKey.pem}. An integrity check of - # {::Google::Cloud::Kms::V1::PublicKey#pem PublicKey.pem} can be performed by - # computing the CRC32C checksum of - # {::Google::Cloud::Kms::V1::PublicKey#pem 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. - # @!attribute [rw] name - # @return [::String] - # The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key. - # Provided here for verification. - # - # NOTE: This field is in Beta. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key. - # @!attribute [rw] public_key_format - # @return [::Google::Cloud::Kms::V1::PublicKey::PublicKeyFormat] - # The {::Google::Cloud::Kms::V1::PublicKey PublicKey} format specified by the - # customer through the - # {::Google::Cloud::Kms::V1::GetPublicKeyRequest#public_key_format public_key_format} - # field. - # @!attribute [rw] public_key - # @return [::Google::Cloud::Kms::V1::ChecksummedData] - # This field contains the public key (with integrity verification), formatted - # according to the - # {::Google::Cloud::Kms::V1::PublicKey#public_key_format public_key_format} field. - class PublicKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The supported {::Google::Cloud::Kms::V1::PublicKey PublicKey} formats. - module PublicKeyFormat - # If the - # {::Google::Cloud::Kms::V1::GetPublicKeyRequest#public_key_format public_key_format} - # field is not specified: - # - For PQC algorithms, an error will be returned. - # - For non-PQC algorithms, the default format is PEM, and the field - # {::Google::Cloud::Kms::V1::PublicKey#pem pem} will be populated. - # - # Otherwise, the public key will be exported through the - # {::Google::Cloud::Kms::V1::PublicKey#public_key public_key} field in the - # requested format. - PUBLIC_KEY_FORMAT_UNSPECIFIED = 0 - - # The returned public key will be encoded in PEM format. - # See the [RFC7468](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) for more information. - PEM = 1 - - # The returned public key will be encoded in DER format (the - # PrivateKeyInfo structure from RFC 5208). - DER = 2 - - # This is supported only for PQC algorithms. - # The key material is returned in the format defined by NIST PQC - # standards (FIPS 203, FIPS 204, and FIPS 205). - NIST_PQC = 3 - - # The returned public key is in raw bytes format defined in its standard - # https://datatracker.ietf.org/doc/draft-connolly-cfrg-xwing-kem. - XWING_RAW_BYTES = 4 - end - end - - # An {::Google::Cloud::Kms::V1::ImportJob ImportJob} can be used to create - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} and - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} using pre-existing - # key material, generated outside of Cloud KMS. - # - # When an {::Google::Cloud::Kms::V1::ImportJob ImportJob} is created, Cloud KMS will - # generate a "wrapping key", which is a public/private key pair. You use the - # wrapping key to encrypt (also known as wrap) the pre-existing key material to - # protect it during the import process. The nature of the wrapping key depends - # on the choice of - # {::Google::Cloud::Kms::V1::ImportJob#import_method import_method}. When the - # wrapping key generation is complete, the - # {::Google::Cloud::Kms::V1::ImportJob#state state} will be set to - # {::Google::Cloud::Kms::V1::ImportJob::ImportJobState::ACTIVE ACTIVE} and the - # {::Google::Cloud::Kms::V1::ImportJob#public_key public_key} can be fetched. The - # fetched public key can then be used to wrap your pre-existing key material. - # - # Once the key material is wrapped, it can be imported into a new - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in an existing - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} by calling - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version ImportCryptoKeyVersion}. - # Multiple {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} can be - # imported with a single {::Google::Cloud::Kms::V1::ImportJob ImportJob}. Cloud KMS - # uses the private key portion of the wrapping key to unwrap the key material. - # Only Cloud KMS has access to the private key. - # - # An {::Google::Cloud::Kms::V1::ImportJob ImportJob} expires 3 days after it is - # created. Once expired, Cloud KMS will no longer be able to import or unwrap - # any key material that was wrapped with the - # {::Google::Cloud::Kms::V1::ImportJob ImportJob}'s public key. - # - # For more information, see - # [Importing a key](https://cloud.google.com/kms/docs/importing-a-key). - # @!attribute [r] name - # @return [::String] - # Output only. The resource name for this - # {::Google::Cloud::Kms::V1::ImportJob ImportJob} in the format - # `projects/*/locations/*/keyRings/*/importJobs/*`. - # @!attribute [rw] import_method - # @return [::Google::Cloud::Kms::V1::ImportJob::ImportMethod] - # Required. Immutable. The wrapping method to be used for incoming key - # material. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # Required. Immutable. The protection level of the - # {::Google::Cloud::Kms::V1::ImportJob ImportJob}. This must match the - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level} - # of the {::Google::Cloud::Kms::V1::CryptoKey#version_template version_template} - # on the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} you attempt to import - # into. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Kms::V1::ImportJob ImportJob} was created. - # @!attribute [r] generate_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this {::Google::Cloud::Kms::V1::ImportJob ImportJob}'s key - # material was generated. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Kms::V1::ImportJob ImportJob} is scheduled for expiration and - # can no longer be used to import key material. - # @!attribute [r] expire_event_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this {::Google::Cloud::Kms::V1::ImportJob ImportJob} - # expired. Only present if {::Google::Cloud::Kms::V1::ImportJob#state state} is - # {::Google::Cloud::Kms::V1::ImportJob::ImportJobState::EXPIRED EXPIRED}. - # @!attribute [r] state - # @return [::Google::Cloud::Kms::V1::ImportJob::ImportJobState] - # Output only. The current state of the - # {::Google::Cloud::Kms::V1::ImportJob ImportJob}, indicating if it can be used. - # @!attribute [r] public_key - # @return [::Google::Cloud::Kms::V1::ImportJob::WrappingPublicKey] - # Output only. The public key with which to wrap key material prior to - # import. Only returned if {::Google::Cloud::Kms::V1::ImportJob#state state} is - # {::Google::Cloud::Kms::V1::ImportJob::ImportJobState::ACTIVE ACTIVE}. - # @!attribute [r] attestation - # @return [::Google::Cloud::Kms::V1::KeyOperationAttestation] - # 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 - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod ImportMethod} is one with a - # protection level of {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM}. - # @!attribute [rw] crypto_key_backend - # @return [::String] - # Immutable. The resource name of the backend environment where the key - # material for the wrapping key resides and where all related cryptographic - # operations are performed. Currently, this field is only populated for keys - # stored in HSM_SINGLE_TENANT. Note, this list is non-exhaustive and may - # apply to additional {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevels} - # in the future. - # Supported resources: - # * `"projects/*/locations/*/singleTenantHsmInstances/*"` - class ImportJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The public key component of the wrapping key. For details of the type of - # key this public key corresponds to, see the - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod ImportMethod}. - # @!attribute [rw] pem - # @return [::String] - # 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). - class WrappingPublicKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod ImportMethod} describes the - # key wrapping method chosen for this - # {::Google::Cloud::Kms::V1::ImportJob ImportJob}. - module ImportMethod - # Not specified. - 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). - 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). - 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). - 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). - 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. - 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. - RSA_OAEP_4096_SHA256 = 6 - end - - # The state of the {::Google::Cloud::Kms::V1::ImportJob ImportJob}, indicating if - # it can be used. - module ImportJobState - # Not specified. - 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 - # {::Google::Cloud::Kms::V1::ImportJob::ImportJobState::ACTIVE ACTIVE} as soon as - # the wrapping key is generated. - PENDING_GENERATION = 1 - - # This job may be used in - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key CreateCryptoKey} - # and - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} - # requests. - ACTIVE = 2 - - # This job can no longer be used and may not leave this state once entered. - EXPIRED = 3 - end - end - - # ExternalProtectionLevelOptions stores a group of additional fields for - # configuring a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} that - # are specific to the {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL} - # protection level and - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} protection - # levels. - # @!attribute [rw] external_key_uri - # @return [::String] - # The URI for an external resource that this - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} represents. - # @!attribute [rw] ekm_connection_key_path - # @return [::String] - # The path to the external key material on the EKM when using - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} e.g., "v0/my/key". Set - # this field instead of external_key_uri when using an - # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}. - class ExternalProtectionLevelOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A - # {::Google::Cloud::Kms::V1::KeyAccessJustificationsPolicy KeyAccessJustificationsPolicy} - # specifies zero or more allowed - # {::Google::Cloud::Kms::V1::AccessReason AccessReason} values for encrypt, decrypt, - # and sign operations on a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - # @!attribute [rw] allowed_access_reasons - # @return [::Array<::Google::Cloud::Kms::V1::AccessReason>] - # The list of allowed reasons for access to a - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. Zero allowed access reasons - # means all encrypt, decrypt, and sign operations for the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} associated with this policy will - # fail. - class KeyAccessJustificationsPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A RetiredResource resource represents the record of a deleted - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. Its purpose is to provide - # visibility into retained user data and to prevent reuse of these names for - # new {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name for this - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} in the format - # `projects/*/locations/*/retiredResources/*`. - # @!attribute [r] original_resource - # @return [::String] - # Output only. The full resource name of the original - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that was deleted in the format - # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - # @!attribute [r] resource_type - # @return [::String] - # Output only. The resource type of the original deleted resource. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the original resource was deleted and this - # RetiredResource record was created. - class RetiredResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} specifies how - # cryptographic operations are performed. For more information, see [Protection - # levels] (https://cloud.google.com/kms/docs/algorithms#protection_levels). - module ProtectionLevel - # Not specified. - PROTECTION_LEVEL_UNSPECIFIED = 0 - - # Crypto operations are performed in software. - SOFTWARE = 1 - - # Crypto operations are performed in a Hardware Security Module. - HSM = 2 - - # Crypto operations are performed by an external key manager. - EXTERNAL = 3 - - # Crypto operations are performed in an EKM-over-VPC backend. - EXTERNAL_VPC = 4 - - # Crypto operations are performed in a single-tenant HSM. - HSM_SINGLE_TENANT = 5 - end - - # Describes the reason for a data access. Please refer to - # https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes - # for the detailed semantic meaning of justification reason codes. - module AccessReason - # Unspecified access reason. - REASON_UNSPECIFIED = 0 - - # Customer-initiated support. - CUSTOMER_INITIATED_SUPPORT = 1 - - # Google-initiated access for system management and troubleshooting. - GOOGLE_INITIATED_SERVICE = 2 - - # Google-initiated access in response to a legal request or legal process. - THIRD_PARTY_DATA_REQUEST = 3 - - # Google-initiated access for security, fraud, abuse, or compliance purposes. - GOOGLE_INITIATED_REVIEW = 4 - - # Customer uses their account to perform any access to their own data which - # their IAM policy authorizes. - CUSTOMER_INITIATED_ACCESS = 5 - - # Google systems access customer data to help optimize the structure of the - # data or quality for future uses by the customer. - GOOGLE_INITIATED_SYSTEM_OPERATION = 6 - - # No reason is expected for this key request. - REASON_NOT_EXPECTED = 7 - - # Deprecated: This code is no longer generated by - # Google Cloud. The GOOGLE_RESPONSE_TO_PRODUCTION_ALERT justification codes - # available in both Key Access Justifications and Access Transparency logs - # provide customer-visible signals of emergency access in more precise - # contexts. - # - # Customer uses their account to perform any access to their own data which - # their IAM policy authorizes, and one of the following is true: - # - # * A Google administrator has reset the root-access account associated with - # the user's organization within the past 7 days. - # * A Google-initiated emergency access operation has interacted with a - # resource in the same project or folder as the currently accessed resource - # within the past 7 days. - MODIFIED_CUSTOMER_INITIATED_ACCESS = 8 - - # Deprecated: This code is no longer generated by - # Google Cloud. The GOOGLE_RESPONSE_TO_PRODUCTION_ALERT justification codes - # available in both Key Access Justifications and Access Transparency logs - # provide customer-visible signals of emergency access in more precise - # contexts. - # - # Google systems access customer data to help optimize the structure of the - # data or quality for future uses by the customer, and one of the following - # is true: - # - # * A Google administrator has reset the root-access account associated with - # the user's organization within the past 7 days. - # * A Google-initiated emergency access operation has interacted with a - # resource in the same project or folder as the currently accessed resource - # within the past 7 days. - MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION = 9 - - # Google-initiated access to maintain system reliability. - GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 10 - - # One of the following operations is being executed while simultaneously - # encountering an internal technical issue which prevented a more precise - # justification code from being generated: - # - # * Your account has been used to perform any access to your own data which - # your IAM policy authorizes. - # * An automated Google system operates on encrypted customer data which your - # IAM policy authorizes. - # * Customer-initiated Google support access. - # * Google-initiated support access to protect system reliability. - CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING = 11 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb deleted file mode 100644 index d7e4c1a0141b..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/service.rb +++ /dev/null @@ -1,1907 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Kms - module V1 - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings KeyManagementService.ListKeyRings}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format - # `projects/*/locations/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::KeyRing KeyRings} to include in the response. Further - # {::Google::Cloud::Kms::V1::KeyRing KeyRings} can subsequently be obtained by - # including the - # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # 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). - # @!attribute [rw] order_by - # @return [::String] - # 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). - class ListKeyRingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys KeyManagementService.ListCryptoKeys}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} - # to list, in the format `projects/*/locations/*/keyRings/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} to include in the response. - # Further {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} can subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token}. - # @!attribute [rw] version_view - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] - # The fields of the primary version to include in the response. - # @!attribute [rw] filter - # @return [::String] - # 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). - # @!attribute [rw] order_by - # @return [::String] - # 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). - class ListCryptoKeysRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions KeyManagementService.ListCryptoKeyVersions}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to list, in the format - # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} to include in the - # response. Further {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} - # can subsequently be obtained by including the - # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token}. - # @!attribute [rw] view - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView] - # The fields to include in the response. - # @!attribute [rw] filter - # @return [::String] - # 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). - # @!attribute [rw] order_by - # @return [::String] - # 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). - class ListCryptoKeyVersionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_import_jobs KeyManagementService.ListImportJobs}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} - # to list, in the format `projects/*/locations/*/keyRings/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::ImportJob ImportJobs} to include in the response. - # Further {::Google::Cloud::Kms::V1::ImportJob ImportJobs} can subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # 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). - # @!attribute [rw] order_by - # @return [::String] - # 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). - class ListImportJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources KeyManagementService.ListRetiredResources}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project-specific location holding the - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}, in the format - # `projects/*/locations/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Optional limit on the number of - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} to be included in - # the response. Further - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} can subsequently be - # obtained by including the - # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Optional pagination token, returned earlier via - # {::Google::Cloud::Kms::V1::ListRetiredResourcesResponse#next_page_token ListRetiredResourcesResponse.next_page_token}. - class ListRetiredResourcesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings KeyManagementService.ListKeyRings}. - # @!attribute [rw] key_rings - # @return [::Array<::Google::Cloud::Kms::V1::KeyRing>] - # The list of {::Google::Cloud::Kms::V1::KeyRing KeyRings}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Kms::V1::ListKeyRingsRequest#page_token ListKeyRingsRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of {::Google::Cloud::Kms::V1::KeyRing KeyRings} that matched - # the query. - # - # This field is not populated if - # {::Google::Cloud::Kms::V1::ListKeyRingsRequest#filter ListKeyRingsRequest.filter} - # is applied. - class ListKeyRingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys KeyManagementService.ListCryptoKeys}. - # @!attribute [rw] crypto_keys - # @return [::Array<::Google::Cloud::Kms::V1::CryptoKey>] - # The list of {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Kms::V1::ListCryptoKeysRequest#page_token ListCryptoKeysRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} that - # matched the query. - # - # This field is not populated if - # {::Google::Cloud::Kms::V1::ListCryptoKeysRequest#filter ListCryptoKeysRequest.filter} - # is applied. - class ListCryptoKeysResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions KeyManagementService.ListCryptoKeyVersions}. - # @!attribute [rw] crypto_key_versions - # @return [::Array<::Google::Cloud::Kms::V1::CryptoKeyVersion>] - # The list of {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest#page_token ListCryptoKeyVersionsRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} that matched the - # query. - # - # This field is not populated if - # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest#filter ListCryptoKeyVersionsRequest.filter} - # is applied. - class ListCryptoKeyVersionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_import_jobs KeyManagementService.ListImportJobs}. - # @!attribute [rw] import_jobs - # @return [::Array<::Google::Cloud::Kms::V1::ImportJob>] - # The list of {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Kms::V1::ListImportJobsRequest#page_token ListImportJobsRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of {::Google::Cloud::Kms::V1::ImportJob ImportJobs} that - # matched the query. - # - # This field is not populated if - # {::Google::Cloud::Kms::V1::ListImportJobsRequest#filter ListImportJobsRequest.filter} - # is applied. - class ListImportJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources KeyManagementService.ListRetiredResources}. - # @!attribute [rw] retired_resources - # @return [::Array<::Google::Cloud::Kms::V1::RetiredResource>] - # The list of {::Google::Cloud::Kms::V1::RetiredResource RetiredResources}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Pass this value in - # {::Google::Cloud::Kms::V1::ListRetiredResourcesRequest#page_token ListRetiredResourcesRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of {::Google::Cloud::Kms::V1::RetiredResource RetiredResources} - # that matched the query. - class ListRetiredResourcesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_key_ring KeyManagementService.GetKeyRing}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the - # {::Google::Cloud::Kms::V1::KeyRing KeyRing} to get. - class GetKeyRingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key KeyManagementService.GetCryptoKey}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to get. - class GetCryptoKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key_version KeyManagementService.GetCryptoKeyVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to get. - class GetCryptoKeyVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key KeyManagementService.GetPublicKey}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key to get. - # @!attribute [rw] public_key_format - # @return [::Google::Cloud::Kms::V1::PublicKey::PublicKeyFormat] - # Optional. The {::Google::Cloud::Kms::V1::PublicKey PublicKey} format specified - # by the user. This field is required for PQC algorithms. If specified, the - # public key will be exported through the - # {::Google::Cloud::Kms::V1::PublicKey#public_key public_key} field in the - # requested format. Otherwise, the {::Google::Cloud::Kms::V1::PublicKey#pem pem} - # field will be populated for non-PQC algorithms, and an error will be - # returned for PQC algorithms. - class GetPublicKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_import_job KeyManagementService.GetImportJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the - # {::Google::Cloud::Kms::V1::ImportJob ImportJob} to get. - class GetImportJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_retired_resource KeyManagementService.GetRetiredResource}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::RetiredResource#name name} of the - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} to get. - class GetRetiredResourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_key_ring KeyManagementService.CreateKeyRing}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format - # `projects/*/locations/*`. - # @!attribute [rw] key_ring_id - # @return [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @!attribute [rw] key_ring - # @return [::Google::Cloud::Kms::V1::KeyRing] - # Required. A {::Google::Cloud::Kms::V1::KeyRing KeyRing} with initial field - # values. - class CreateKeyRingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key KeyManagementService.CreateCryptoKey}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the KeyRing - # associated with the {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}. - # @!attribute [rw] crypto_key_id - # @return [::String] - # Required. It must be unique within a KeyRing and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @!attribute [rw] crypto_key - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # Required. A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with initial field - # values. - # @!attribute [rw] skip_initial_version_creation - # @return [::Boolean] - # If set to true, the request will create a - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} without any - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. You must - # manually call - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} - # or - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version ImportCryptoKeyVersion} - # before you can use this {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. - class CreateCryptoKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version KeyManagementService.CreateCryptoKeyVersion}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} associated with the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. - # @!attribute [rw] crypto_key_version - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # Required. A {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with - # initial field values. - class CreateCryptoKeyVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key KeyManagementService.DeleteCryptoKey}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to delete. - class DeleteCryptoKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to delete. - class DeleteCryptoKeyVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version KeyManagementService.ImportCryptoKeyVersion}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to be imported into. - # - # The create permission is only required on this key when creating a new - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. - # @!attribute [rw] crypto_key_version - # @return [::String] - # Optional. The optional {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of - # an existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to - # target for an import operation. If this field is not present, a new - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} containing the - # supplied key material is created. - # - # If this field is present, the supplied key material is imported into - # the existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. To - # import into an existing - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} must be a child of - # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#parent ImportCryptoKeyVersionRequest.parent}, - # have been previously created via - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version ImportCryptoKeyVersion}, - # and be in - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED} - # or - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::IMPORT_FAILED IMPORT_FAILED} - # state. The key material and algorithm must match the previous - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} exactly if the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} has ever contained - # key material. - # @!attribute [rw] algorithm - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm] - # Required. The - # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm algorithm} - # of the key being imported. This does not need to match the - # {::Google::Cloud::Kms::V1::CryptoKey#version_template version_template} of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} this version imports into. - # @!attribute [rw] import_job - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the - # {::Google::Cloud::Kms::V1::ImportJob ImportJob} that was used to wrap this key - # material. - # @!attribute [rw] wrapped_key - # @return [::String] - # 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 - # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA1_AES_256 RSA_OAEP_3072_SHA1_AES_256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA1_AES_256 RSA_OAEP_4096_SHA1_AES_256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256_AES_256 RSA_OAEP_3072_SHA256_AES_256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256_AES_256 RSA_OAEP_4096_SHA256_AES_256}), - # - # this field must contain the concatenation of: - #
    - #
  1. An ephemeral AES-256 wrapping key wrapped with the - # {::Google::Cloud::Kms::V1::ImportJob#public_key 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 - # ({::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA256 RSA_OAEP_3072_SHA256} - # or - # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_4096_SHA256 RSA_OAEP_4096_SHA256}), - # - # this field must contain the formatted key to be imported, wrapped with the - # {::Google::Cloud::Kms::V1::ImportJob#public_key public_key} using RSAES-OAEP - # with SHA-256, MGF1 with SHA-256, and an empty label. - # @!attribute [rw] rsa_aes_wrapped_key - # @return [::String] - # Optional. This field has the same meaning as - # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#wrapped_key wrapped_key}. - # Prefer to use that field in new work. Either that field or this field - # (but not both) must be specified. - class ImportCryptoKeyVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_import_job KeyManagementService.CreateImportJob}. - # @!attribute [rw] parent - # @return [::String] - # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the - # {::Google::Cloud::Kms::V1::KeyRing KeyRing} associated with the - # {::Google::Cloud::Kms::V1::ImportJob ImportJobs}. - # @!attribute [rw] import_job_id - # @return [::String] - # Required. It must be unique within a KeyRing and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @!attribute [rw] import_job - # @return [::Google::Cloud::Kms::V1::ImportJob] - # Required. An {::Google::Cloud::Kms::V1::ImportJob ImportJob} with initial field - # values. - class CreateImportJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key KeyManagementService.UpdateCryptoKey}. - # @!attribute [rw] crypto_key - # @return [::Google::Cloud::Kms::V1::CryptoKey] - # Required. {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with updated values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated in this request. - class UpdateCryptoKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_version KeyManagementService.UpdateCryptoKeyVersion}. - # @!attribute [rw] crypto_key_version - # @return [::Google::Cloud::Kms::V1::CryptoKeyVersion] - # Required. {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with - # updated values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated in this request. - class UpdateCryptoKeyVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version KeyManagementService.UpdateCryptoKeyPrimaryVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to update. - # @!attribute [rw] crypto_key_version_id - # @return [::String] - # Required. The id of the child - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use as primary. - class UpdateCryptoKeyPrimaryVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version KeyManagementService.DestroyCryptoKeyVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to destroy. - class DestroyCryptoKeyVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version KeyManagementService.RestoreCryptoKeyVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to restore. - class RestoreCryptoKeyVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt KeyManagementService.Encrypt}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} or - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # encryption. - # - # If a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is specified, the server - # will use its {::Google::Cloud::Kms::V1::CryptoKey#primary primary version}. - # @!attribute [rw] plaintext - # @return [::String] - # Required. The data to encrypt. Must be no larger than 64KiB. - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys, the - # plaintext must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @!attribute [rw] additional_authenticated_data - # @return [::String] - # Optional. Optional data that, if specified, must also be provided during - # decryption through - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}, - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL}, and - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL_VPC EXTERNAL_VPC} keys the - # AAD must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @!attribute [rw] plaintext_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}) - # is equal to - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c 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. - # @!attribute [rw] additional_authenticated_data_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}) - # is equal to - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c 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. - class EncryptRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt KeyManagementService.Decrypt}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to use for decryption. The - # server will choose the appropriate version. - # @!attribute [rw] ciphertext - # @return [::String] - # Required. The encrypted data originally returned in - # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext EncryptResponse.ciphertext}. - # @!attribute [rw] additional_authenticated_data - # @return [::String] - # Optional. Optional data that must match the data originally supplied in - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. - # @!attribute [rw] ciphertext_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}) - # is equal to - # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext_crc32c 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. - # @!attribute [rw] additional_authenticated_data_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}) - # is equal to - # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data_crc32c 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. - class DecryptRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt KeyManagementService.RawEncrypt}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # encryption. - # @!attribute [rw] plaintext - # @return [::String] - # Required. The data to encrypt. Must be no larger than 64KiB. - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the - # plaintext must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @!attribute [rw] additional_authenticated_data - # @return [::String] - # Optional. Optional data that, if specified, must also be provided during - # decryption through - # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. - # - # This field may only be used in conjunction with an - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm} that accepts - # additional authenticated data (for example, AES-GCM). - # - # The maximum size depends on the key version's - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. - # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the - # plaintext must be no larger than 64KiB. For - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of - # the plaintext and additional_authenticated_data fields must be no larger - # than 8KiB. - # @!attribute [rw] plaintext_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext RawEncryptRequest.plaintext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received plaintext using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - # @!attribute [rw] additional_authenticated_data_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received additional_authenticated_data using - # this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - # @!attribute [rw] initialization_vector - # @return [::String] - # 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 - # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. - # @!attribute [rw] initialization_vector_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector RawEncryptRequest.initialization_vector}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received initialization_vector using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - class RawEncryptRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt KeyManagementService.RawDecrypt}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # decryption. - # @!attribute [rw] ciphertext - # @return [::String] - # Required. The encrypted data originally returned in - # {::Google::Cloud::Kms::V1::RawEncryptResponse#ciphertext RawEncryptResponse.ciphertext}. - # @!attribute [rw] additional_authenticated_data - # @return [::String] - # Optional. Optional data that must match the data originally supplied in - # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data RawEncryptRequest.additional_authenticated_data}. - # @!attribute [rw] initialization_vector - # @return [::String] - # Required. The initialization vector (IV) used during encryption, which must - # match the data originally provided in - # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector RawEncryptResponse.initialization_vector}. - # @!attribute [rw] tag_length - # @return [::Integer] - # 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). - # @!attribute [rw] ciphertext_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext RawDecryptRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received ciphertext using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - # @!attribute [rw] additional_authenticated_data_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data RawDecryptRequest.additional_authenticated_data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received additional_authenticated_data using - # this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - # @!attribute [rw] initialization_vector_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector RawDecryptRequest.initialization_vector}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received initialization_vector using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client 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. - class RawDecryptRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign KeyManagementService.AsymmetricSign}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # signing. - # @!attribute [rw] digest - # @return [::Google::Cloud::Kms::V1::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 - # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm}. - # - # This field may not be supplied if - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} - # is supplied. - # @!attribute [rw] digest_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}) - # is equal to - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c 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. - # @!attribute [rw] data - # @return [::String] - # Optional. The data to sign. - # It can't be supplied if - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} - # is supplied. - # @!attribute [rw] data_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}) - # is equal to - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c 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. - class AsymmetricSignRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt KeyManagementService.AsymmetricDecrypt}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # decryption. - # @!attribute [rw] ciphertext - # @return [::String] - # Required. The data encrypted with the named - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s public key using - # OAEP. - # @!attribute [rw] ciphertext_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}) - # is equal to - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c 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. - class AsymmetricDecryptRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign KeyManagementService.MacSign}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # signing. - # @!attribute [rw] data - # @return [::String] - # Required. The data to sign. The MAC tag is computed over this data field - # based on the specific algorithm. - # @!attribute [rw] data_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}. If - # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} - # will verify the integrity of the received - # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} - # will report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}) is - # equal to - # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c 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. - class MacSignRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_verify KeyManagementService.MacVerify}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # verification. - # @!attribute [rw] data - # @return [::String] - # Required. The data used previously as a - # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} to generate - # the MAC tag. - # @!attribute [rw] data_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}. If - # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} - # will verify the integrity of the received - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data} using - # this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}) - # is equal to - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c 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. - # @!attribute [rw] mac - # @return [::String] - # Required. The signature to verify. - # @!attribute [rw] mac_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. An optional CRC32C checksum of the - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}. If - # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} - # will verify the integrity of the received - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac} using this - # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} - # will report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}) is - # equal to - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c 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. - class MacVerifyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate KeyManagementService.Decapsulate}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for - # decapsulation. - # @!attribute [rw] ciphertext - # @return [::String] - # Required. The ciphertext produced from encapsulation with the - # named {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public - # key(s). - # @!attribute [rw] ciphertext_crc32c - # @return [::Google::Protobuf::Int64Value] - # Optional. A CRC32C checksum of the - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}. - # If specified, - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # verify the integrity of the received - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext} - # using this checksum. - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will - # report an error if the checksum verification fails. If you receive a - # checksum error, your client should verify that - # CRC32C({::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext DecapsulateRequest.ciphertext}) - # is equal to - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.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. - class DecapsulateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#generate_random_bytes KeyManagementService.GenerateRandomBytes}. - # @!attribute [rw] location - # @return [::String] - # The project-specific location in which to generate random bytes. - # For example, "projects/my-project/locations/us-central1". - # @!attribute [rw] length_bytes - # @return [::Integer] - # The length in bytes of the amount of randomness to retrieve. Minimum 8 - # bytes, maximum 1024 bytes. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} to use when - # generating the random data. Currently, only - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} protection level is - # supported. - class GenerateRandomBytesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt KeyManagementService.Encrypt}. - # @!attribute [rw] name - # @return [::String] - # The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in - # encryption. Check this field to verify that the intended resource was used - # for encryption. - # @!attribute [rw] ciphertext - # @return [::String] - # The encrypted data. - # @!attribute [rw] ciphertext_crc32c - # @return [::Google::Protobuf::Int64Value] - # Integrity verification field. A CRC32C checksum of the returned - # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext EncryptResponse.ciphertext}. - # An integrity check of - # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext EncryptResponse.ciphertext} - # can be performed by computing the CRC32C checksum of - # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext 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. - # @!attribute [rw] verified_plaintext_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c EncryptRequest.plaintext_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of the - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext plaintext}. A false value of - # this field indicates either that - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c EncryptRequest.plaintext_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c EncryptRequest.plaintext_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] verified_additional_authenticated_data_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c EncryptRequest.additional_authenticated_data_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of the - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data AAD}. A - # false value of this field indicates either that - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c EncryptRequest.additional_authenticated_data_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c EncryptRequest.additional_authenticated_data_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in - # encryption. - class EncryptResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt KeyManagementService.Decrypt}. - # @!attribute [rw] plaintext - # @return [::String] - # The decrypted data originally supplied in - # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}. - # @!attribute [rw] plaintext_crc32c - # @return [::Google::Protobuf::Int64Value] - # Integrity verification field. A CRC32C checksum of the returned - # {::Google::Cloud::Kms::V1::DecryptResponse#plaintext DecryptResponse.plaintext}. - # An integrity check of - # {::Google::Cloud::Kms::V1::DecryptResponse#plaintext DecryptResponse.plaintext} - # can be performed by computing the CRC32C checksum of - # {::Google::Cloud::Kms::V1::DecryptResponse#plaintext 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 - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} is able to - # successfully decrypt the - # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext 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. - # @!attribute [rw] used_primary - # @return [::Boolean] - # Whether the Decryption was performed using the primary key version. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in - # decryption. - class DecryptResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt KeyManagementService.RawEncrypt}. - # @!attribute [rw] ciphertext - # @return [::String] - # The encrypted data. In the case of AES-GCM, the authentication tag - # is the {::Google::Cloud::Kms::V1::RawEncryptResponse#tag_length tag_length} - # bytes at the end of this field. - # @!attribute [rw] initialization_vector - # @return [::String] - # The initialization vector (IV) generated by the service during - # encryption. This value must be stored and provided in - # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector RawDecryptRequest.initialization_vector} - # at decryption time. - # @!attribute [rw] tag_length - # @return [::Integer] - # The length of the authentication tag that is appended to - # the end of the ciphertext. - # @!attribute [rw] ciphertext_crc32c - # @return [::Google::Protobuf::Int64Value] - # Integrity verification field. A CRC32C checksum of the returned - # {::Google::Cloud::Kms::V1::RawEncryptResponse#ciphertext 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. - # @!attribute [rw] initialization_vector_crc32c - # @return [::Google::Protobuf::Int64Value] - # Integrity verification field. A CRC32C checksum of the returned - # {::Google::Cloud::Kms::V1::RawEncryptResponse#initialization_vector 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. - # @!attribute [rw] verified_plaintext_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext_crc32c RawEncryptRequest.plaintext_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of the plaintext. A false value of this - # field indicates either that - # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext_crc32c RawEncryptRequest.plaintext_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::RawEncryptRequest#plaintext_crc32c RawEncryptRequest.plaintext_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] verified_additional_authenticated_data_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data_crc32c RawEncryptRequest.additional_authenticated_data_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of additional_authenticated_data. A false - # value of this field indicates either that // - # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data_crc32c RawEncryptRequest.additional_authenticated_data_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::RawEncryptRequest#additional_authenticated_data_crc32c RawEncryptRequest.additional_authenticated_data_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] verified_initialization_vector_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector_crc32c RawEncryptRequest.initialization_vector_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of initialization_vector. A false value of - # this field indicates either that - # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector_crc32c RawEncryptRequest.initialization_vector_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::RawEncryptRequest#initialization_vector_crc32c RawEncryptRequest.initialization_vector_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] name - # @return [::String] - # The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in - # encryption. Check this field to verify that the intended resource was used - # for encryption. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in - # encryption. - class RawEncryptResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt KeyManagementService.RawDecrypt}. - # @!attribute [rw] plaintext - # @return [::String] - # The decrypted data. - # @!attribute [rw] plaintext_crc32c - # @return [::Google::Protobuf::Int64Value] - # Integrity verification field. A CRC32C checksum of the returned - # {::Google::Cloud::Kms::V1::RawDecryptResponse#plaintext 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 - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} is able to - # successfully decrypt the - # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext 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. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in - # decryption. - # @!attribute [rw] verified_ciphertext_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext_crc32c RawDecryptRequest.ciphertext_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of the ciphertext. A false value of this - # field indicates either that - # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext_crc32c RawDecryptRequest.ciphertext_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::RawDecryptRequest#ciphertext_crc32c RawDecryptRequest.ciphertext_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] verified_additional_authenticated_data_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data_crc32c RawDecryptRequest.additional_authenticated_data_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of additional_authenticated_data. A false - # value of this field indicates either that // - # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data_crc32c RawDecryptRequest.additional_authenticated_data_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::RawDecryptRequest#additional_authenticated_data_crc32c RawDecryptRequest.additional_authenticated_data_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] verified_initialization_vector_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector_crc32c RawDecryptRequest.initialization_vector_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of initialization_vector. A false value of - # this field indicates either that - # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector_crc32c RawDecryptRequest.initialization_vector_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::RawDecryptRequest#initialization_vector_crc32c RawDecryptRequest.initialization_vector_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - class RawDecryptResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign KeyManagementService.AsymmetricSign}. - # @!attribute [rw] signature - # @return [::String] - # The created signature. - # @!attribute [rw] signature_crc32c - # @return [::Google::Protobuf::Int64Value] - # Integrity verification field. A CRC32C checksum of the returned - # {::Google::Cloud::Kms::V1::AsymmetricSignResponse#signature AsymmetricSignResponse.signature}. - # An integrity check of - # {::Google::Cloud::Kms::V1::AsymmetricSignResponse#signature AsymmetricSignResponse.signature} - # can be performed by computing the CRC32C checksum of - # {::Google::Cloud::Kms::V1::AsymmetricSignResponse#signature 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. - # @!attribute [rw] verified_digest_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c AsymmetricSignRequest.digest_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of the - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest digest}. A false value - # of this field indicates either that - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c AsymmetricSignRequest.digest_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c AsymmetricSignRequest.digest_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] name - # @return [::String] - # The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for signing. - # Check this field to verify that the intended resource was used for signing. - # @!attribute [rw] verified_data_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c AsymmetricSignRequest.data_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of the - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data data}. A false value of - # this field indicates either that - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c AsymmetricSignRequest.data_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c AsymmetricSignRequest.data_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for signing. - class AsymmetricSignResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt KeyManagementService.AsymmetricDecrypt}. - # @!attribute [rw] plaintext - # @return [::String] - # The decrypted data originally encrypted with the matching public key. - # @!attribute [rw] plaintext_crc32c - # @return [::Google::Protobuf::Int64Value] - # Integrity verification field. A CRC32C checksum of the returned - # {::Google::Cloud::Kms::V1::AsymmetricDecryptResponse#plaintext AsymmetricDecryptResponse.plaintext}. - # An integrity check of - # {::Google::Cloud::Kms::V1::AsymmetricDecryptResponse#plaintext AsymmetricDecryptResponse.plaintext} - # can be performed by computing the CRC32C checksum of - # {::Google::Cloud::Kms::V1::AsymmetricDecryptResponse#plaintext 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. - # @!attribute [rw] verified_ciphertext_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c AsymmetricDecryptRequest.ciphertext_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of the - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext ciphertext}. A - # false value of this field indicates either that - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c AsymmetricDecryptRequest.ciphertext_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c AsymmetricDecryptRequest.ciphertext_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in - # decryption. - class AsymmetricDecryptResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign KeyManagementService.MacSign}. - # @!attribute [rw] name - # @return [::String] - # The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for signing. - # Check this field to verify that the intended resource was used for signing. - # @!attribute [rw] mac - # @return [::String] - # The created signature. - # @!attribute [rw] mac_crc32c - # @return [::Google::Protobuf::Int64Value] - # Integrity verification field. A CRC32C checksum of the returned - # {::Google::Cloud::Kms::V1::MacSignResponse#mac MacSignResponse.mac}. An - # integrity check of - # {::Google::Cloud::Kms::V1::MacSignResponse#mac MacSignResponse.mac} can be - # performed by computing the CRC32C checksum of - # {::Google::Cloud::Kms::V1::MacSignResponse#mac 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. - # @!attribute [rw] verified_data_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c MacSignRequest.data_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of the - # {::Google::Cloud::Kms::V1::MacSignRequest#data data}. A false value of this - # field indicates either that - # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c MacSignRequest.data_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c MacSignRequest.data_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for signing. - class MacSignResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_verify KeyManagementService.MacVerify}. - # @!attribute [rw] name - # @return [::String] - # The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for - # verification. Check this field to verify that the intended resource was - # used for verification. - # @!attribute [rw] success - # @return [::Boolean] - # This field indicates whether or not the verification operation for - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac} over - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data} was - # successful. - # @!attribute [rw] verified_data_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c MacVerifyRequest.data_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of the - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data data}. A false value of this - # field indicates either that - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c MacVerifyRequest.data_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c MacVerifyRequest.data_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] verified_mac_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c MacVerifyRequest.mac_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of the - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac data}. A false value of this - # field indicates either that - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c MacVerifyRequest.mac_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c MacVerifyRequest.mac_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] verified_success_integrity - # @return [::Boolean] - # 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. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for - # verification. - class MacVerifyResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate KeyManagementService.Decapsulate}. - # @!attribute [rw] name - # @return [::String] - # The resource name of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used for - # decapsulation. Check this field to verify that the intended resource was - # used for decapsulation. - # @!attribute [rw] shared_secret - # @return [::String] - # The decapsulated shared_secret originally encapsulated with the matching - # public key. - # @!attribute [rw] shared_secret_crc32c - # @return [::Integer] - # Integrity verification field. A CRC32C checksum of the returned - # {::Google::Cloud::Kms::V1::DecapsulateResponse#shared_secret DecapsulateResponse.shared_secret}. - # An integrity check of - # {::Google::Cloud::Kms::V1::DecapsulateResponse#shared_secret DecapsulateResponse.shared_secret} - # can be performed by computing the CRC32C checksum of - # {::Google::Cloud::Kms::V1::DecapsulateResponse#shared_secret DecapsulateResponse.shared_secret} - # 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 - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} is able to - # successfully decrypt the - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext 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. - # @!attribute [rw] verified_ciphertext_crc32c - # @return [::Boolean] - # Integrity verification field. A flag indicating whether - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.ciphertext_crc32c} - # was received by - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} and used - # for the integrity verification of the - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext ciphertext}. A false - # value of this field indicates either that - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.ciphertext_crc32c} - # was left unset or that it was not delivered to - # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}. If you've - # set - # {::Google::Cloud::Kms::V1::DecapsulateRequest#ciphertext_crc32c DecapsulateRequest.ciphertext_crc32c} - # but this field is still false, discard the response and perform a limited - # number of retries. - # @!attribute [rw] protection_level - # @return [::Google::Cloud::Kms::V1::ProtectionLevel] - # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} of the - # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} used in - # decapsulation. - class DecapsulateResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#generate_random_bytes KeyManagementService.GenerateRandomBytes}. - # @!attribute [rw] data - # @return [::String] - # The generated data. - # @!attribute [rw] data_crc32c - # @return [::Google::Protobuf::Int64Value] - # Integrity verification field. A CRC32C checksum of the returned - # {::Google::Cloud::Kms::V1::GenerateRandomBytesResponse#data GenerateRandomBytesResponse.data}. - # An integrity check of - # {::Google::Cloud::Kms::V1::GenerateRandomBytesResponse#data GenerateRandomBytesResponse.data} - # can be performed by computing the CRC32C checksum of - # {::Google::Cloud::Kms::V1::GenerateRandomBytesResponse#data 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. - class GenerateRandomBytesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A {::Google::Cloud::Kms::V1::Digest Digest} holds a cryptographic message digest. - # @!attribute [rw] sha256 - # @return [::String] - # A message digest produced with the SHA-256 algorithm. - # - # Note: The following fields are mutually exclusive: `sha256`, `sha384`, `sha512`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] sha384 - # @return [::String] - # A message digest produced with the SHA-384 algorithm. - # - # Note: The following fields are mutually exclusive: `sha384`, `sha256`, `sha512`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] sha512 - # @return [::String] - # A message digest produced with the SHA-512 algorithm. - # - # Note: The following fields are mutually exclusive: `sha512`, `sha256`, `sha384`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Digest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cloud KMS metadata for the given - # [google.cloud.location.Location][google.cloud.location.Location]. - # @!attribute [rw] hsm_available - # @return [::Boolean] - # Indicates whether {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level} - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} can be created in this - # location. - # @!attribute [rw] ekm_available - # @return [::Boolean] - # Indicates whether {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level} - # {::Google::Cloud::Kms::V1::ProtectionLevel::EXTERNAL EXTERNAL} can be created in - # this location. - # @!attribute [rw] hsm_single_tenant_available - # @return [::Boolean] - # Indicates whether {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} with - # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level} - # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM_SINGLE_TENANT HSM_SINGLE_TENANT} - # can be created in this location. - class LocationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key KeyManagementService.DeleteCryptoKey} - # long-running operation. - # @!attribute [r] retired_resource - # @return [::String] - # Output only. The resource name of the - # {::Google::Cloud::Kms::V1::RetiredResource RetiredResource} created as a result - # of this operation, in the format - # `projects/*/locations/*/retiredResources/*`. - class DeleteCryptoKeyMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the - # {::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version KeyManagementService.DeleteCryptoKeyVersion} - # long-running operation. - class DeleteCryptoKeyVersionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 1b485b0c3456..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-kms-v1/snippets/Gemfile deleted file mode 100644 index 98c89139a331..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-kms-v1", path: "../" -else - gem "google-cloud-kms-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/create_key_handle.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/create_key_handle.rb deleted file mode 100644 index 9807ecfd6d41..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/create_key_handle.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_Autokey_CreateKeyHandle_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the create_key_handle call in the Autokey service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::Autokey::Client#create_key_handle. -# -def create_key_handle - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::Autokey::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::CreateKeyHandleRequest.new - - # Call the create_key_handle method. - result = client.create_key_handle request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudkms_v1_generated_Autokey_CreateKeyHandle_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/get_key_handle.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/get_key_handle.rb deleted file mode 100644 index ad2dfdd2d2f6..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/get_key_handle.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_Autokey_GetKeyHandle_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the get_key_handle call in the Autokey service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::Autokey::Client#get_key_handle. -# -def get_key_handle - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::Autokey::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GetKeyHandleRequest.new - - # Call the get_key_handle method. - result = client.get_key_handle request - - # The returned object is of type Google::Cloud::Kms::V1::KeyHandle. - p result -end -# [END cloudkms_v1_generated_Autokey_GetKeyHandle_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/list_key_handles.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/list_key_handles.rb deleted file mode 100644 index bd5d80e61cc6..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey/list_key_handles.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_Autokey_ListKeyHandles_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the list_key_handles call in the Autokey service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::Autokey::Client#list_key_handles. -# -def list_key_handles - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::Autokey::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ListKeyHandlesRequest.new - - # Call the list_key_handles method. - result = client.list_key_handles request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Kms::V1::KeyHandle. - p item - end -end -# [END cloudkms_v1_generated_Autokey_ListKeyHandles_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/get_autokey_config.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/get_autokey_config.rb deleted file mode 100644 index 2bad14b94792..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/get_autokey_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the get_autokey_config call in the AutokeyAdmin service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::AutokeyAdmin::Client#get_autokey_config. -# -def get_autokey_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new - - # Call the get_autokey_config method. - result = client.get_autokey_config request - - # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. - p result -end -# [END cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/show_effective_autokey_config.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/show_effective_autokey_config.rb deleted file mode 100644 index 4b92b55e18c8..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/show_effective_autokey_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_AutokeyAdmin_ShowEffectiveAutokeyConfig_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the show_effective_autokey_config call in the AutokeyAdmin service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config. -# -def show_effective_autokey_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new - - # Call the show_effective_autokey_config method. - result = client.show_effective_autokey_config request - - # The returned object is of type Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse. - p result -end -# [END cloudkms_v1_generated_AutokeyAdmin_ShowEffectiveAutokeyConfig_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/update_autokey_config.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/update_autokey_config.rb deleted file mode 100644 index 5fa43287ea04..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/autokey_admin/update_autokey_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_AutokeyAdmin_UpdateAutokeyConfig_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the update_autokey_config call in the AutokeyAdmin service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config. -# -def update_autokey_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::AutokeyAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new - - # Call the update_autokey_config method. - result = client.update_autokey_config request - - # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig. - p result -end -# [END cloudkms_v1_generated_AutokeyAdmin_UpdateAutokeyConfig_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb deleted file mode 100644 index ec27b6df3f7f..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_EkmService_CreateEkmConnection_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the create_ekm_connection call in the EkmService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::EkmService::Client#create_ekm_connection. -# -def create_ekm_connection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::EkmService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new - - # Call the create_ekm_connection method. - result = client.create_ekm_connection request - - # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. - p result -end -# [END cloudkms_v1_generated_EkmService_CreateEkmConnection_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_config.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_config.rb deleted file mode 100644 index f5ff174a38d6..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_EkmService_GetEkmConfig_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the get_ekm_config call in the EkmService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::EkmService::Client#get_ekm_config. -# -def get_ekm_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::EkmService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GetEkmConfigRequest.new - - # Call the get_ekm_config method. - result = client.get_ekm_config request - - # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. - p result -end -# [END cloudkms_v1_generated_EkmService_GetEkmConfig_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb deleted file mode 100644 index 8d053d252aa8..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_EkmService_GetEkmConnection_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the get_ekm_connection call in the EkmService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::EkmService::Client#get_ekm_connection. -# -def get_ekm_connection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::EkmService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GetEkmConnectionRequest.new - - # Call the get_ekm_connection method. - result = client.get_ekm_connection request - - # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. - p result -end -# [END cloudkms_v1_generated_EkmService_GetEkmConnection_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb deleted file mode 100644 index be9c3b272b35..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_EkmService_ListEkmConnections_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the list_ekm_connections call in the EkmService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::EkmService::Client#list_ekm_connections. -# -def list_ekm_connections - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::EkmService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new - - # Call the list_ekm_connections method. - result = client.list_ekm_connections request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Kms::V1::EkmConnection. - p item - end -end -# [END cloudkms_v1_generated_EkmService_ListEkmConnections_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_config.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_config.rb deleted file mode 100644 index ac08cf508839..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_EkmService_UpdateEkmConfig_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the update_ekm_config call in the EkmService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::EkmService::Client#update_ekm_config. -# -def update_ekm_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::EkmService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new - - # Call the update_ekm_config method. - result = client.update_ekm_config request - - # The returned object is of type Google::Cloud::Kms::V1::EkmConfig. - p result -end -# [END cloudkms_v1_generated_EkmService_UpdateEkmConfig_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb deleted file mode 100644 index a9755b7323ca..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_EkmService_UpdateEkmConnection_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the update_ekm_connection call in the EkmService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::EkmService::Client#update_ekm_connection. -# -def update_ekm_connection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::EkmService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new - - # Call the update_ekm_connection method. - result = client.update_ekm_connection request - - # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. - p result -end -# [END cloudkms_v1_generated_EkmService_UpdateEkmConnection_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/verify_connectivity.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/verify_connectivity.rb deleted file mode 100644 index bcd0bb46d6e7..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/ekm_service/verify_connectivity.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_EkmService_VerifyConnectivity_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the verify_connectivity call in the EkmService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::EkmService::Client#verify_connectivity. -# -def verify_connectivity - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::EkmService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::VerifyConnectivityRequest.new - - # Call the verify_connectivity method. - result = client.verify_connectivity request - - # The returned object is of type Google::Cloud::Kms::V1::VerifyConnectivityResponse. - p result -end -# [END cloudkms_v1_generated_EkmService_VerifyConnectivity_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/approve_single_tenant_hsm_instance_proposal.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/approve_single_tenant_hsm_instance_proposal.rb deleted file mode 100644 index 77a998e4b5cd..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/approve_single_tenant_hsm_instance_proposal.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_HsmManagement_ApproveSingleTenantHsmInstanceProposal_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the approve_single_tenant_hsm_instance_proposal call in the HsmManagement service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::HsmManagement::Client#approve_single_tenant_hsm_instance_proposal. -# -def approve_single_tenant_hsm_instance_proposal - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::HsmManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new - - # Call the approve_single_tenant_hsm_instance_proposal method. - result = client.approve_single_tenant_hsm_instance_proposal request - - # The returned object is of type Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse. - p result -end -# [END cloudkms_v1_generated_HsmManagement_ApproveSingleTenantHsmInstanceProposal_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance.rb deleted file mode 100644 index 2df459816670..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstance_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the create_single_tenant_hsm_instance call in the HsmManagement service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance. -# -def create_single_tenant_hsm_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::HsmManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new - - # Call the create_single_tenant_hsm_instance method. - result = client.create_single_tenant_hsm_instance request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstance_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance_proposal.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance_proposal.rb deleted file mode 100644 index 9e6556d7eae3..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/create_single_tenant_hsm_instance_proposal.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstanceProposal_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the create_single_tenant_hsm_instance_proposal call in the HsmManagement service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal. -# -def create_single_tenant_hsm_instance_proposal - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::HsmManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new - - # Call the create_single_tenant_hsm_instance_proposal method. - result = client.create_single_tenant_hsm_instance_proposal request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstanceProposal_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/delete_single_tenant_hsm_instance_proposal.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/delete_single_tenant_hsm_instance_proposal.rb deleted file mode 100644 index 21d71b99870d..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/delete_single_tenant_hsm_instance_proposal.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_HsmManagement_DeleteSingleTenantHsmInstanceProposal_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the delete_single_tenant_hsm_instance_proposal call in the HsmManagement service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::HsmManagement::Client#delete_single_tenant_hsm_instance_proposal. -# -def delete_single_tenant_hsm_instance_proposal - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::HsmManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new - - # Call the delete_single_tenant_hsm_instance_proposal method. - result = client.delete_single_tenant_hsm_instance_proposal request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudkms_v1_generated_HsmManagement_DeleteSingleTenantHsmInstanceProposal_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/execute_single_tenant_hsm_instance_proposal.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/execute_single_tenant_hsm_instance_proposal.rb deleted file mode 100644 index ead2fc3f2199..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/execute_single_tenant_hsm_instance_proposal.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_HsmManagement_ExecuteSingleTenantHsmInstanceProposal_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the execute_single_tenant_hsm_instance_proposal call in the HsmManagement service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal. -# -def execute_single_tenant_hsm_instance_proposal - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::HsmManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new - - # Call the execute_single_tenant_hsm_instance_proposal method. - result = client.execute_single_tenant_hsm_instance_proposal request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudkms_v1_generated_HsmManagement_ExecuteSingleTenantHsmInstanceProposal_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance.rb deleted file mode 100644 index c963d5607da0..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstance_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the get_single_tenant_hsm_instance call in the HsmManagement service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance. -# -def get_single_tenant_hsm_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::HsmManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new - - # Call the get_single_tenant_hsm_instance method. - result = client.get_single_tenant_hsm_instance request - - # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstance. - p result -end -# [END cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstance_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance_proposal.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance_proposal.rb deleted file mode 100644 index f89d87e097e9..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/get_single_tenant_hsm_instance_proposal.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstanceProposal_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the get_single_tenant_hsm_instance_proposal call in the HsmManagement service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance_proposal. -# -def get_single_tenant_hsm_instance_proposal - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::HsmManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new - - # Call the get_single_tenant_hsm_instance_proposal method. - result = client.get_single_tenant_hsm_instance_proposal request - - # The returned object is of type Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. - p result -end -# [END cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstanceProposal_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instance_proposals.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instance_proposals.rb deleted file mode 100644 index 55a42124c7ef..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instance_proposals.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstanceProposals_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the list_single_tenant_hsm_instance_proposals call in the HsmManagement service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals. -# -def list_single_tenant_hsm_instance_proposals - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::HsmManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new - - # Call the list_single_tenant_hsm_instance_proposals method. - result = client.list_single_tenant_hsm_instance_proposals request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal. - p item - end -end -# [END cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstanceProposals_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instances.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instances.rb deleted file mode 100644 index df085be0417e..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/hsm_management/list_single_tenant_hsm_instances.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstances_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the list_single_tenant_hsm_instances call in the HsmManagement service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances. -# -def list_single_tenant_hsm_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::HsmManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new - - # Call the list_single_tenant_hsm_instances method. - result = client.list_single_tenant_hsm_instances request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Kms::V1::SingleTenantHsmInstance. - p item - end -end -# [END cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstances_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb deleted file mode 100644 index 0f3a0732da95..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_AsymmetricDecrypt_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the asymmetric_decrypt call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt. -# -def asymmetric_decrypt - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new - - # Call the asymmetric_decrypt method. - result = client.asymmetric_decrypt request - - # The returned object is of type Google::Cloud::Kms::V1::AsymmetricDecryptResponse. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_AsymmetricDecrypt_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb deleted file mode 100644 index 01b0ff3723a2..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_AsymmetricSign_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the asymmetric_sign call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign. -# -def asymmetric_sign - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::AsymmetricSignRequest.new - - # Call the asymmetric_sign method. - result = client.asymmetric_sign request - - # The returned object is of type Google::Cloud::Kms::V1::AsymmetricSignResponse. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_AsymmetricSign_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb deleted file mode 100644 index ae957f4881e2..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_CreateCryptoKey_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the create_crypto_key call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key. -# -def create_crypto_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new - - # Call the create_crypto_key method. - result = client.create_crypto_key request - - # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_CreateCryptoKey_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb deleted file mode 100644 index 46142b493c33..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_CreateCryptoKeyVersion_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the create_crypto_key_version call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version. -# -def create_crypto_key_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new - - # Call the create_crypto_key_version method. - result = client.create_crypto_key_version request - - # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_CreateCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb deleted file mode 100644 index 3e6695419037..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_CreateImportJob_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the create_import_job call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#create_import_job. -# -def create_import_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::CreateImportJobRequest.new - - # Call the create_import_job method. - result = client.create_import_job request - - # The returned object is of type Google::Cloud::Kms::V1::ImportJob. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_CreateImportJob_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb deleted file mode 100644 index b575b8dc1ff7..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_CreateKeyRing_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the create_key_ring call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#create_key_ring. -# -def create_key_ring - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::CreateKeyRingRequest.new - - # Call the create_key_ring method. - result = client.create_key_ring request - - # The returned object is of type Google::Cloud::Kms::V1::KeyRing. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_CreateKeyRing_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decapsulate.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decapsulate.rb deleted file mode 100644 index 149baf282bb0..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decapsulate.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_Decapsulate_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the decapsulate call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate. -# -def decapsulate - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::DecapsulateRequest.new - - # Call the decapsulate method. - result = client.decapsulate request - - # The returned object is of type Google::Cloud::Kms::V1::DecapsulateResponse. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_Decapsulate_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb deleted file mode 100644 index 1e6504ccf66f..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_Decrypt_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the decrypt call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt. -# -def decrypt - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::DecryptRequest.new - - # Call the decrypt method. - result = client.decrypt request - - # The returned object is of type Google::Cloud::Kms::V1::DecryptResponse. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_Decrypt_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb deleted file mode 100644 index 94ebe1d38021..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_DestroyCryptoKeyVersion_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the destroy_crypto_key_version call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version. -# -def destroy_crypto_key_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new - - # Call the destroy_crypto_key_version method. - result = client.destroy_crypto_key_version request - - # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_DestroyCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb deleted file mode 100644 index 5a1ed5e33ba4..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_Encrypt_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the encrypt call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt. -# -def encrypt - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::EncryptRequest.new - - # Call the encrypt method. - result = client.encrypt request - - # The returned object is of type Google::Cloud::Kms::V1::EncryptResponse. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_Encrypt_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb deleted file mode 100644 index 30b4a16192cb..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_GenerateRandomBytes_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the generate_random_bytes call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#generate_random_bytes. -# -def generate_random_bytes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new - - # Call the generate_random_bytes method. - result = client.generate_random_bytes request - - # The returned object is of type Google::Cloud::Kms::V1::GenerateRandomBytesResponse. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_GenerateRandomBytes_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb deleted file mode 100644 index 2174b3dc805d..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_GetCryptoKey_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the get_crypto_key call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key. -# -def get_crypto_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GetCryptoKeyRequest.new - - # Call the get_crypto_key method. - result = client.get_crypto_key request - - # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_GetCryptoKey_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb deleted file mode 100644 index a4a97d77248c..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_GetCryptoKeyVersion_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the get_crypto_key_version call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key_version. -# -def get_crypto_key_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new - - # Call the get_crypto_key_version method. - result = client.get_crypto_key_version request - - # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_GetCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb deleted file mode 100644 index b639a6385621..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_GetImportJob_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the get_import_job call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#get_import_job. -# -def get_import_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GetImportJobRequest.new - - # Call the get_import_job method. - result = client.get_import_job request - - # The returned object is of type Google::Cloud::Kms::V1::ImportJob. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_GetImportJob_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb deleted file mode 100644 index 71ad0602045f..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_GetKeyRing_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the get_key_ring call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#get_key_ring. -# -def get_key_ring - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GetKeyRingRequest.new - - # Call the get_key_ring method. - result = client.get_key_ring request - - # The returned object is of type Google::Cloud::Kms::V1::KeyRing. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_GetKeyRing_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb deleted file mode 100644 index 7e8309a3e369..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_GetPublicKey_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the get_public_key call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key. -# -def get_public_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::GetPublicKeyRequest.new - - # Call the get_public_key method. - result = client.get_public_key request - - # The returned object is of type Google::Cloud::Kms::V1::PublicKey. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_GetPublicKey_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb deleted file mode 100644 index d05ba0ef9746..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_ImportCryptoKeyVersion_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the import_crypto_key_version call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version. -# -def import_crypto_key_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new - - # Call the import_crypto_key_version method. - result = client.import_crypto_key_version request - - # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_ImportCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb deleted file mode 100644 index 5b9dc78c108b..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_ListCryptoKeyVersions_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the list_crypto_key_versions call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions. -# -def list_crypto_key_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new - - # Call the list_crypto_key_versions method. - result = client.list_crypto_key_versions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Kms::V1::CryptoKeyVersion. - p item - end -end -# [END cloudkms_v1_generated_KeyManagementService_ListCryptoKeyVersions_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb deleted file mode 100644 index 4e7f54324c02..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_ListCryptoKeys_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the list_crypto_keys call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys. -# -def list_crypto_keys - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ListCryptoKeysRequest.new - - # Call the list_crypto_keys method. - result = client.list_crypto_keys request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Kms::V1::CryptoKey. - p item - end -end -# [END cloudkms_v1_generated_KeyManagementService_ListCryptoKeys_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb deleted file mode 100644 index b7cfa58bbb95..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_ListImportJobs_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the list_import_jobs call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#list_import_jobs. -# -def list_import_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ListImportJobsRequest.new - - # Call the list_import_jobs method. - result = client.list_import_jobs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Kms::V1::ImportJob. - p item - end -end -# [END cloudkms_v1_generated_KeyManagementService_ListImportJobs_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb deleted file mode 100644 index c3665776e625..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_ListKeyRings_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the list_key_rings call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings. -# -def list_key_rings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::ListKeyRingsRequest.new - - # Call the list_key_rings method. - result = client.list_key_rings request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Kms::V1::KeyRing. - p item - end -end -# [END cloudkms_v1_generated_KeyManagementService_ListKeyRings_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb deleted file mode 100644 index 9d3718d85179..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_MacSign_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the mac_sign call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign. -# -def mac_sign - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::MacSignRequest.new - - # Call the mac_sign method. - result = client.mac_sign request - - # The returned object is of type Google::Cloud::Kms::V1::MacSignResponse. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_MacSign_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb deleted file mode 100644 index 65a343b47ee8..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_MacVerify_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the mac_verify call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#mac_verify. -# -def mac_verify - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::MacVerifyRequest.new - - # Call the mac_verify method. - result = client.mac_verify request - - # The returned object is of type Google::Cloud::Kms::V1::MacVerifyResponse. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_MacVerify_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_decrypt.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_decrypt.rb deleted file mode 100644 index f54f0801674d..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_decrypt.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_RawDecrypt_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the raw_decrypt call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt. -# -def raw_decrypt - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::RawDecryptRequest.new - - # Call the raw_decrypt method. - result = client.raw_decrypt request - - # The returned object is of type Google::Cloud::Kms::V1::RawDecryptResponse. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_RawDecrypt_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_encrypt.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_encrypt.rb deleted file mode 100644 index 1bdf56170b0f..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/raw_encrypt.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_RawEncrypt_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the raw_encrypt call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt. -# -def raw_encrypt - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::RawEncryptRequest.new - - # Call the raw_encrypt method. - result = client.raw_encrypt request - - # The returned object is of type Google::Cloud::Kms::V1::RawEncryptResponse. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_RawEncrypt_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb deleted file mode 100644 index d0a409277146..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_RestoreCryptoKeyVersion_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the restore_crypto_key_version call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version. -# -def restore_crypto_key_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new - - # Call the restore_crypto_key_version method. - result = client.restore_crypto_key_version request - - # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_RestoreCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb deleted file mode 100644 index 6899ea887f88..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_UpdateCryptoKey_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the update_crypto_key call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key. -# -def update_crypto_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new - - # Call the update_crypto_key method. - result = client.update_crypto_key request - - # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKey_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb deleted file mode 100644 index b8fb6fa24b78..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the update_crypto_key_primary_version call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version. -# -def update_crypto_key_primary_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new - - # Call the update_crypto_key_primary_version method. - result = client.update_crypto_key_primary_version request - - # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb b/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb deleted file mode 100644 index e41e9f84cdd2..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyVersion_sync] -require "google/cloud/kms/v1" - -## -# Snippet for the update_crypto_key_version call in the KeyManagementService service -# -# This snippet 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 as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_version. -# -def update_crypto_key_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Kms::V1::KeyManagementService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new - - # Call the update_crypto_key_version method. - result = client.update_crypto_key_version request - - # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. - p result -end -# [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyVersion_sync] diff --git a/owl-bot-staging/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json b/owl-bot-staging/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json deleted file mode 100644 index ee286d53d09d..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json +++ /dev/null @@ -1,2215 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-kms-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.kms.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudkms_v1_generated_Autokey_CreateKeyHandle_sync", - "title": "Snippet for the create_key_handle call in the Autokey service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::Autokey::Client#create_key_handle.", - "file": "autokey/create_key_handle.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_key_handle", - "full_name": "::Google::Cloud::Kms::V1::Autokey::Client#create_key_handle", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::CreateKeyHandleRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Autokey::Client", - "full_name": "::Google::Cloud::Kms::V1::Autokey::Client" - }, - "method": { - "short_name": "CreateKeyHandle", - "full_name": "google.cloud.kms.v1.Autokey.CreateKeyHandle", - "service": { - "short_name": "Autokey", - "full_name": "google.cloud.kms.v1.Autokey" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_Autokey_GetKeyHandle_sync", - "title": "Snippet for the get_key_handle call in the Autokey service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::Autokey::Client#get_key_handle.", - "file": "autokey/get_key_handle.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_key_handle", - "full_name": "::Google::Cloud::Kms::V1::Autokey::Client#get_key_handle", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetKeyHandleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::KeyHandle", - "client": { - "short_name": "Autokey::Client", - "full_name": "::Google::Cloud::Kms::V1::Autokey::Client" - }, - "method": { - "short_name": "GetKeyHandle", - "full_name": "google.cloud.kms.v1.Autokey.GetKeyHandle", - "service": { - "short_name": "Autokey", - "full_name": "google.cloud.kms.v1.Autokey" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_Autokey_ListKeyHandles_sync", - "title": "Snippet for the list_key_handles call in the Autokey service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::Autokey::Client#list_key_handles.", - "file": "autokey/list_key_handles.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_key_handles", - "full_name": "::Google::Cloud::Kms::V1::Autokey::Client#list_key_handles", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ListKeyHandlesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ListKeyHandlesResponse", - "client": { - "short_name": "Autokey::Client", - "full_name": "::Google::Cloud::Kms::V1::Autokey::Client" - }, - "method": { - "short_name": "ListKeyHandles", - "full_name": "google.cloud.kms.v1.Autokey.ListKeyHandles", - "service": { - "short_name": "Autokey", - "full_name": "google.cloud.kms.v1.Autokey" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_AutokeyAdmin_UpdateAutokeyConfig_sync", - "title": "Snippet for the update_autokey_config call in the AutokeyAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config.", - "file": "autokey_admin/update_autokey_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_autokey_config", - "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client#update_autokey_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::AutokeyConfig", - "client": { - "short_name": "AutokeyAdmin::Client", - "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client" - }, - "method": { - "short_name": "UpdateAutokeyConfig", - "full_name": "google.cloud.kms.v1.AutokeyAdmin.UpdateAutokeyConfig", - "service": { - "short_name": "AutokeyAdmin", - "full_name": "google.cloud.kms.v1.AutokeyAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync", - "title": "Snippet for the get_autokey_config call in the AutokeyAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::AutokeyAdmin::Client#get_autokey_config.", - "file": "autokey_admin/get_autokey_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_autokey_config", - "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client#get_autokey_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetAutokeyConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::AutokeyConfig", - "client": { - "short_name": "AutokeyAdmin::Client", - "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client" - }, - "method": { - "short_name": "GetAutokeyConfig", - "full_name": "google.cloud.kms.v1.AutokeyAdmin.GetAutokeyConfig", - "service": { - "short_name": "AutokeyAdmin", - "full_name": "google.cloud.kms.v1.AutokeyAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_AutokeyAdmin_ShowEffectiveAutokeyConfig_sync", - "title": "Snippet for the show_effective_autokey_config call in the AutokeyAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config.", - "file": "autokey_admin/show_effective_autokey_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "show_effective_autokey_config", - "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client#show_effective_autokey_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse", - "client": { - "short_name": "AutokeyAdmin::Client", - "full_name": "::Google::Cloud::Kms::V1::AutokeyAdmin::Client" - }, - "method": { - "short_name": "ShowEffectiveAutokeyConfig", - "full_name": "google.cloud.kms.v1.AutokeyAdmin.ShowEffectiveAutokeyConfig", - "service": { - "short_name": "AutokeyAdmin", - "full_name": "google.cloud.kms.v1.AutokeyAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_EkmService_ListEkmConnections_sync", - "title": "Snippet for the list_ekm_connections call in the EkmService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#list_ekm_connections.", - "file": "ekm_service/list_ekm_connections.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_ekm_connections", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#list_ekm_connections", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ListEkmConnectionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ListEkmConnectionsResponse", - "client": { - "short_name": "EkmService::Client", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" - }, - "method": { - "short_name": "ListEkmConnections", - "full_name": "google.cloud.kms.v1.EkmService.ListEkmConnections", - "service": { - "short_name": "EkmService", - "full_name": "google.cloud.kms.v1.EkmService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_EkmService_GetEkmConnection_sync", - "title": "Snippet for the get_ekm_connection call in the EkmService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#get_ekm_connection.", - "file": "ekm_service/get_ekm_connection.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_ekm_connection", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#get_ekm_connection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetEkmConnectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::EkmConnection", - "client": { - "short_name": "EkmService::Client", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" - }, - "method": { - "short_name": "GetEkmConnection", - "full_name": "google.cloud.kms.v1.EkmService.GetEkmConnection", - "service": { - "short_name": "EkmService", - "full_name": "google.cloud.kms.v1.EkmService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_EkmService_CreateEkmConnection_sync", - "title": "Snippet for the create_ekm_connection call in the EkmService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#create_ekm_connection.", - "file": "ekm_service/create_ekm_connection.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_ekm_connection", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#create_ekm_connection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::CreateEkmConnectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::EkmConnection", - "client": { - "short_name": "EkmService::Client", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" - }, - "method": { - "short_name": "CreateEkmConnection", - "full_name": "google.cloud.kms.v1.EkmService.CreateEkmConnection", - "service": { - "short_name": "EkmService", - "full_name": "google.cloud.kms.v1.EkmService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_EkmService_UpdateEkmConnection_sync", - "title": "Snippet for the update_ekm_connection call in the EkmService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#update_ekm_connection.", - "file": "ekm_service/update_ekm_connection.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_ekm_connection", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#update_ekm_connection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::EkmConnection", - "client": { - "short_name": "EkmService::Client", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" - }, - "method": { - "short_name": "UpdateEkmConnection", - "full_name": "google.cloud.kms.v1.EkmService.UpdateEkmConnection", - "service": { - "short_name": "EkmService", - "full_name": "google.cloud.kms.v1.EkmService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_EkmService_GetEkmConfig_sync", - "title": "Snippet for the get_ekm_config call in the EkmService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#get_ekm_config.", - "file": "ekm_service/get_ekm_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_ekm_config", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#get_ekm_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetEkmConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::EkmConfig", - "client": { - "short_name": "EkmService::Client", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" - }, - "method": { - "short_name": "GetEkmConfig", - "full_name": "google.cloud.kms.v1.EkmService.GetEkmConfig", - "service": { - "short_name": "EkmService", - "full_name": "google.cloud.kms.v1.EkmService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_EkmService_UpdateEkmConfig_sync", - "title": "Snippet for the update_ekm_config call in the EkmService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#update_ekm_config.", - "file": "ekm_service/update_ekm_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_ekm_config", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#update_ekm_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::UpdateEkmConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::EkmConfig", - "client": { - "short_name": "EkmService::Client", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" - }, - "method": { - "short_name": "UpdateEkmConfig", - "full_name": "google.cloud.kms.v1.EkmService.UpdateEkmConfig", - "service": { - "short_name": "EkmService", - "full_name": "google.cloud.kms.v1.EkmService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_EkmService_VerifyConnectivity_sync", - "title": "Snippet for the verify_connectivity call in the EkmService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::EkmService::Client#verify_connectivity.", - "file": "ekm_service/verify_connectivity.rb", - "language": "RUBY", - "client_method": { - "short_name": "verify_connectivity", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client#verify_connectivity", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::VerifyConnectivityRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::VerifyConnectivityResponse", - "client": { - "short_name": "EkmService::Client", - "full_name": "::Google::Cloud::Kms::V1::EkmService::Client" - }, - "method": { - "short_name": "VerifyConnectivity", - "full_name": "google.cloud.kms.v1.EkmService.VerifyConnectivity", - "service": { - "short_name": "EkmService", - "full_name": "google.cloud.kms.v1.EkmService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstances_sync", - "title": "Snippet for the list_single_tenant_hsm_instances call in the HsmManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances.", - "file": "hsm_management/list_single_tenant_hsm_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_single_tenant_hsm_instances", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse", - "client": { - "short_name": "HsmManagement::Client", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" - }, - "method": { - "short_name": "ListSingleTenantHsmInstances", - "full_name": "google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstances", - "service": { - "short_name": "HsmManagement", - "full_name": "google.cloud.kms.v1.HsmManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstance_sync", - "title": "Snippet for the get_single_tenant_hsm_instance call in the HsmManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance.", - "file": "hsm_management/get_single_tenant_hsm_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_single_tenant_hsm_instance", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::SingleTenantHsmInstance", - "client": { - "short_name": "HsmManagement::Client", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" - }, - "method": { - "short_name": "GetSingleTenantHsmInstance", - "full_name": "google.cloud.kms.v1.HsmManagement.GetSingleTenantHsmInstance", - "service": { - "short_name": "HsmManagement", - "full_name": "google.cloud.kms.v1.HsmManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstance_sync", - "title": "Snippet for the create_single_tenant_hsm_instance call in the HsmManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance.", - "file": "hsm_management/create_single_tenant_hsm_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_single_tenant_hsm_instance", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "HsmManagement::Client", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" - }, - "method": { - "short_name": "CreateSingleTenantHsmInstance", - "full_name": "google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstance", - "service": { - "short_name": "HsmManagement", - "full_name": "google.cloud.kms.v1.HsmManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_HsmManagement_CreateSingleTenantHsmInstanceProposal_sync", - "title": "Snippet for the create_single_tenant_hsm_instance_proposal call in the HsmManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal.", - "file": "hsm_management/create_single_tenant_hsm_instance_proposal.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_single_tenant_hsm_instance_proposal", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#create_single_tenant_hsm_instance_proposal", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "HsmManagement::Client", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" - }, - "method": { - "short_name": "CreateSingleTenantHsmInstanceProposal", - "full_name": "google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstanceProposal", - "service": { - "short_name": "HsmManagement", - "full_name": "google.cloud.kms.v1.HsmManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_HsmManagement_ApproveSingleTenantHsmInstanceProposal_sync", - "title": "Snippet for the approve_single_tenant_hsm_instance_proposal call in the HsmManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#approve_single_tenant_hsm_instance_proposal.", - "file": "hsm_management/approve_single_tenant_hsm_instance_proposal.rb", - "language": "RUBY", - "client_method": { - "short_name": "approve_single_tenant_hsm_instance_proposal", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#approve_single_tenant_hsm_instance_proposal", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse", - "client": { - "short_name": "HsmManagement::Client", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" - }, - "method": { - "short_name": "ApproveSingleTenantHsmInstanceProposal", - "full_name": "google.cloud.kms.v1.HsmManagement.ApproveSingleTenantHsmInstanceProposal", - "service": { - "short_name": "HsmManagement", - "full_name": "google.cloud.kms.v1.HsmManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_HsmManagement_ExecuteSingleTenantHsmInstanceProposal_sync", - "title": "Snippet for the execute_single_tenant_hsm_instance_proposal call in the HsmManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal.", - "file": "hsm_management/execute_single_tenant_hsm_instance_proposal.rb", - "language": "RUBY", - "client_method": { - "short_name": "execute_single_tenant_hsm_instance_proposal", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#execute_single_tenant_hsm_instance_proposal", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "HsmManagement::Client", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" - }, - "method": { - "short_name": "ExecuteSingleTenantHsmInstanceProposal", - "full_name": "google.cloud.kms.v1.HsmManagement.ExecuteSingleTenantHsmInstanceProposal", - "service": { - "short_name": "HsmManagement", - "full_name": "google.cloud.kms.v1.HsmManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_HsmManagement_GetSingleTenantHsmInstanceProposal_sync", - "title": "Snippet for the get_single_tenant_hsm_instance_proposal call in the HsmManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance_proposal.", - "file": "hsm_management/get_single_tenant_hsm_instance_proposal.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_single_tenant_hsm_instance_proposal", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#get_single_tenant_hsm_instance_proposal", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal", - "client": { - "short_name": "HsmManagement::Client", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" - }, - "method": { - "short_name": "GetSingleTenantHsmInstanceProposal", - "full_name": "google.cloud.kms.v1.HsmManagement.GetSingleTenantHsmInstanceProposal", - "service": { - "short_name": "HsmManagement", - "full_name": "google.cloud.kms.v1.HsmManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_HsmManagement_ListSingleTenantHsmInstanceProposals_sync", - "title": "Snippet for the list_single_tenant_hsm_instance_proposals call in the HsmManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals.", - "file": "hsm_management/list_single_tenant_hsm_instance_proposals.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_single_tenant_hsm_instance_proposals", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#list_single_tenant_hsm_instance_proposals", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse", - "client": { - "short_name": "HsmManagement::Client", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" - }, - "method": { - "short_name": "ListSingleTenantHsmInstanceProposals", - "full_name": "google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstanceProposals", - "service": { - "short_name": "HsmManagement", - "full_name": "google.cloud.kms.v1.HsmManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_HsmManagement_DeleteSingleTenantHsmInstanceProposal_sync", - "title": "Snippet for the delete_single_tenant_hsm_instance_proposal call in the HsmManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::HsmManagement::Client#delete_single_tenant_hsm_instance_proposal.", - "file": "hsm_management/delete_single_tenant_hsm_instance_proposal.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_single_tenant_hsm_instance_proposal", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client#delete_single_tenant_hsm_instance_proposal", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "HsmManagement::Client", - "full_name": "::Google::Cloud::Kms::V1::HsmManagement::Client" - }, - "method": { - "short_name": "DeleteSingleTenantHsmInstanceProposal", - "full_name": "google.cloud.kms.v1.HsmManagement.DeleteSingleTenantHsmInstanceProposal", - "service": { - "short_name": "HsmManagement", - "full_name": "google.cloud.kms.v1.HsmManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_ListKeyRings_sync", - "title": "Snippet for the list_key_rings call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings.", - "file": "key_management_service/list_key_rings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_key_rings", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ListKeyRingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ListKeyRingsResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "ListKeyRings", - "full_name": "google.cloud.kms.v1.KeyManagementService.ListKeyRings", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_ListCryptoKeys_sync", - "title": "Snippet for the list_crypto_keys call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys.", - "file": "key_management_service/list_crypto_keys.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_crypto_keys", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ListCryptoKeysRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ListCryptoKeysResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "ListCryptoKeys", - "full_name": "google.cloud.kms.v1.KeyManagementService.ListCryptoKeys", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_ListCryptoKeyVersions_sync", - "title": "Snippet for the list_crypto_key_versions call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions.", - "file": "key_management_service/list_crypto_key_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_crypto_key_versions", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "ListCryptoKeyVersions", - "full_name": "google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersions", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_ListImportJobs_sync", - "title": "Snippet for the list_import_jobs call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#list_import_jobs.", - "file": "key_management_service/list_import_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_import_jobs", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#list_import_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ListImportJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ListImportJobsResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "ListImportJobs", - "full_name": "google.cloud.kms.v1.KeyManagementService.ListImportJobs", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_ListRetiredResources_sync", - "title": "Snippet for the list_retired_resources call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources.", - "file": "key_management_service/list_retired_resources.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_retired_resources", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#list_retired_resources", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ListRetiredResourcesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ListRetiredResourcesResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "ListRetiredResources", - "full_name": "google.cloud.kms.v1.KeyManagementService.ListRetiredResources", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_GetKeyRing_sync", - "title": "Snippet for the get_key_ring call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_key_ring.", - "file": "key_management_service/get_key_ring.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_key_ring", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_key_ring", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetKeyRingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::KeyRing", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "GetKeyRing", - "full_name": "google.cloud.kms.v1.KeyManagementService.GetKeyRing", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_GetCryptoKey_sync", - "title": "Snippet for the get_crypto_key call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key.", - "file": "key_management_service/get_crypto_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_crypto_key", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetCryptoKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::CryptoKey", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "GetCryptoKey", - "full_name": "google.cloud.kms.v1.KeyManagementService.GetCryptoKey", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_GetCryptoKeyVersion_sync", - "title": "Snippet for the get_crypto_key_version call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key_version.", - "file": "key_management_service/get_crypto_key_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_crypto_key_version", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "GetCryptoKeyVersion", - "full_name": "google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersion", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_GetPublicKey_sync", - "title": "Snippet for the get_public_key call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key.", - "file": "key_management_service/get_public_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_public_key", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetPublicKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::PublicKey", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "GetPublicKey", - "full_name": "google.cloud.kms.v1.KeyManagementService.GetPublicKey", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_GetImportJob_sync", - "title": "Snippet for the get_import_job call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_import_job.", - "file": "key_management_service/get_import_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_import_job", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_import_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetImportJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ImportJob", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "GetImportJob", - "full_name": "google.cloud.kms.v1.KeyManagementService.GetImportJob", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_GetRetiredResource_sync", - "title": "Snippet for the get_retired_resource call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#get_retired_resource.", - "file": "key_management_service/get_retired_resource.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_retired_resource", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#get_retired_resource", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GetRetiredResourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::RetiredResource", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "GetRetiredResource", - "full_name": "google.cloud.kms.v1.KeyManagementService.GetRetiredResource", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_CreateKeyRing_sync", - "title": "Snippet for the create_key_ring call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#create_key_ring.", - "file": "key_management_service/create_key_ring.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_key_ring", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#create_key_ring", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::CreateKeyRingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::KeyRing", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "CreateKeyRing", - "full_name": "google.cloud.kms.v1.KeyManagementService.CreateKeyRing", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_CreateCryptoKey_sync", - "title": "Snippet for the create_crypto_key call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key.", - "file": "key_management_service/create_crypto_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_crypto_key", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::CreateCryptoKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::CryptoKey", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "CreateCryptoKey", - "full_name": "google.cloud.kms.v1.KeyManagementService.CreateCryptoKey", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_CreateCryptoKeyVersion_sync", - "title": "Snippet for the create_crypto_key_version call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version.", - "file": "key_management_service/create_crypto_key_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_crypto_key_version", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "CreateCryptoKeyVersion", - "full_name": "google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_DeleteCryptoKey_sync", - "title": "Snippet for the delete_crypto_key call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key.", - "file": "key_management_service/delete_crypto_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_crypto_key", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "DeleteCryptoKey", - "full_name": "google.cloud.kms.v1.KeyManagementService.DeleteCryptoKey", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_DeleteCryptoKeyVersion_sync", - "title": "Snippet for the delete_crypto_key_version call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version.", - "file": "key_management_service/delete_crypto_key_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_crypto_key_version", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#delete_crypto_key_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "DeleteCryptoKeyVersion", - "full_name": "google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_ImportCryptoKeyVersion_sync", - "title": "Snippet for the import_crypto_key_version call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version.", - "file": "key_management_service/import_crypto_key_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_crypto_key_version", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "ImportCryptoKeyVersion", - "full_name": "google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_CreateImportJob_sync", - "title": "Snippet for the create_import_job call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#create_import_job.", - "file": "key_management_service/create_import_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_import_job", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#create_import_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::CreateImportJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::ImportJob", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "CreateImportJob", - "full_name": "google.cloud.kms.v1.KeyManagementService.CreateImportJob", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_UpdateCryptoKey_sync", - "title": "Snippet for the update_crypto_key call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key.", - "file": "key_management_service/update_crypto_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_crypto_key", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::CryptoKey", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "UpdateCryptoKey", - "full_name": "google.cloud.kms.v1.KeyManagementService.UpdateCryptoKey", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyVersion_sync", - "title": "Snippet for the update_crypto_key_version call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_version.", - "file": "key_management_service/update_crypto_key_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_crypto_key_version", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "UpdateCryptoKeyVersion", - "full_name": "google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyVersion", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync", - "title": "Snippet for the update_crypto_key_primary_version call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version.", - "file": "key_management_service/update_crypto_key_primary_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_crypto_key_primary_version", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::CryptoKey", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "UpdateCryptoKeyPrimaryVersion", - "full_name": "google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_DestroyCryptoKeyVersion_sync", - "title": "Snippet for the destroy_crypto_key_version call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version.", - "file": "key_management_service/destroy_crypto_key_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "destroy_crypto_key_version", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "DestroyCryptoKeyVersion", - "full_name": "google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_RestoreCryptoKeyVersion_sync", - "title": "Snippet for the restore_crypto_key_version call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version.", - "file": "key_management_service/restore_crypto_key_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "restore_crypto_key_version", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::CryptoKeyVersion", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "RestoreCryptoKeyVersion", - "full_name": "google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_Encrypt_sync", - "title": "Snippet for the encrypt call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt.", - "file": "key_management_service/encrypt.rb", - "language": "RUBY", - "client_method": { - "short_name": "encrypt", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::EncryptRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::EncryptResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "Encrypt", - "full_name": "google.cloud.kms.v1.KeyManagementService.Encrypt", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_Decrypt_sync", - "title": "Snippet for the decrypt call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt.", - "file": "key_management_service/decrypt.rb", - "language": "RUBY", - "client_method": { - "short_name": "decrypt", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::DecryptRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::DecryptResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "Decrypt", - "full_name": "google.cloud.kms.v1.KeyManagementService.Decrypt", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_RawEncrypt_sync", - "title": "Snippet for the raw_encrypt call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt.", - "file": "key_management_service/raw_encrypt.rb", - "language": "RUBY", - "client_method": { - "short_name": "raw_encrypt", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_encrypt", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::RawEncryptRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::RawEncryptResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "RawEncrypt", - "full_name": "google.cloud.kms.v1.KeyManagementService.RawEncrypt", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_RawDecrypt_sync", - "title": "Snippet for the raw_decrypt call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt.", - "file": "key_management_service/raw_decrypt.rb", - "language": "RUBY", - "client_method": { - "short_name": "raw_decrypt", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#raw_decrypt", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::RawDecryptRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::RawDecryptResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "RawDecrypt", - "full_name": "google.cloud.kms.v1.KeyManagementService.RawDecrypt", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_AsymmetricSign_sync", - "title": "Snippet for the asymmetric_sign call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign.", - "file": "key_management_service/asymmetric_sign.rb", - "language": "RUBY", - "client_method": { - "short_name": "asymmetric_sign", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::AsymmetricSignRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::AsymmetricSignResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "AsymmetricSign", - "full_name": "google.cloud.kms.v1.KeyManagementService.AsymmetricSign", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_AsymmetricDecrypt_sync", - "title": "Snippet for the asymmetric_decrypt call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt.", - "file": "key_management_service/asymmetric_decrypt.rb", - "language": "RUBY", - "client_method": { - "short_name": "asymmetric_decrypt", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::AsymmetricDecryptRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::AsymmetricDecryptResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "AsymmetricDecrypt", - "full_name": "google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_MacSign_sync", - "title": "Snippet for the mac_sign call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign.", - "file": "key_management_service/mac_sign.rb", - "language": "RUBY", - "client_method": { - "short_name": "mac_sign", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::MacSignRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::MacSignResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "MacSign", - "full_name": "google.cloud.kms.v1.KeyManagementService.MacSign", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_MacVerify_sync", - "title": "Snippet for the mac_verify call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#mac_verify.", - "file": "key_management_service/mac_verify.rb", - "language": "RUBY", - "client_method": { - "short_name": "mac_verify", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#mac_verify", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::MacVerifyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::MacVerifyResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "MacVerify", - "full_name": "google.cloud.kms.v1.KeyManagementService.MacVerify", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_Decapsulate_sync", - "title": "Snippet for the decapsulate call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate.", - "file": "key_management_service/decapsulate.rb", - "language": "RUBY", - "client_method": { - "short_name": "decapsulate", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#decapsulate", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::DecapsulateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::DecapsulateResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "Decapsulate", - "full_name": "google.cloud.kms.v1.KeyManagementService.Decapsulate", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudkms_v1_generated_KeyManagementService_GenerateRandomBytes_sync", - "title": "Snippet for the generate_random_bytes call in the KeyManagementService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Kms::V1::KeyManagementService::Client#generate_random_bytes.", - "file": "key_management_service/generate_random_bytes.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_random_bytes", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client#generate_random_bytes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Kms::V1::GenerateRandomBytesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Kms::V1::GenerateRandomBytesResponse", - "client": { - "short_name": "KeyManagementService::Client", - "full_name": "::Google::Cloud::Kms::V1::KeyManagementService::Client" - }, - "method": { - "short_name": "GenerateRandomBytes", - "full_name": "google.cloud.kms.v1.KeyManagementService.GenerateRandomBytes", - "service": { - "short_name": "KeyManagementService", - "full_name": "google.cloud.kms.v1.KeyManagementService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_paths_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_paths_test.rb deleted file mode 100644 index 0515bb01330e..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_paths_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/autokey_admin" - -class ::Google::Cloud::Kms::V1::AutokeyAdmin::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_autokey_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.autokey_config_path folder: "value0" - assert_equal "folders/value0/autokeyConfig", path - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_rest_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_rest_test.rb deleted file mode 100644 index 7817898e9446..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_rest_test.rb +++ /dev/null @@ -1,262 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/kms/v1/autokey_admin_pb" -require "google/cloud/kms/v1/autokey_admin/rest" - - -class ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_update_autokey_config - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::AutokeyConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - autokey_config = {} - update_mask = {} - - update_autokey_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::ServiceStub.stub :transcode_update_autokey_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_autokey_config_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_autokey_config({ autokey_config: autokey_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_autokey_config autokey_config: autokey_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_autokey_config ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new(autokey_config: autokey_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_autokey_config({ autokey_config: autokey_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_autokey_config(::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new(autokey_config: autokey_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_autokey_config_client_stub.call_count - end - end - end - - def test_get_autokey_config - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::AutokeyConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_autokey_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::ServiceStub.stub :transcode_get_autokey_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_autokey_config_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_autokey_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_autokey_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_autokey_config ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_autokey_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_autokey_config(::Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_autokey_config_client_stub.call_count - end - end - end - - def test_show_effective_autokey_config - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - show_effective_autokey_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::ServiceStub.stub :transcode_show_effective_autokey_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, show_effective_autokey_config_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.show_effective_autokey_config({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.show_effective_autokey_config parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.show_effective_autokey_config ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.show_effective_autokey_config({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.show_effective_autokey_config(::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, show_effective_autokey_config_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_test.rb deleted file mode 100644 index 2261dc12af95..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_admin_test.rb +++ /dev/null @@ -1,280 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/autokey_admin_pb" -require "google/cloud/kms/v1/autokey_admin" - -class ::Google::Cloud::Kms::V1::AutokeyAdmin::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_update_autokey_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::AutokeyConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - autokey_config = {} - update_mask = {} - - update_autokey_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_autokey_config, name - assert_kind_of ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::AutokeyConfig), request["autokey_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_autokey_config_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_autokey_config({ autokey_config: autokey_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_autokey_config autokey_config: autokey_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_autokey_config ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new(autokey_config: autokey_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_autokey_config({ autokey_config: autokey_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_autokey_config(::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new(autokey_config: autokey_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_autokey_config_client_stub.call_rpc_count - end - end - - def test_get_autokey_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::AutokeyConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_autokey_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_autokey_config, name - assert_kind_of ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_autokey_config_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_autokey_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_autokey_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_autokey_config ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_autokey_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_autokey_config(::Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_autokey_config_client_stub.call_rpc_count - end - end - - def test_show_effective_autokey_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - show_effective_autokey_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :show_effective_autokey_config, name - assert_kind_of ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, show_effective_autokey_config_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.show_effective_autokey_config({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.show_effective_autokey_config parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.show_effective_autokey_config ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.show_effective_autokey_config({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.show_effective_autokey_config(::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new(parent: parent), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, show_effective_autokey_config_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::AutokeyAdmin::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Kms::V1::AutokeyAdmin::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_operations_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_operations_test.rb deleted file mode 100644 index 6fa64dd74514..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/autokey_pb" -require "google/cloud/kms/v1/autokey_services_pb" -require "google/cloud/kms/v1/autokey" - -class ::Google::Cloud::Kms::V1::Autokey::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::Autokey::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::Autokey::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_paths_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_paths_test.rb deleted file mode 100644 index 15fcba8550f9..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/autokey" - -class ::Google::Cloud::Kms::V1::Autokey::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_crypto_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path - end - end - - def test_key_handle_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.key_handle_path project: "value0", location: "value1", key_handle: "value2" - assert_equal "projects/value0/locations/value1/keyHandles/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_rest_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_rest_test.rb deleted file mode 100644 index 46fd4448816b..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_rest_test.rb +++ /dev/null @@ -1,266 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/kms/v1/autokey_pb" -require "google/cloud/kms/v1/autokey/rest" - - -class ::Google::Cloud::Kms::V1::Autokey::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_key_handle - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - key_handle_id = "hello world" - key_handle = {} - - create_key_handle_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::Autokey::Rest::ServiceStub.stub :transcode_create_key_handle_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_key_handle_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_key_handle({ parent: parent, key_handle_id: key_handle_id, key_handle: key_handle }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_key_handle parent: parent, key_handle_id: key_handle_id, key_handle: key_handle do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_key_handle ::Google::Cloud::Kms::V1::CreateKeyHandleRequest.new(parent: parent, key_handle_id: key_handle_id, key_handle: key_handle) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_key_handle({ parent: parent, key_handle_id: key_handle_id, key_handle: key_handle }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_key_handle(::Google::Cloud::Kms::V1::CreateKeyHandleRequest.new(parent: parent, key_handle_id: key_handle_id, key_handle: key_handle), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_key_handle_client_stub.call_count - end - end - end - - def test_get_key_handle - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::KeyHandle.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_key_handle_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::Autokey::Rest::ServiceStub.stub :transcode_get_key_handle_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_key_handle_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_key_handle({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_key_handle name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_key_handle ::Google::Cloud::Kms::V1::GetKeyHandleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_key_handle({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_key_handle(::Google::Cloud::Kms::V1::GetKeyHandleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_key_handle_client_stub.call_count - end - end - end - - def test_list_key_handles - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ListKeyHandlesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_key_handles_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::Autokey::Rest::ServiceStub.stub :transcode_list_key_handles_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_key_handles_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_key_handles({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_key_handles parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_key_handles ::Google::Cloud::Kms::V1::ListKeyHandlesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_key_handles({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_key_handles(::Google::Cloud::Kms::V1::ListKeyHandlesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_key_handles_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::Autokey::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::Autokey::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_test.rb deleted file mode 100644 index 9078f4afd48d..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/autokey_test.rb +++ /dev/null @@ -1,312 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/autokey_pb" -require "google/cloud/kms/v1/autokey" - -class ::Google::Cloud::Kms::V1::Autokey::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_key_handle - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - key_handle_id = "hello world" - key_handle = {} - - create_key_handle_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_key_handle, name - assert_kind_of ::Google::Cloud::Kms::V1::CreateKeyHandleRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["key_handle_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::KeyHandle), request["key_handle"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_key_handle_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_key_handle({ parent: parent, key_handle_id: key_handle_id, key_handle: key_handle }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_key_handle parent: parent, key_handle_id: key_handle_id, key_handle: key_handle do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_key_handle ::Google::Cloud::Kms::V1::CreateKeyHandleRequest.new(parent: parent, key_handle_id: key_handle_id, key_handle: key_handle) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_key_handle({ parent: parent, key_handle_id: key_handle_id, key_handle: key_handle }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_key_handle(::Google::Cloud::Kms::V1::CreateKeyHandleRequest.new(parent: parent, key_handle_id: key_handle_id, key_handle: key_handle), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_key_handle_client_stub.call_rpc_count - end - end - - def test_get_key_handle - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::KeyHandle.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_key_handle_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_key_handle, name - assert_kind_of ::Google::Cloud::Kms::V1::GetKeyHandleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_key_handle_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_key_handle({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_key_handle name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_key_handle ::Google::Cloud::Kms::V1::GetKeyHandleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_key_handle({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_key_handle(::Google::Cloud::Kms::V1::GetKeyHandleRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_key_handle_client_stub.call_rpc_count - end - end - - def test_list_key_handles - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ListKeyHandlesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_key_handles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_key_handles, name - assert_kind_of ::Google::Cloud::Kms::V1::ListKeyHandlesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_key_handles_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_key_handles({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_key_handles parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_key_handles ::Google::Cloud::Kms::V1::ListKeyHandlesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_key_handles({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_key_handles(::Google::Cloud::Kms::V1::ListKeyHandlesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_key_handles_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::Autokey::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Kms::V1::Autokey::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::Autokey::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Kms::V1::Autokey::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb deleted file mode 100644 index 17d9d7b401c7..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/ekm_service" - -class ::Google::Cloud::Kms::V1::EkmService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_ekm_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.ekm_config_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/ekmConfig", path - end - end - - def test_ekm_connection_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.ekm_connection_path project: "value0", location: "value1", ekm_connection: "value2" - assert_equal "projects/value0/locations/value1/ekmConnections/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" - assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb deleted file mode 100644 index 75d141e73f4f..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb +++ /dev/null @@ -1,485 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/kms/v1/ekm_service_pb" -require "google/cloud/kms/v1/ekm_service/rest" - - -class ::Google::Cloud::Kms::V1::EkmService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_ekm_connections - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ListEkmConnectionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_ekm_connections_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_list_ekm_connections_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_ekm_connections_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_ekm_connections({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_ekm_connections parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_ekm_connections ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_ekm_connections({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_ekm_connections(::Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_ekm_connections_client_stub.call_count - end - end - end - - def test_get_ekm_connection - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::EkmConnection.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_ekm_connection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_get_ekm_connection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_ekm_connection_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_ekm_connection({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_ekm_connection name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_ekm_connection ::Google::Cloud::Kms::V1::GetEkmConnectionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_ekm_connection({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_ekm_connection(::Google::Cloud::Kms::V1::GetEkmConnectionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_ekm_connection_client_stub.call_count - end - end - end - - def test_create_ekm_connection - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::EkmConnection.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - ekm_connection_id = "hello world" - ekm_connection = {} - - create_ekm_connection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_create_ekm_connection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_ekm_connection_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_ekm_connection({ parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_ekm_connection parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_ekm_connection ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new(parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_ekm_connection({ parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_ekm_connection(::Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new(parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_ekm_connection_client_stub.call_count - end - end - end - - def test_update_ekm_connection - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::EkmConnection.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - ekm_connection = {} - update_mask = {} - - update_ekm_connection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_update_ekm_connection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_ekm_connection_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_ekm_connection({ ekm_connection: ekm_connection, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_ekm_connection ekm_connection: ekm_connection, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_ekm_connection ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new(ekm_connection: ekm_connection, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_ekm_connection({ ekm_connection: ekm_connection, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_ekm_connection(::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new(ekm_connection: ekm_connection, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_ekm_connection_client_stub.call_count - end - end - end - - def test_get_ekm_config - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::EkmConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_ekm_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_get_ekm_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_ekm_config_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_ekm_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_ekm_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_ekm_config ::Google::Cloud::Kms::V1::GetEkmConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_ekm_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_ekm_config(::Google::Cloud::Kms::V1::GetEkmConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_ekm_config_client_stub.call_count - end - end - end - - def test_update_ekm_config - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::EkmConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - ekm_config = {} - update_mask = {} - - update_ekm_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_update_ekm_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_ekm_config_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_ekm_config({ ekm_config: ekm_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_ekm_config ekm_config: ekm_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_ekm_config ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new(ekm_config: ekm_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_ekm_config({ ekm_config: ekm_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_ekm_config(::Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new(ekm_config: ekm_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_ekm_config_client_stub.call_count - end - end - end - - def test_verify_connectivity - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::VerifyConnectivityResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - verify_connectivity_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.stub :transcode_verify_connectivity_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, verify_connectivity_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.verify_connectivity({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.verify_connectivity name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.verify_connectivity ::Google::Cloud::Kms::V1::VerifyConnectivityRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.verify_connectivity({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.verify_connectivity(::Google::Cloud::Kms::V1::VerifyConnectivityRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, verify_connectivity_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::EkmService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb deleted file mode 100644 index 8d6b3e9152f2..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb +++ /dev/null @@ -1,531 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/ekm_service_pb" -require "google/cloud/kms/v1/ekm_service" - -class ::Google::Cloud::Kms::V1::EkmService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_ekm_connections - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ListEkmConnectionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_ekm_connections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_ekm_connections, name - assert_kind_of ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_ekm_connections_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_ekm_connections({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_ekm_connections parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_ekm_connections ::Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_ekm_connections({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_ekm_connections(::Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_ekm_connections_client_stub.call_rpc_count - end - end - - def test_get_ekm_connection - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::EkmConnection.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_ekm_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_ekm_connection, name - assert_kind_of ::Google::Cloud::Kms::V1::GetEkmConnectionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_ekm_connection_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_ekm_connection({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_ekm_connection name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_ekm_connection ::Google::Cloud::Kms::V1::GetEkmConnectionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_ekm_connection({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_ekm_connection(::Google::Cloud::Kms::V1::GetEkmConnectionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_ekm_connection_client_stub.call_rpc_count - end - end - - def test_create_ekm_connection - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::EkmConnection.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - ekm_connection_id = "hello world" - ekm_connection = {} - - create_ekm_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_ekm_connection, name - assert_kind_of ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["ekm_connection_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::EkmConnection), request["ekm_connection"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_ekm_connection_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_ekm_connection({ parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_ekm_connection parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_ekm_connection ::Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new(parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_ekm_connection({ parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_ekm_connection(::Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new(parent: parent, ekm_connection_id: ekm_connection_id, ekm_connection: ekm_connection), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_ekm_connection_client_stub.call_rpc_count - end - end - - def test_update_ekm_connection - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::EkmConnection.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - ekm_connection = {} - update_mask = {} - - update_ekm_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_ekm_connection, name - assert_kind_of ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::EkmConnection), request["ekm_connection"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_ekm_connection_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_ekm_connection({ ekm_connection: ekm_connection, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_ekm_connection ekm_connection: ekm_connection, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_ekm_connection ::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new(ekm_connection: ekm_connection, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_ekm_connection({ ekm_connection: ekm_connection, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_ekm_connection(::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new(ekm_connection: ekm_connection, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_ekm_connection_client_stub.call_rpc_count - end - end - - def test_get_ekm_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::EkmConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_ekm_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_ekm_config, name - assert_kind_of ::Google::Cloud::Kms::V1::GetEkmConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_ekm_config_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_ekm_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_ekm_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_ekm_config ::Google::Cloud::Kms::V1::GetEkmConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_ekm_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_ekm_config(::Google::Cloud::Kms::V1::GetEkmConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_ekm_config_client_stub.call_rpc_count - end - end - - def test_update_ekm_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::EkmConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - ekm_config = {} - update_mask = {} - - update_ekm_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_ekm_config, name - assert_kind_of ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::EkmConfig), request["ekm_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_ekm_config_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_ekm_config({ ekm_config: ekm_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_ekm_config ekm_config: ekm_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_ekm_config ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new(ekm_config: ekm_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_ekm_config({ ekm_config: ekm_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_ekm_config(::Google::Cloud::Kms::V1::UpdateEkmConfigRequest.new(ekm_config: ekm_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_ekm_config_client_stub.call_rpc_count - end - end - - def test_verify_connectivity - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::VerifyConnectivityResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - verify_connectivity_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :verify_connectivity, name - assert_kind_of ::Google::Cloud::Kms::V1::VerifyConnectivityRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, verify_connectivity_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.verify_connectivity({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.verify_connectivity name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.verify_connectivity ::Google::Cloud::Kms::V1::VerifyConnectivityRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.verify_connectivity({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.verify_connectivity(::Google::Cloud::Kms::V1::VerifyConnectivityRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, verify_connectivity_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::EkmService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Kms::V1::EkmService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_operations_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_operations_test.rb deleted file mode 100644 index dc9c54502ebc..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/hsm_management_pb" -require "google/cloud/kms/v1/hsm_management_services_pb" -require "google/cloud/kms/v1/hsm_management" - -class ::Google::Cloud::Kms::V1::HsmManagement::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::HsmManagement::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::HsmManagement::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_paths_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_paths_test.rb deleted file mode 100644 index ab8276bcff2b..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/hsm_management" - -class ::Google::Cloud::Kms::V1::HsmManagement::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_single_tenant_hsm_instance_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.single_tenant_hsm_instance_path project: "value0", location: "value1", single_tenant_hsm_instance: "value2" - assert_equal "projects/value0/locations/value1/singleTenantHsmInstances/value2", path - end - end - - def test_single_tenant_hsm_instance_proposal_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.single_tenant_hsm_instance_proposal_path project: "value0", location: "value1", single_tenant_hsm_instance: "value2", proposal: "value3" - assert_equal "projects/value0/locations/value1/singleTenantHsmInstances/value2/proposals/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_rest_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_rest_test.rb deleted file mode 100644 index 731fe88066c6..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_rest_test.rb +++ /dev/null @@ -1,600 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/kms/v1/hsm_management_pb" -require "google/cloud/kms/v1/hsm_management/rest" - - -class ::Google::Cloud::Kms::V1::HsmManagement::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_single_tenant_hsm_instances - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - show_deleted = true - - list_single_tenant_hsm_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_list_single_tenant_hsm_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_single_tenant_hsm_instances_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_single_tenant_hsm_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_single_tenant_hsm_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_single_tenant_hsm_instances ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_single_tenant_hsm_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_single_tenant_hsm_instances(::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_single_tenant_hsm_instances_client_stub.call_count - end - end - end - - def test_get_single_tenant_hsm_instance - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::SingleTenantHsmInstance.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_single_tenant_hsm_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_get_single_tenant_hsm_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_single_tenant_hsm_instance_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_single_tenant_hsm_instance({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_single_tenant_hsm_instance name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_single_tenant_hsm_instance ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_single_tenant_hsm_instance({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_single_tenant_hsm_instance(::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_single_tenant_hsm_instance_client_stub.call_count - end - end - end - - def test_create_single_tenant_hsm_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - single_tenant_hsm_instance_id = "hello world" - single_tenant_hsm_instance = {} - - create_single_tenant_hsm_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_create_single_tenant_hsm_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_single_tenant_hsm_instance_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_single_tenant_hsm_instance({ parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_single_tenant_hsm_instance parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_single_tenant_hsm_instance ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new(parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_single_tenant_hsm_instance({ parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_single_tenant_hsm_instance(::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new(parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_single_tenant_hsm_instance_client_stub.call_count - end - end - end - - def test_create_single_tenant_hsm_instance_proposal - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - single_tenant_hsm_instance_proposal_id = "hello world" - single_tenant_hsm_instance_proposal = {} - - create_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_create_single_tenant_hsm_instance_proposal_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_single_tenant_hsm_instance_proposal_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_single_tenant_hsm_instance_proposal({ parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_single_tenant_hsm_instance_proposal parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new(parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_single_tenant_hsm_instance_proposal({ parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new(parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_single_tenant_hsm_instance_proposal_client_stub.call_count - end - end - end - - def test_approve_single_tenant_hsm_instance_proposal - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - quorum_reply = {} - - approve_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_approve_single_tenant_hsm_instance_proposal_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, approve_single_tenant_hsm_instance_proposal_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.approve_single_tenant_hsm_instance_proposal({ name: name, quorum_reply: quorum_reply }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.approve_single_tenant_hsm_instance_proposal name: name, quorum_reply: quorum_reply do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.approve_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new(name: name, quorum_reply: quorum_reply) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.approve_single_tenant_hsm_instance_proposal({ name: name, quorum_reply: quorum_reply }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.approve_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new(name: name, quorum_reply: quorum_reply), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, approve_single_tenant_hsm_instance_proposal_client_stub.call_count - end - end - end - - def test_execute_single_tenant_hsm_instance_proposal - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - execute_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_execute_single_tenant_hsm_instance_proposal_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, execute_single_tenant_hsm_instance_proposal_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.execute_single_tenant_hsm_instance_proposal({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.execute_single_tenant_hsm_instance_proposal name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.execute_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.execute_single_tenant_hsm_instance_proposal({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.execute_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, execute_single_tenant_hsm_instance_proposal_client_stub.call_count - end - end - end - - def test_get_single_tenant_hsm_instance_proposal - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_get_single_tenant_hsm_instance_proposal_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_single_tenant_hsm_instance_proposal_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_single_tenant_hsm_instance_proposal({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_single_tenant_hsm_instance_proposal name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_single_tenant_hsm_instance_proposal({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_single_tenant_hsm_instance_proposal_client_stub.call_count - end - end - end - - def test_list_single_tenant_hsm_instance_proposals - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - show_deleted = true - - list_single_tenant_hsm_instance_proposals_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_list_single_tenant_hsm_instance_proposals_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_single_tenant_hsm_instance_proposals_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_single_tenant_hsm_instance_proposals({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_single_tenant_hsm_instance_proposals parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_single_tenant_hsm_instance_proposals ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_single_tenant_hsm_instance_proposals({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_single_tenant_hsm_instance_proposals(::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_single_tenant_hsm_instance_proposals_client_stub.call_count - end - end - end - - def test_delete_single_tenant_hsm_instance_proposal - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::HsmManagement::Rest::ServiceStub.stub :transcode_delete_single_tenant_hsm_instance_proposal_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_single_tenant_hsm_instance_proposal_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_single_tenant_hsm_instance_proposal({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_single_tenant_hsm_instance_proposal name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_single_tenant_hsm_instance_proposal({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_single_tenant_hsm_instance_proposal_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::HsmManagement::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_test.rb deleted file mode 100644 index 6f7e9924c343..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/hsm_management_test.rb +++ /dev/null @@ -1,696 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/hsm_management_pb" -require "google/cloud/kms/v1/hsm_management" - -class ::Google::Cloud::Kms::V1::HsmManagement::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_single_tenant_hsm_instances - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - show_deleted = true - - list_single_tenant_hsm_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_single_tenant_hsm_instances, name - assert_kind_of ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_single_tenant_hsm_instances_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_single_tenant_hsm_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_single_tenant_hsm_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_single_tenant_hsm_instances ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_single_tenant_hsm_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_single_tenant_hsm_instances(::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_single_tenant_hsm_instances_client_stub.call_rpc_count - end - end - - def test_get_single_tenant_hsm_instance - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::SingleTenantHsmInstance.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_single_tenant_hsm_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_single_tenant_hsm_instance, name - assert_kind_of ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_single_tenant_hsm_instance_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_single_tenant_hsm_instance({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_single_tenant_hsm_instance name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_single_tenant_hsm_instance ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_single_tenant_hsm_instance({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_single_tenant_hsm_instance(::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_single_tenant_hsm_instance_client_stub.call_rpc_count - end - end - - def test_create_single_tenant_hsm_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - single_tenant_hsm_instance_id = "hello world" - single_tenant_hsm_instance = {} - - create_single_tenant_hsm_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_single_tenant_hsm_instance, name - assert_kind_of ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["single_tenant_hsm_instance_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::SingleTenantHsmInstance), request["single_tenant_hsm_instance"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_single_tenant_hsm_instance_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_single_tenant_hsm_instance({ parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_single_tenant_hsm_instance parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_single_tenant_hsm_instance ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new(parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_single_tenant_hsm_instance({ parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_single_tenant_hsm_instance(::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest.new(parent: parent, single_tenant_hsm_instance_id: single_tenant_hsm_instance_id, single_tenant_hsm_instance: single_tenant_hsm_instance), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_single_tenant_hsm_instance_client_stub.call_rpc_count - end - end - - def test_create_single_tenant_hsm_instance_proposal - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - single_tenant_hsm_instance_proposal_id = "hello world" - single_tenant_hsm_instance_proposal = {} - - create_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_single_tenant_hsm_instance_proposal, name - assert_kind_of ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["single_tenant_hsm_instance_proposal_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal), request["single_tenant_hsm_instance_proposal"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_single_tenant_hsm_instance_proposal_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_single_tenant_hsm_instance_proposal({ parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_single_tenant_hsm_instance_proposal parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new(parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_single_tenant_hsm_instance_proposal({ parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest.new(parent: parent, single_tenant_hsm_instance_proposal_id: single_tenant_hsm_instance_proposal_id, single_tenant_hsm_instance_proposal: single_tenant_hsm_instance_proposal), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_single_tenant_hsm_instance_proposal_client_stub.call_rpc_count - end - end - - def test_approve_single_tenant_hsm_instance_proposal - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - quorum_reply = {} - - approve_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :approve_single_tenant_hsm_instance_proposal, name - assert_kind_of ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest::QuorumReply), request["quorum_reply"] - assert_equal :quorum_reply, request.approval_payload - refute_nil options - end - - Gapic::ServiceStub.stub :new, approve_single_tenant_hsm_instance_proposal_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.approve_single_tenant_hsm_instance_proposal({ name: name, quorum_reply: quorum_reply }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.approve_single_tenant_hsm_instance_proposal name: name, quorum_reply: quorum_reply do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.approve_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new(name: name, quorum_reply: quorum_reply) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.approve_single_tenant_hsm_instance_proposal({ name: name, quorum_reply: quorum_reply }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.approve_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest.new(name: name, quorum_reply: quorum_reply), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, approve_single_tenant_hsm_instance_proposal_client_stub.call_rpc_count - end - end - - def test_execute_single_tenant_hsm_instance_proposal - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - execute_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :execute_single_tenant_hsm_instance_proposal, name - assert_kind_of ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, execute_single_tenant_hsm_instance_proposal_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.execute_single_tenant_hsm_instance_proposal({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.execute_single_tenant_hsm_instance_proposal name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.execute_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.execute_single_tenant_hsm_instance_proposal({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.execute_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::ExecuteSingleTenantHsmInstanceProposalRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, execute_single_tenant_hsm_instance_proposal_client_stub.call_rpc_count - end - end - - def test_get_single_tenant_hsm_instance_proposal - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_single_tenant_hsm_instance_proposal, name - assert_kind_of ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_single_tenant_hsm_instance_proposal_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_single_tenant_hsm_instance_proposal({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_single_tenant_hsm_instance_proposal name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_single_tenant_hsm_instance_proposal({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_single_tenant_hsm_instance_proposal_client_stub.call_rpc_count - end - end - - def test_list_single_tenant_hsm_instance_proposals - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - show_deleted = true - - list_single_tenant_hsm_instance_proposals_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_single_tenant_hsm_instance_proposals, name - assert_kind_of ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_single_tenant_hsm_instance_proposals_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_single_tenant_hsm_instance_proposals({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_single_tenant_hsm_instance_proposals parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_single_tenant_hsm_instance_proposals ::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_single_tenant_hsm_instance_proposals({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_single_tenant_hsm_instance_proposals(::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_single_tenant_hsm_instance_proposals_client_stub.call_rpc_count - end - end - - def test_delete_single_tenant_hsm_instance_proposal - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_single_tenant_hsm_instance_proposal_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_single_tenant_hsm_instance_proposal, name - assert_kind_of ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_single_tenant_hsm_instance_proposal_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_single_tenant_hsm_instance_proposal({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_single_tenant_hsm_instance_proposal name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_single_tenant_hsm_instance_proposal ::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_single_tenant_hsm_instance_proposal({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_single_tenant_hsm_instance_proposal(::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_single_tenant_hsm_instance_proposal_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::HsmManagement::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Kms::V1::HsmManagement::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::HsmManagement::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Kms::V1::HsmManagement::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb deleted file mode 100644 index a596f706c595..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/key_management_service" - -class ::Google::Cloud::Kms::V1::KeyManagementService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_crypto_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path - end - end - - def test_crypto_key_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path - end - end - - def test_import_job_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.import_job_path project: "value0", location: "value1", key_ring: "value2", import_job: "value3" - assert_equal "projects/value0/locations/value1/keyRings/value2/importJobs/value3", path - end - end - - def test_key_ring_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.key_ring_path project: "value0", location: "value1", key_ring: "value2" - assert_equal "projects/value0/locations/value1/keyRings/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_retired_resource_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.retired_resource_path project: "value0", location: "value1", retired_resource: "value2" - assert_equal "projects/value0/locations/value1/retiredResources/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb deleted file mode 100644 index 29382ada5ddd..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb +++ /dev/null @@ -1,1955 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/kms/v1/service_pb" -require "google/cloud/kms/v1/key_management_service/rest" - - -class ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_key_rings - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ListKeyRingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_key_rings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_list_key_rings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_key_rings_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_key_rings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_key_rings parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_key_rings ::Google::Cloud::Kms::V1::ListKeyRingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_key_rings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_key_rings(::Google::Cloud::Kms::V1::ListKeyRingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_key_rings_client_stub.call_count - end - end - end - - def test_list_crypto_keys - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ListCryptoKeysResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - version_view = :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED - filter = "hello world" - order_by = "hello world" - - list_crypto_keys_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_list_crypto_keys_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_crypto_keys_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_crypto_keys({ parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_crypto_keys parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_crypto_keys ::Google::Cloud::Kms::V1::ListCryptoKeysRequest.new(parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_crypto_keys({ parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_crypto_keys(::Google::Cloud::Kms::V1::ListCryptoKeysRequest.new(parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_crypto_keys_client_stub.call_count - end - end - end - - def test_list_crypto_key_versions - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - view = :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED - filter = "hello world" - order_by = "hello world" - - list_crypto_key_versions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_list_crypto_key_versions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_crypto_key_versions_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_crypto_key_versions({ parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_crypto_key_versions parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_crypto_key_versions ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_crypto_key_versions({ parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_crypto_key_versions(::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_crypto_key_versions_client_stub.call_count - end - end - end - - def test_list_import_jobs - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ListImportJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_import_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_list_import_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_import_jobs_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_import_jobs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_import_jobs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_import_jobs ::Google::Cloud::Kms::V1::ListImportJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_import_jobs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_import_jobs(::Google::Cloud::Kms::V1::ListImportJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_import_jobs_client_stub.call_count - end - end - end - - def test_list_retired_resources - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_retired_resources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_list_retired_resources_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_retired_resources_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_retired_resources parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_retired_resources ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_retired_resources(::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_retired_resources_client_stub.call_count - end - end - end - - def test_get_key_ring - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::KeyRing.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_key_ring_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_key_ring_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_key_ring_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_key_ring({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_key_ring name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_key_ring ::Google::Cloud::Kms::V1::GetKeyRingRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_key_ring({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_key_ring(::Google::Cloud::Kms::V1::GetKeyRingRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_key_ring_client_stub.call_count - end - end - end - - def test_get_crypto_key - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::CryptoKey.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_crypto_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_crypto_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_crypto_key_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_crypto_key({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_crypto_key name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_crypto_key ::Google::Cloud::Kms::V1::GetCryptoKeyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_crypto_key({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_crypto_key(::Google::Cloud::Kms::V1::GetCryptoKeyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_crypto_key_client_stub.call_count - end - end - end - - def test_get_crypto_key_version - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_crypto_key_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_crypto_key_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_crypto_key_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_crypto_key_version ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_crypto_key_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_crypto_key_version(::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_crypto_key_version_client_stub.call_count - end - end - end - - def test_get_public_key - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::PublicKey.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - public_key_format = :PUBLIC_KEY_FORMAT_UNSPECIFIED - - get_public_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_public_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_public_key_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_public_key({ name: name, public_key_format: public_key_format }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_public_key name: name, public_key_format: public_key_format do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_public_key ::Google::Cloud::Kms::V1::GetPublicKeyRequest.new(name: name, public_key_format: public_key_format) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_public_key({ name: name, public_key_format: public_key_format }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_public_key(::Google::Cloud::Kms::V1::GetPublicKeyRequest.new(name: name, public_key_format: public_key_format), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_public_key_client_stub.call_count - end - end - end - - def test_get_import_job - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ImportJob.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_import_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_import_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_import_job_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_import_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_import_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_import_job ::Google::Cloud::Kms::V1::GetImportJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_import_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_import_job(::Google::Cloud::Kms::V1::GetImportJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_import_job_client_stub.call_count - end - end - end - - def test_get_retired_resource - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::RetiredResource.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_retired_resource_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_get_retired_resource_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_retired_resource_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_retired_resource({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_retired_resource name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_retired_resource ::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_retired_resource({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_retired_resource(::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_retired_resource_client_stub.call_count - end - end - end - - def test_create_key_ring - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::KeyRing.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - key_ring_id = "hello world" - key_ring = {} - - create_key_ring_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_create_key_ring_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_key_ring_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_key_ring({ parent: parent, key_ring_id: key_ring_id, key_ring: key_ring }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_key_ring parent: parent, key_ring_id: key_ring_id, key_ring: key_ring do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_key_ring ::Google::Cloud::Kms::V1::CreateKeyRingRequest.new(parent: parent, key_ring_id: key_ring_id, key_ring: key_ring) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_key_ring({ parent: parent, key_ring_id: key_ring_id, key_ring: key_ring }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_key_ring(::Google::Cloud::Kms::V1::CreateKeyRingRequest.new(parent: parent, key_ring_id: key_ring_id, key_ring: key_ring), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_key_ring_client_stub.call_count - end - end - end - - def test_create_crypto_key - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::CryptoKey.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - crypto_key_id = "hello world" - crypto_key = {} - skip_initial_version_creation = true - - create_crypto_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_create_crypto_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_crypto_key_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_crypto_key({ parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_crypto_key parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_crypto_key ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new(parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_crypto_key({ parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_crypto_key(::Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new(parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_crypto_key_client_stub.call_count - end - end - end - - def test_create_crypto_key_version - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - crypto_key_version = {} - - create_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_create_crypto_key_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_crypto_key_version parent: parent, crypto_key_version: crypto_key_version do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_crypto_key_version ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_crypto_key_version(::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_crypto_key_version_client_stub.call_count - end - end - end - - def test_delete_crypto_key - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_crypto_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_delete_crypto_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_crypto_key_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_crypto_key({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_crypto_key name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_crypto_key ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_crypto_key({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_crypto_key(::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_crypto_key_client_stub.call_count - end - end - end - - def test_delete_crypto_key_version - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_delete_crypto_key_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_crypto_key_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_crypto_key_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_crypto_key_version ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_crypto_key_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_crypto_key_version(::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_crypto_key_version_client_stub.call_count - end - end - end - - def test_import_crypto_key_version - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - crypto_key_version = "hello world" - algorithm = :CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED - import_job = "hello world" - wrapped_key = "hello world" - rsa_aes_wrapped_key = "hello world" - - import_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_import_crypto_key_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_crypto_key_version parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_crypto_key_version ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_crypto_key_version(::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_crypto_key_version_client_stub.call_count - end - end - end - - def test_create_import_job - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::ImportJob.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - import_job_id = "hello world" - import_job = {} - - create_import_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_create_import_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_import_job_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_import_job({ parent: parent, import_job_id: import_job_id, import_job: import_job }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_import_job parent: parent, import_job_id: import_job_id, import_job: import_job do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_import_job ::Google::Cloud::Kms::V1::CreateImportJobRequest.new(parent: parent, import_job_id: import_job_id, import_job: import_job) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_import_job({ parent: parent, import_job_id: import_job_id, import_job: import_job }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_import_job(::Google::Cloud::Kms::V1::CreateImportJobRequest.new(parent: parent, import_job_id: import_job_id, import_job: import_job), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_import_job_client_stub.call_count - end - end - end - - def test_update_crypto_key - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::CryptoKey.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - crypto_key = {} - update_mask = {} - - update_crypto_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_update_crypto_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_crypto_key_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_crypto_key({ crypto_key: crypto_key, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_crypto_key crypto_key: crypto_key, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_crypto_key ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new(crypto_key: crypto_key, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_crypto_key({ crypto_key: crypto_key, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_crypto_key(::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new(crypto_key: crypto_key, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_crypto_key_client_stub.call_count - end - end - end - - def test_update_crypto_key_version - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - crypto_key_version = {} - update_mask = {} - - update_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_update_crypto_key_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_crypto_key_version({ crypto_key_version: crypto_key_version, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_crypto_key_version crypto_key_version: crypto_key_version, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_crypto_key_version ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new(crypto_key_version: crypto_key_version, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_crypto_key_version({ crypto_key_version: crypto_key_version, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_crypto_key_version(::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new(crypto_key_version: crypto_key_version, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_crypto_key_version_client_stub.call_count - end - end - end - - def test_update_crypto_key_primary_version - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::CryptoKey.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - crypto_key_version_id = "hello world" - - update_crypto_key_primary_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_update_crypto_key_primary_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_crypto_key_primary_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_crypto_key_primary_version({ name: name, crypto_key_version_id: crypto_key_version_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_crypto_key_primary_version name: name, crypto_key_version_id: crypto_key_version_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_crypto_key_primary_version ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new(name: name, crypto_key_version_id: crypto_key_version_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_crypto_key_primary_version({ name: name, crypto_key_version_id: crypto_key_version_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_crypto_key_primary_version(::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new(name: name, crypto_key_version_id: crypto_key_version_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_crypto_key_primary_version_client_stub.call_count - end - end - end - - def test_destroy_crypto_key_version - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - destroy_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_destroy_crypto_key_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, destroy_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.destroy_crypto_key_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.destroy_crypto_key_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.destroy_crypto_key_version ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.destroy_crypto_key_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.destroy_crypto_key_version(::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, destroy_crypto_key_version_client_stub.call_count - end - end - end - - def test_restore_crypto_key_version - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - restore_crypto_key_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_restore_crypto_key_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, restore_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.restore_crypto_key_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.restore_crypto_key_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.restore_crypto_key_version ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.restore_crypto_key_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.restore_crypto_key_version(::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, restore_crypto_key_version_client_stub.call_count - end - end - end - - def test_encrypt - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::EncryptResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - plaintext = "hello world" - additional_authenticated_data = "hello world" - plaintext_crc32c = {} - additional_authenticated_data_crc32c = {} - - encrypt_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_encrypt_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, encrypt_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.encrypt name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.encrypt ::Google::Cloud::Kms::V1::EncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.encrypt(::Google::Cloud::Kms::V1::EncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, encrypt_client_stub.call_count - end - end - end - - def test_decrypt - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::DecryptResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ciphertext = "hello world" - additional_authenticated_data = "hello world" - ciphertext_crc32c = {} - additional_authenticated_data_crc32c = {} - - decrypt_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_decrypt_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, decrypt_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.decrypt name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.decrypt ::Google::Cloud::Kms::V1::DecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.decrypt(::Google::Cloud::Kms::V1::DecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, decrypt_client_stub.call_count - end - end - end - - def test_raw_encrypt - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::RawEncryptResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - plaintext = "hello world" - additional_authenticated_data = "hello world" - plaintext_crc32c = {} - additional_authenticated_data_crc32c = {} - initialization_vector = "hello world" - initialization_vector_crc32c = {} - - raw_encrypt_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_raw_encrypt_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, raw_encrypt_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.raw_encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.raw_encrypt name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.raw_encrypt ::Google::Cloud::Kms::V1::RawEncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.raw_encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.raw_encrypt(::Google::Cloud::Kms::V1::RawEncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, raw_encrypt_client_stub.call_count - end - end - end - - def test_raw_decrypt - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::RawDecryptResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ciphertext = "hello world" - additional_authenticated_data = "hello world" - initialization_vector = "hello world" - tag_length = 42 - ciphertext_crc32c = {} - additional_authenticated_data_crc32c = {} - initialization_vector_crc32c = {} - - raw_decrypt_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_raw_decrypt_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, raw_decrypt_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.raw_decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.raw_decrypt name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.raw_decrypt ::Google::Cloud::Kms::V1::RawDecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.raw_decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.raw_decrypt(::Google::Cloud::Kms::V1::RawDecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, raw_decrypt_client_stub.call_count - end - end - end - - def test_asymmetric_sign - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::AsymmetricSignResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - digest = {} - digest_crc32c = {} - data = "hello world" - data_crc32c = {} - - asymmetric_sign_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_asymmetric_sign_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, asymmetric_sign_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.asymmetric_sign({ name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.asymmetric_sign name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.asymmetric_sign ::Google::Cloud::Kms::V1::AsymmetricSignRequest.new(name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.asymmetric_sign({ name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.asymmetric_sign(::Google::Cloud::Kms::V1::AsymmetricSignRequest.new(name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, asymmetric_sign_client_stub.call_count - end - end - end - - def test_asymmetric_decrypt - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ciphertext = "hello world" - ciphertext_crc32c = {} - - asymmetric_decrypt_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_asymmetric_decrypt_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, asymmetric_decrypt_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.asymmetric_decrypt({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.asymmetric_decrypt name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.asymmetric_decrypt ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.asymmetric_decrypt({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.asymmetric_decrypt(::Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, asymmetric_decrypt_client_stub.call_count - end - end - end - - def test_mac_sign - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::MacSignResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - data = "hello world" - data_crc32c = {} - - mac_sign_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_mac_sign_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, mac_sign_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.mac_sign({ name: name, data: data, data_crc32c: data_crc32c }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.mac_sign name: name, data: data, data_crc32c: data_crc32c do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.mac_sign ::Google::Cloud::Kms::V1::MacSignRequest.new(name: name, data: data, data_crc32c: data_crc32c) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.mac_sign({ name: name, data: data, data_crc32c: data_crc32c }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.mac_sign(::Google::Cloud::Kms::V1::MacSignRequest.new(name: name, data: data, data_crc32c: data_crc32c), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, mac_sign_client_stub.call_count - end - end - end - - def test_mac_verify - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::MacVerifyResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - data = "hello world" - data_crc32c = {} - mac = "hello world" - mac_crc32c = {} - - mac_verify_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_mac_verify_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, mac_verify_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.mac_verify({ name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.mac_verify name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.mac_verify ::Google::Cloud::Kms::V1::MacVerifyRequest.new(name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.mac_verify({ name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.mac_verify(::Google::Cloud::Kms::V1::MacVerifyRequest.new(name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, mac_verify_client_stub.call_count - end - end - end - - def test_decapsulate - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::DecapsulateResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ciphertext = "hello world" - ciphertext_crc32c = {} - - decapsulate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_decapsulate_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, decapsulate_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.decapsulate({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.decapsulate name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.decapsulate ::Google::Cloud::Kms::V1::DecapsulateRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.decapsulate({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.decapsulate(::Google::Cloud::Kms::V1::DecapsulateRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, decapsulate_client_stub.call_count - end - end - end - - def test_generate_random_bytes - # Create test objects. - client_result = ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - location = "hello world" - length_bytes = 42 - protection_level = :PROTECTION_LEVEL_UNSPECIFIED - - generate_random_bytes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.stub :transcode_generate_random_bytes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_random_bytes_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.generate_random_bytes({ location: location, length_bytes: length_bytes, protection_level: protection_level }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.generate_random_bytes location: location, length_bytes: length_bytes, protection_level: protection_level do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.generate_random_bytes ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new(location: location, length_bytes: length_bytes, protection_level: protection_level) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.generate_random_bytes({ location: location, length_bytes: length_bytes, protection_level: protection_level }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.generate_random_bytes(::Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new(location: location, length_bytes: length_bytes, protection_level: protection_level), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_random_bytes_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb b/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb deleted file mode 100644 index e7de561c10bb..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb +++ /dev/null @@ -1,2216 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/kms/v1/service_pb" -require "google/cloud/kms/v1/key_management_service" - -class ::Google::Cloud::Kms::V1::KeyManagementService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_key_rings - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ListKeyRingsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_key_rings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_key_rings, name - assert_kind_of ::Google::Cloud::Kms::V1::ListKeyRingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_key_rings_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_key_rings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_key_rings parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_key_rings ::Google::Cloud::Kms::V1::ListKeyRingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_key_rings({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_key_rings(::Google::Cloud::Kms::V1::ListKeyRingsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_key_rings_client_stub.call_rpc_count - end - end - - def test_list_crypto_keys - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ListCryptoKeysResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - version_view = :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED - filter = "hello world" - order_by = "hello world" - - list_crypto_keys_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_crypto_keys, name - assert_kind_of ::Google::Cloud::Kms::V1::ListCryptoKeysRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED, request["version_view"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_crypto_keys_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_crypto_keys({ parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_crypto_keys parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_crypto_keys ::Google::Cloud::Kms::V1::ListCryptoKeysRequest.new(parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_crypto_keys({ parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_crypto_keys(::Google::Cloud::Kms::V1::ListCryptoKeysRequest.new(parent: parent, page_size: page_size, page_token: page_token, version_view: version_view, filter: filter, order_by: order_by), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_crypto_keys_client_stub.call_rpc_count - end - end - - def test_list_crypto_key_versions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - view = :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED - filter = "hello world" - order_by = "hello world" - - list_crypto_key_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_crypto_key_versions, name - assert_kind_of ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal :CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED, request["view"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_crypto_key_versions_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_crypto_key_versions({ parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_crypto_key_versions parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_crypto_key_versions ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_crypto_key_versions({ parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_crypto_key_versions(::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view, filter: filter, order_by: order_by), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_crypto_key_versions_client_stub.call_rpc_count - end - end - - def test_list_import_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ListImportJobsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_import_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_import_jobs, name - assert_kind_of ::Google::Cloud::Kms::V1::ListImportJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_import_jobs_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_import_jobs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_import_jobs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_import_jobs ::Google::Cloud::Kms::V1::ListImportJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_import_jobs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_import_jobs(::Google::Cloud::Kms::V1::ListImportJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_import_jobs_client_stub.call_rpc_count - end - end - - def test_list_retired_resources - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ListRetiredResourcesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_retired_resources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_retired_resources, name - assert_kind_of ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_retired_resources_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_retired_resources parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_retired_resources ::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_retired_resources({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_retired_resources(::Google::Cloud::Kms::V1::ListRetiredResourcesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_retired_resources_client_stub.call_rpc_count - end - end - - def test_get_key_ring - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::KeyRing.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_key_ring_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_key_ring, name - assert_kind_of ::Google::Cloud::Kms::V1::GetKeyRingRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_key_ring_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_key_ring({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_key_ring name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_key_ring ::Google::Cloud::Kms::V1::GetKeyRingRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_key_ring({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_key_ring(::Google::Cloud::Kms::V1::GetKeyRingRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_key_ring_client_stub.call_rpc_count - end - end - - def test_get_crypto_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::CryptoKey.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_crypto_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_crypto_key, name - assert_kind_of ::Google::Cloud::Kms::V1::GetCryptoKeyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_crypto_key_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_crypto_key({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_crypto_key name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_crypto_key ::Google::Cloud::Kms::V1::GetCryptoKeyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_crypto_key({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_crypto_key(::Google::Cloud::Kms::V1::GetCryptoKeyRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_crypto_key_client_stub.call_rpc_count - end - end - - def test_get_crypto_key_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_crypto_key_version, name - assert_kind_of ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_crypto_key_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_crypto_key_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_crypto_key_version ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_crypto_key_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_crypto_key_version(::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_crypto_key_version_client_stub.call_rpc_count - end - end - - def test_get_public_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::PublicKey.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - public_key_format = :PUBLIC_KEY_FORMAT_UNSPECIFIED - - get_public_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_public_key, name - assert_kind_of ::Google::Cloud::Kms::V1::GetPublicKeyRequest, request - assert_equal "hello world", request["name"] - assert_equal :PUBLIC_KEY_FORMAT_UNSPECIFIED, request["public_key_format"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_public_key_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_public_key({ name: name, public_key_format: public_key_format }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_public_key name: name, public_key_format: public_key_format do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_public_key ::Google::Cloud::Kms::V1::GetPublicKeyRequest.new(name: name, public_key_format: public_key_format) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_public_key({ name: name, public_key_format: public_key_format }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_public_key(::Google::Cloud::Kms::V1::GetPublicKeyRequest.new(name: name, public_key_format: public_key_format), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_public_key_client_stub.call_rpc_count - end - end - - def test_get_import_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ImportJob.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_import_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_import_job, name - assert_kind_of ::Google::Cloud::Kms::V1::GetImportJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_import_job_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_import_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_import_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_import_job ::Google::Cloud::Kms::V1::GetImportJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_import_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_import_job(::Google::Cloud::Kms::V1::GetImportJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_import_job_client_stub.call_rpc_count - end - end - - def test_get_retired_resource - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::RetiredResource.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_retired_resource_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_retired_resource, name - assert_kind_of ::Google::Cloud::Kms::V1::GetRetiredResourceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_retired_resource_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_retired_resource({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_retired_resource name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_retired_resource ::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_retired_resource({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_retired_resource(::Google::Cloud::Kms::V1::GetRetiredResourceRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_retired_resource_client_stub.call_rpc_count - end - end - - def test_create_key_ring - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::KeyRing.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - key_ring_id = "hello world" - key_ring = {} - - create_key_ring_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_key_ring, name - assert_kind_of ::Google::Cloud::Kms::V1::CreateKeyRingRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["key_ring_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::KeyRing), request["key_ring"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_key_ring_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_key_ring({ parent: parent, key_ring_id: key_ring_id, key_ring: key_ring }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_key_ring parent: parent, key_ring_id: key_ring_id, key_ring: key_ring do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_key_ring ::Google::Cloud::Kms::V1::CreateKeyRingRequest.new(parent: parent, key_ring_id: key_ring_id, key_ring: key_ring) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_key_ring({ parent: parent, key_ring_id: key_ring_id, key_ring: key_ring }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_key_ring(::Google::Cloud::Kms::V1::CreateKeyRingRequest.new(parent: parent, key_ring_id: key_ring_id, key_ring: key_ring), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_key_ring_client_stub.call_rpc_count - end - end - - def test_create_crypto_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::CryptoKey.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - crypto_key_id = "hello world" - crypto_key = {} - skip_initial_version_creation = true - - create_crypto_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_crypto_key, name - assert_kind_of ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["crypto_key_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::CryptoKey), request["crypto_key"] - assert_equal true, request["skip_initial_version_creation"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_crypto_key_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_crypto_key({ parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_crypto_key parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_crypto_key ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new(parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_crypto_key({ parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_crypto_key(::Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new(parent: parent, crypto_key_id: crypto_key_id, crypto_key: crypto_key, skip_initial_version_creation: skip_initial_version_creation), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_crypto_key_client_stub.call_rpc_count - end - end - - def test_create_crypto_key_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - crypto_key_version = {} - - create_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_crypto_key_version, name - assert_kind_of ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::CryptoKeyVersion), request["crypto_key_version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_crypto_key_version parent: parent, crypto_key_version: crypto_key_version do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_crypto_key_version ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_crypto_key_version(::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_crypto_key_version_client_stub.call_rpc_count - end - end - - def test_delete_crypto_key - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_crypto_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_crypto_key, name - assert_kind_of ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_crypto_key_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_crypto_key({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_crypto_key name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_crypto_key ::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_crypto_key({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_crypto_key(::Google::Cloud::Kms::V1::DeleteCryptoKeyRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_crypto_key_client_stub.call_rpc_count - end - end - - def test_delete_crypto_key_version - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_crypto_key_version, name - assert_kind_of ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_crypto_key_version({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_crypto_key_version name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_crypto_key_version ::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_crypto_key_version({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_crypto_key_version(::Google::Cloud::Kms::V1::DeleteCryptoKeyVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_crypto_key_version_client_stub.call_rpc_count - end - end - - def test_import_crypto_key_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - crypto_key_version = "hello world" - algorithm = :CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED - import_job = "hello world" - wrapped_key = "hello world" - rsa_aes_wrapped_key = "hello world" - - import_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_crypto_key_version, name - assert_kind_of ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["crypto_key_version"] - assert_equal :CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED, request["algorithm"] - assert_equal "hello world", request["import_job"] - assert_equal "hello world", request["wrapped_key"] - assert_equal "hello world", request["rsa_aes_wrapped_key"] - assert_equal :rsa_aes_wrapped_key, request.wrapped_key_material - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_crypto_key_version parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_crypto_key_version ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_crypto_key_version({ parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_crypto_key_version(::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new(parent: parent, crypto_key_version: crypto_key_version, algorithm: algorithm, import_job: import_job, wrapped_key: wrapped_key, rsa_aes_wrapped_key: rsa_aes_wrapped_key), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, import_crypto_key_version_client_stub.call_rpc_count - end - end - - def test_create_import_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::ImportJob.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - import_job_id = "hello world" - import_job = {} - - create_import_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_import_job, name - assert_kind_of ::Google::Cloud::Kms::V1::CreateImportJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["import_job_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::ImportJob), request["import_job"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_import_job_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_import_job({ parent: parent, import_job_id: import_job_id, import_job: import_job }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_import_job parent: parent, import_job_id: import_job_id, import_job: import_job do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_import_job ::Google::Cloud::Kms::V1::CreateImportJobRequest.new(parent: parent, import_job_id: import_job_id, import_job: import_job) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_import_job({ parent: parent, import_job_id: import_job_id, import_job: import_job }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_import_job(::Google::Cloud::Kms::V1::CreateImportJobRequest.new(parent: parent, import_job_id: import_job_id, import_job: import_job), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_import_job_client_stub.call_rpc_count - end - end - - def test_update_crypto_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::CryptoKey.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - crypto_key = {} - update_mask = {} - - update_crypto_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_crypto_key, name - assert_kind_of ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::CryptoKey), request["crypto_key"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_crypto_key_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_crypto_key({ crypto_key: crypto_key, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_crypto_key crypto_key: crypto_key, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_crypto_key ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new(crypto_key: crypto_key, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_crypto_key({ crypto_key: crypto_key, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_crypto_key(::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new(crypto_key: crypto_key, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_crypto_key_client_stub.call_rpc_count - end - end - - def test_update_crypto_key_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - crypto_key_version = {} - update_mask = {} - - update_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_crypto_key_version, name - assert_kind_of ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::CryptoKeyVersion), request["crypto_key_version"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_crypto_key_version({ crypto_key_version: crypto_key_version, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_crypto_key_version crypto_key_version: crypto_key_version, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_crypto_key_version ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new(crypto_key_version: crypto_key_version, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_crypto_key_version({ crypto_key_version: crypto_key_version, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_crypto_key_version(::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new(crypto_key_version: crypto_key_version, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_crypto_key_version_client_stub.call_rpc_count - end - end - - def test_update_crypto_key_primary_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::CryptoKey.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - crypto_key_version_id = "hello world" - - update_crypto_key_primary_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_crypto_key_primary_version, name - assert_kind_of ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["crypto_key_version_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_crypto_key_primary_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_crypto_key_primary_version({ name: name, crypto_key_version_id: crypto_key_version_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_crypto_key_primary_version name: name, crypto_key_version_id: crypto_key_version_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_crypto_key_primary_version ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new(name: name, crypto_key_version_id: crypto_key_version_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_crypto_key_primary_version({ name: name, crypto_key_version_id: crypto_key_version_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_crypto_key_primary_version(::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new(name: name, crypto_key_version_id: crypto_key_version_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_crypto_key_primary_version_client_stub.call_rpc_count - end - end - - def test_destroy_crypto_key_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - destroy_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :destroy_crypto_key_version, name - assert_kind_of ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, destroy_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.destroy_crypto_key_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.destroy_crypto_key_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.destroy_crypto_key_version ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.destroy_crypto_key_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.destroy_crypto_key_version(::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, destroy_crypto_key_version_client_stub.call_rpc_count - end - end - - def test_restore_crypto_key_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::CryptoKeyVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - restore_crypto_key_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :restore_crypto_key_version, name - assert_kind_of ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, restore_crypto_key_version_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.restore_crypto_key_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.restore_crypto_key_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.restore_crypto_key_version ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.restore_crypto_key_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.restore_crypto_key_version(::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, restore_crypto_key_version_client_stub.call_rpc_count - end - end - - def test_encrypt - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::EncryptResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - plaintext = "hello world" - additional_authenticated_data = "hello world" - plaintext_crc32c = {} - additional_authenticated_data_crc32c = {} - - encrypt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :encrypt, name - assert_kind_of ::Google::Cloud::Kms::V1::EncryptRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["plaintext"] - assert_equal "hello world", request["additional_authenticated_data"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["plaintext_crc32c"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["additional_authenticated_data_crc32c"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, encrypt_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.encrypt name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.encrypt ::Google::Cloud::Kms::V1::EncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.encrypt(::Google::Cloud::Kms::V1::EncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, encrypt_client_stub.call_rpc_count - end - end - - def test_decrypt - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::DecryptResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ciphertext = "hello world" - additional_authenticated_data = "hello world" - ciphertext_crc32c = {} - additional_authenticated_data_crc32c = {} - - decrypt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :decrypt, name - assert_kind_of ::Google::Cloud::Kms::V1::DecryptRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["ciphertext"] - assert_equal "hello world", request["additional_authenticated_data"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["ciphertext_crc32c"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["additional_authenticated_data_crc32c"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, decrypt_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.decrypt name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.decrypt ::Google::Cloud::Kms::V1::DecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.decrypt(::Google::Cloud::Kms::V1::DecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, decrypt_client_stub.call_rpc_count - end - end - - def test_raw_encrypt - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::RawEncryptResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - plaintext = "hello world" - additional_authenticated_data = "hello world" - plaintext_crc32c = {} - additional_authenticated_data_crc32c = {} - initialization_vector = "hello world" - initialization_vector_crc32c = {} - - raw_encrypt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :raw_encrypt, name - assert_kind_of ::Google::Cloud::Kms::V1::RawEncryptRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["plaintext"] - assert_equal "hello world", request["additional_authenticated_data"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["plaintext_crc32c"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["additional_authenticated_data_crc32c"] - assert_equal "hello world", request["initialization_vector"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["initialization_vector_crc32c"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, raw_encrypt_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.raw_encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.raw_encrypt name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.raw_encrypt ::Google::Cloud::Kms::V1::RawEncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.raw_encrypt({ name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.raw_encrypt(::Google::Cloud::Kms::V1::RawEncryptRequest.new(name: name, plaintext: plaintext, additional_authenticated_data: additional_authenticated_data, plaintext_crc32c: plaintext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector: initialization_vector, initialization_vector_crc32c: initialization_vector_crc32c), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, raw_encrypt_client_stub.call_rpc_count - end - end - - def test_raw_decrypt - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::RawDecryptResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ciphertext = "hello world" - additional_authenticated_data = "hello world" - initialization_vector = "hello world" - tag_length = 42 - ciphertext_crc32c = {} - additional_authenticated_data_crc32c = {} - initialization_vector_crc32c = {} - - raw_decrypt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :raw_decrypt, name - assert_kind_of ::Google::Cloud::Kms::V1::RawDecryptRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["ciphertext"] - assert_equal "hello world", request["additional_authenticated_data"] - assert_equal "hello world", request["initialization_vector"] - assert_equal 42, request["tag_length"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["ciphertext_crc32c"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["additional_authenticated_data_crc32c"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["initialization_vector_crc32c"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, raw_decrypt_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.raw_decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.raw_decrypt name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.raw_decrypt ::Google::Cloud::Kms::V1::RawDecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.raw_decrypt({ name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.raw_decrypt(::Google::Cloud::Kms::V1::RawDecryptRequest.new(name: name, ciphertext: ciphertext, additional_authenticated_data: additional_authenticated_data, initialization_vector: initialization_vector, tag_length: tag_length, ciphertext_crc32c: ciphertext_crc32c, additional_authenticated_data_crc32c: additional_authenticated_data_crc32c, initialization_vector_crc32c: initialization_vector_crc32c), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, raw_decrypt_client_stub.call_rpc_count - end - end - - def test_asymmetric_sign - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::AsymmetricSignResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - digest = {} - digest_crc32c = {} - data = "hello world" - data_crc32c = {} - - asymmetric_sign_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :asymmetric_sign, name - assert_kind_of ::Google::Cloud::Kms::V1::AsymmetricSignRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Kms::V1::Digest), request["digest"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["digest_crc32c"] - assert_equal "hello world", request["data"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["data_crc32c"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, asymmetric_sign_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.asymmetric_sign({ name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.asymmetric_sign name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.asymmetric_sign ::Google::Cloud::Kms::V1::AsymmetricSignRequest.new(name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.asymmetric_sign({ name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.asymmetric_sign(::Google::Cloud::Kms::V1::AsymmetricSignRequest.new(name: name, digest: digest, digest_crc32c: digest_crc32c, data: data, data_crc32c: data_crc32c), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, asymmetric_sign_client_stub.call_rpc_count - end - end - - def test_asymmetric_decrypt - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ciphertext = "hello world" - ciphertext_crc32c = {} - - asymmetric_decrypt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :asymmetric_decrypt, name - assert_kind_of ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["ciphertext"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["ciphertext_crc32c"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, asymmetric_decrypt_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.asymmetric_decrypt({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.asymmetric_decrypt name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.asymmetric_decrypt ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.asymmetric_decrypt({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.asymmetric_decrypt(::Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, asymmetric_decrypt_client_stub.call_rpc_count - end - end - - def test_mac_sign - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::MacSignResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - data = "hello world" - data_crc32c = {} - - mac_sign_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :mac_sign, name - assert_kind_of ::Google::Cloud::Kms::V1::MacSignRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["data"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["data_crc32c"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, mac_sign_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.mac_sign({ name: name, data: data, data_crc32c: data_crc32c }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.mac_sign name: name, data: data, data_crc32c: data_crc32c do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.mac_sign ::Google::Cloud::Kms::V1::MacSignRequest.new(name: name, data: data, data_crc32c: data_crc32c) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.mac_sign({ name: name, data: data, data_crc32c: data_crc32c }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.mac_sign(::Google::Cloud::Kms::V1::MacSignRequest.new(name: name, data: data, data_crc32c: data_crc32c), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, mac_sign_client_stub.call_rpc_count - end - end - - def test_mac_verify - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::MacVerifyResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - data = "hello world" - data_crc32c = {} - mac = "hello world" - mac_crc32c = {} - - mac_verify_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :mac_verify, name - assert_kind_of ::Google::Cloud::Kms::V1::MacVerifyRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["data"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["data_crc32c"] - assert_equal "hello world", request["mac"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["mac_crc32c"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, mac_verify_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.mac_verify({ name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.mac_verify name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.mac_verify ::Google::Cloud::Kms::V1::MacVerifyRequest.new(name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.mac_verify({ name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.mac_verify(::Google::Cloud::Kms::V1::MacVerifyRequest.new(name: name, data: data, data_crc32c: data_crc32c, mac: mac, mac_crc32c: mac_crc32c), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, mac_verify_client_stub.call_rpc_count - end - end - - def test_decapsulate - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::DecapsulateResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ciphertext = "hello world" - ciphertext_crc32c = {} - - decapsulate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :decapsulate, name - assert_kind_of ::Google::Cloud::Kms::V1::DecapsulateRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["ciphertext"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int64Value), request["ciphertext_crc32c"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, decapsulate_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.decapsulate({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.decapsulate name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.decapsulate ::Google::Cloud::Kms::V1::DecapsulateRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.decapsulate({ name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.decapsulate(::Google::Cloud::Kms::V1::DecapsulateRequest.new(name: name, ciphertext: ciphertext, ciphertext_crc32c: ciphertext_crc32c), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, decapsulate_client_stub.call_rpc_count - end - end - - def test_generate_random_bytes - # Create GRPC objects. - grpc_response = ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - location = "hello world" - length_bytes = 42 - protection_level = :PROTECTION_LEVEL_UNSPECIFIED - - generate_random_bytes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_random_bytes, name - assert_kind_of ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest, request - assert_equal "hello world", request["location"] - assert_equal 42, request["length_bytes"] - assert_equal :PROTECTION_LEVEL_UNSPECIFIED, request["protection_level"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_random_bytes_client_stub do - # Create client - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.generate_random_bytes({ location: location, length_bytes: length_bytes, protection_level: protection_level }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.generate_random_bytes location: location, length_bytes: length_bytes, protection_level: protection_level do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.generate_random_bytes ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new(location: location, length_bytes: length_bytes, protection_level: protection_level) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.generate_random_bytes({ location: location, length_bytes: length_bytes, protection_level: protection_level }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.generate_random_bytes(::Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new(location: location, length_bytes: length_bytes, protection_level: protection_level), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_random_bytes_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Kms::V1::KeyManagementService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Kms::V1::KeyManagementService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Kms::V1::KeyManagementService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-kms-v1/test/helper.rb b/owl-bot-staging/google-cloud-kms-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-kms-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"